A downloadable project

DOWNLOAD FILES 

This week we are building a Maya mesh exporter to output our human-readable files and stress testing out games with these newly created meshes. For the scene, I enabled depth buffering and ran into some tech debt that was time to be paid. My gameObject system couldn’t handle moving a rigid body on separate meshes. The entire scene would just move. 

Controls: 

  • Camera: WASD
  • Cube: Arrow Keys
  • Space: replace shader
  • Enter: hide mesh

Maya Mesh Exporter:

The Maya exporter we made needs a reference to Engine/Windows project, but nothing needs a reference to the MayaMeshExporter since it builds an external plugin. To debug the exporter during Maya’s processes, we can hook up the Visual Studio debugger and can even hit breakpoints.

For the time being, I’m just exporting Vertex and Index data since that is all my engine can store within the game. In the future, I will pull the color, normals, tangents, bitangents, and texture coordinates into my file.

Tech Debt:

So I had made my game object in a way to be able to store multiple separate meshes/effects, and you could add a rigidbody component to move all of them, but this caused an issue when passing that data into our graphics thread. I was just moving all meshes in the scene, not just the specific few that I wanted. I was also calling my submit data function for each game object I had, which overrides the data you previously sent. The changes I made to fix all these issues were:

  • Passing rigidbody and meshes together into the graphics thread.
  • Making a Set data structure to hold unique pointers to my meshes/effects 
  • Making a Map that used a key of meshes/effect pointers to get their corresponding rigidbody

Now every gameObject call submits their data to be rendered without needing to know about any other gameObject. The graphics engine handles the ordering and pairing. Overall, these changes make the engine easier to program with, but I am worried about the performance of checking a Set every game thread update. 

Too many Vertices:

To test the vertices limit, I stole a Companion Cube model off the internet, loaded it into Maya, and then exported it with my plugin. When I tried to render it, the entire model seemed broken; random pieces were missing. After digging into the code, I realized the vertices limit per mesh was 65535, which is the max size of a uint16_t. This means the index couldn’t reference an index stored passed the point of 65535, which is why the model seems to be missing faces. It doesn’t lead to a crash and will just not display any of that data, so it’s important to add a log error with how many vertices you surpassed by.

Download

Download
Chai_Assignment7.zip 1,002 kB

Leave a comment

Log in with itch.io to leave a comment.