top of page

PLATFORM-INDEPENDENT MESH FILE

Controls: Esc - To quit game

The minimum number of vertices required to draw a square in indexed drawing is four. 
The number of indices required is six.
The maximum number of vertices the mesh can have is:
Your number of vertices is a uint16_t. Therefore, the max value is FFFF (‭65535) for uint16_t ‬ that is the total including zero is 65536.‬‬‬
The maximum number of triangles your mesh can have is 65536-2=65534. This is because only your first triangle needs three vertices and after that the new triangle can share two vertices.
It is important to keep the mesh file human readable because 
1.    It is easy to debug.
2.    In near future we are going to export this file format using Maya.
3.    Then we are going to parse it using our mesh builder to build binary mesh files which are fast and optimized for loading
4.    Hence keeping the file as human readable as possible is not an issue as we won’t have to write them manually afterwards.
The winding order is right handed because it is easier to export such winding from Maya.
In my color loader 3 or 4 values both are valid. In case someone puts 3 the alpha is initialized to 1 by default. I like to keep things flexible as far as possible and alpha of a mesh as per me should be editable to do funky color animation stuff.
I chose to keep my file extension .txtmesh as this is a text file which is human readable and in future we will have .binmesh files which will be binary meshes generated by our builder.
Yes I put two sub-directories in AuthoredAssetDir and BuiltAssetDir because there are two type of files now Shaders and Meshes and I like to keep my directory structure organized.
1.    In this assignment we made the mesh to load at runtime using LUA. 
2.    We made the draw call to be indexed
3.    We added color to our vertex data struct and made the square colorful using fragment shader.
The point of this assignment was to make our game more data driven instead of being hard coded.
It was also to write an efficient LUA parser to read the lua file we create for our mesh.
We also got a glimpse into writing some graphic api calls to make our colors and indices work.
For me this was a good learning experience. I enjoyed writing the LUA parser. It was simple. 
I made a silly error in stride of OpenGL and spent like an hour to figure it out. 
Also the thing we discussed in our class on Monday (std::string path) is not required as Graphics is not the startup project. 

bottom of page