Thursday, February 28, 2013

Graphics Write-Up #7

Not a whole lot to say this time around.  Getting transparency to work was pretty easy, just a matter of setting the render state and then actually using an alpha value.  Most of my time this week was spent with getting the sorting code working correctly and coming up with a best as possible way to sort the transparent objects back to front every update.  Oh, and changing files around, but that's getting faster.

Getting the transparency working was awesome, the binary alpha in particular is really sweet.  It was also cool to see how big of a difference sorting the transparent objects back to front made.  You'd inherently think it shouldn't matter at all (since you can see through them!), but when I was drawing them front to back since that's the way I ordered them in my scene file, you could only see the one in front.  It really drove home the lesson.

Now that I'm looking at the 2nd screenshot below I should probably put the Render state code inside it's own PIX event just so it looks a little nicer, but I'll do that for next week since I don't want to go re-upload the code.

I also made sure to go back and fix all the little errors I'd made after getting feedback on Assignment 5.  6 will still have the same issues since it was submitted before then unfortunately.  Summing them up: I normalized the incoming normals to my fragment shaders so specular lighting is working at last.  I also took out my hard coded debugging specular exponent value and now pull it directly from the material as opposed to the scene file.  And....  I think that's everything that was wrong....


PIX events with only one Opaque and Transparent:

PIX events showing Opaque and Transparent expanded:

What it looks like now:



Link to Code: http://eng.utah.edu/~jthummel/graphics/ThummelGraphicsAssignment7.zip

No comments:

Post a Comment