Monday, February 11, 2013

Game Graphics Assignment 5

Overall not too difficult of an assignment. Took some time, but not too bad. I am not sure what was taken out of the assignment, would be interested to know how much more work the original assignment was.

I had implemented specular lighting before (for game engineering 2), so i didn't have much trouble there. Had to play with which direction the normal should face a bit, but got it quickly.

One thing that came up was that i had the wrong arguments to my draw call. It wasn't an issue because i was only daring a single box (so all the offsets were 0), but adding the floor caused problems. After taking a look at my draw call in my engine, it was quick to switch the arguments around and get it drawing the floor.

The biggest part decision wise was how to structure the uniforms. I changed how i was doing it twice while developing it. But I ended up with a nice system that can take any size of a float array and set it only when it needs to be set. How i do this is every time i set a uniform i keep track of its name and value. Then when i try to set the next one i look to see if it is already set. In this case even if i change materials, if they both have the same uniform (name and value) it will not set it again. This all gets cleared when i change the shader.

Everything should be working in the assignment.
Link To Code

Picture from pix debugging


No comments:

Post a Comment