Monday, November 10, 2014

Engineering II - Assignment 7 - Mesh Building Pipeline

Assignment 7 - Mesh Building Pipeline

ZIP Link

Assignment7.zip

Write-Up
The basics of this assignment was to have a mesh class that is capable of being built during the build step, and saving that information in a binary file. Once that is done, you then can read the binary mesh information for each entity using that mesh. The mesh file needs to be human-readable, which is shown in the write-up below.

Technical Write-Up

The mesh file is human-readable, as it is split to show the number of vertices and indices of the mesh, and then lists the position and color of each vertex, and then lists the order to draw the indices. An image of the human-readable floorMesh.lua file is below:

 

When the file is stored in binary it looks like below:

 

This helps reduce the size of the file, in my case, from 666 bytes to the binary file size of 96 bytes. I used a builder file to run during the build step, rather than load the files into binary tudring run-time. 

Realized Learning Moments

I found that I needed to rewrite most of my mesh file, my graphics renderer, and then create all of the lua file to read the files. I used PIX to huntdown the issue of nothing drawing.

The issue was determined to be somewhere with the indices values. All of them were storing the indcies[0] value of "0". The values should have been different. I stepped into where the indices were being read by the lua file, and struggled to find the issue. I learned more about the actual lua function "lua_pushinteger(...)", because of the parameters being passed to it.

I then used debugging with breakpoints to confirm the vertex and index counts, as well as the values stored in the vertices and indices buffers. This helped me understand how it's being stored and used. I have realized that I am going to have to restructure my game code and rewrite some of my engine code.

Time Used

Reading: 3 hours
Write-Up: 1 hour
Technical Write-Up: 1 hour
Coding: 12 hours

No comments:

Post a Comment