Texture Builder

This assignment was intended to add texture in the 3D meshes to make them look better in the game. For this we were asked to create a texture builder which will build the texture in format for DirectX. For this we need to change the order of the texture coordinates in the vertex structure. As DirectX and OpenGL uses different format for representing the textures; we need to change the texture coordinates accordingly. But as we were using Maya for exporting our texture coordinate, which follows OpenGL convention for texture coordinates, we were need to change the texture coordinate for OpenGL. But as the texture are loaded in DirectX format, we need to change the coordinate for both of the format in the Mesh Builder.

Above is my format for the materail binary file. I created a map structure which carry the information about the texture details. Moreoverover, using that I can add mulitple texture to my mesh. Below is mu=y structure for my material human readable for containing map structure. I chose this format as I thought if I have multiple texture I can switch it in inside the game to the meshes on particular events.

I chose to create an class for the texture. The reason for this is to share the texture resource among different meshes and to minimize the memory utilization in the game. Moreover, it also let me keep track of all textures and I can easily delete the structure by just calling the delete on the texture List.

After approx 10 hours of work, I got everything working but still I have some problem in release/Debug build of OpenGL which I am unable to figure out as I ran out of time. Perhaps I will try later to fix them. Although I got the right image for both the platforms. Below is the pixelated image for the DirectX and the smooth image for the OpenGL.

Here is the DirectX link to the executable. Controls 'WASD' for Camera Movement and Arrow Keys for Cube Movement.


T: 385-225-5721  

  • LinkedIn Clean
  • Facebook Clean
  • Twitter Clean
  • Google+ Clean

Follow me


© 2015 by Amit Prakash

This site was designed with the
website builder. Create your website today.
Start Now