top of page

INTRODUCING TEXTURES

Controls: Esc - To quit game
Arrow Keys to give move direction to the sphere
WASD to change the rotation-axis of the cube
Move the camera
OU(Z-axis)
IK(Y-axis)
JL(X-axis)
Rotate the camera
YR(Z-axis)
TG(Y-axis)
FH(X-axis) 
C/V to traverse cameras in the camera vector
 
The cube and the apple have textures now. 
 
If we create a material with two or more textures, we would create a table of textures and read all the textures from it. We would also have to write a loop in the overloaded referenced assets function in the material builder to register all referenced assets. Also, we would store the total number of textures before the texture data begins in the binary file to write a loop for their extraction.
 
I had to write out the length of the first path before it to know where to bump the pointer. 
Before the texture data begins there would be a count specifying total number of textures. It will act as stopping condition for the loop iterator. We would also have the length of each texture path before it to know where to bump the pointer to get the next texture path in the binary data.
 
For figuring out where the effect path starts I bump the pointer by size of the sMaterial struct and then I extract the length of the effect path, bump the pointer by type of the count (i.e. uint8_t) and I get the effect path. After that I bump my pointer by the stored length and point to the length of the texture path. I know I do not need to store its length but I have not changed my helper utility that I created to write c string out to a file for this assignment. So, I copy this length in the count variable and bump the pointer by type of the count (i.e. uint8_t) and I get the texture path. 
I am working now on the camera movement to follow the snake but it is not finished yet. I may cut out to incorporate saving system depending on the time I get for the final.
For this assignment, we implemented textures. I would have personally liked if the assignment had a requirement or an optional requirement to implement a material with two or more textures. 
I did the uvs part so now they are stored as half precision floats(16bit) or uint16_t. For the conversion, I used a class that I found online on stack overflow and integrated it into our math library. 

bottom of page