Thursday, April 11, 2013

Graphics Write-Up #10 and #11

#10

This was a very interesting and moderately challenging assignment.  Getting the depth pass up and working wasn't too bad, but figuring out all the issues that cropped up from doing so took more time.  I had a really interesting issue where slices of my spheres weren't showing up (making it look kinda like a watermelon).  Additionally, when the meshes moved half of the sphere would vanish like this (Ignore the black sphere in the middle, it's supposed to be like that):

Left:
Right:


Up:

Moving the meshes down did the same thing, but also completely removed the floor.  IN the end, this turned out to be caused because of the order I was making calls.  I was doing the Depth pass, then updating the meshes, and then doing the normal draw pass.  The striped watermelon effect was caused by the natural rotation of the spheres, and the half spheres being removed was from moving them.  Since the depth was being captured and then changed, pixels were failing the depth test and being removed.  The easy fix was to of course do the mesh update first, before anything else.

An additional change I made to make the code a bit nicer was turning the creation of Fragment and Vertex shaders into a method.  This allowed me to set up the correct shaders to use for the depth pass, and was later useful on the next assignment when I had to use more new shaders.

Here's what my Depth pass and the depth buffer of Pix look like side by side:

My depth pass:

PIX's Depth Buffer:

Here's the scene itself with the soft blending edges:


#11

This was a very easy assignment since it was so similar to the previous two.  New textures and a surface, setting them at the right place, all it really was was adding transparency to the opaque bucket.  Drawing the quads was a simple matter of going back to the first assignment and pulling the code into the current project. This was a sort enough assignment I actually ended up writing all the code without testing it and then was pleasantly surprised when everything worked just as I hoped it would.

Despite its ease, it was still a really cool assignment learning how to set up a UI.

Here's the latest version of what my scene looks like:


Code can be found here:




No comments:

Post a Comment