Friday, April 12, 2013

Graphics Assignment 11

This was the best assignment of all time. I have learned a lot of stuff from the assignment. How exactly RenderStates work, why, when and how to change the textures (DirectX textures), how to create some cool effect after you have drawn a scene and other important stuff.

Process that I followed was:

1. Draw everything to the opaque surface.
2. Copy everything from opaque surface to postProcessing surface.
3. Draw translucent bodies on the postProcessing surface

Now the postProcessing surface has everything that is needed to be drawn on screen.

4. Copy everything from postProcessing surface to the BackBuffer.
5. Take in postProcessing texture as in input in the final draw call and create some cool effects.

This is how my final render screen looks like.


I added 2 different kinds of effects. First one was the blurry effect. For doing so, I looked up the color values in the neighboring pixels and averaged it. The current pixel got the averaged value of the neighboring pixels. In the other effect, I added a random color to the pixels. This random color was changed based upon sine, cosine functions.

Final part of the assignment was adding a HUD element. The HUD needs to be drawn on the screen after everything else is drawn. I gave the screen co-ordinates directly to the HUD entity in the Mesh file and it was drawn onto the screen.

Here's the link for the code: Download Code

1 comment:

  1. Hi Vaibhav

    I am joining EAE graduate program this fall and was hoping to have a casual talk with you about program, college and general stuff. Let me know whenever you are free, I will really appreciate it.

    Best Regards
    Gagan

    ReplyDelete