The main objective of this assignment is to add Textures to our models from Maya. Basically our material file will contain the path for the texture file which will be either in png or jpeg format.
Every texture will have their own texture coordinates which are called u,v coordinates. We need to add a uniform variable called sampler which will basically sample the texture coordinates which are exported from Maya.
In the Maya Exporter earlier we only had a pos and a color, but now we need to update the Maya Exporter so that it can include the textures. Basically we need update the Maya Exporter to add the u,v texture coordinates so that they can be exported to the Mesh files from Maya . We will also need to add the Texture Builder tool to process the texture files in the asset folder.
So the textures need to be associated with the Material Files so that we can add the textures to the material files and the material files itself would allow us to basically set the textures, effects etc. So basically the material file would allow us to make the game objects opaque or transparent, change the rgb color values and now add textures.
The following picture basically shows the blue transparent material lua file. Basically as discussed above the texure_data is addition to the file which contains the “sampler” and the path of the texture file.
After adding the textures the binary file looks like as follows:
Basically after the null terminator of the uniform name, we see a “01” which basically indicates the count. So the material file is using only one texture and so the texture count is 1. Followed by the texture count is the texture path . It was easier to append the texture data after the effect path and uniform data since I didn’t need to change the existing effect path and uniform data information. I thought about adding the textures in materials rather than creating new struct for Textures but it was cluttering my materials so I basically added a new struct for the texture to prevent the cluttering of code .
Direct 3D Output
OPEN GL OUTPUT
If you basically notice the two outputs you will see that the Direct3D output is a but more sharper around the edges than the OpenGL output. This is because of the difference in the sampling rates of both the platforms.
Estimated Completion Time – 16 hours
The controls for camera are First Person Shooter controls as follows:
A – to strafe left
D – to strafe right
W – to move forward
S – to move backward
Space – To fly upward
Z – to Dive Downward
E – rotate Camera ClockWise
Q – rotate Camera AntiClockwise
C- rotate the man around the house in clockwise direction to guard the house
X- rotate the man around the house in anti-clockwise direction to guard the house
Use arrow keys to control the mans movement
Link To download :
After downloading the link run Game.exe.