Friday, April 12, 2013

Graphics Assignment 11

Assignment 11 is about post processing. We draw the opaque bucket and translucent bucket to the a surface say, Postprocessing surface and then we apply effects like vignette or bloom to that texture.
   
  Steps of getting the Vignette Effect:
Get all the entities (Opaque and translucent) rendered on the postprocessing surface.
Use the texture of this surface in the as a uniform in the fragment shader of the postprocess entity (An entity having )
For a tex coordinate, sample this texture at that tex coordinate and also sample the vignette image( passed as uniform) and multiply these two float4 which is the output color.


Steps of getting the HUD:
Take a quad and set it to have a texture of the HUD to be displayed.
In vertex shader, resize the quad ( I am doing position in model space divided by 2 minus some offset to center it to the screen ) and passing that position to the hardware. 

Output:






Download Code

No comments:

Post a Comment