Friday 12 April 2013

Deferred Shading... Woot Woot

Disclaimer: This may not be the most interesting blog I have written to date.  Before I get into what Deferred Shading is, I am going to hit you with a definition. Deferred: Put off (an action or event) to a later time; postpone.  This is an important definition because it helps to explain how deferred shading works when it comes to when the shading actually occurs on the object.  When it comes to most shading techniques, the bulk of the work is generally done in the first passes on the object.  In deferred shading however, no shading is actually performed until the second pass on the object.
Example of Deferred Shading
Deferred shading is unique because during the first pass over the object, all of the data that is required for the shading to occur is gathered and stored.  During the second pass, is when all of the positions, normals, and materials that were rendered into a geometry buffer are taken in by a pixel shader to compute the direct and indirect lighting at every pixel in the screen space.  The reason many games are moving towards the use of deferred shading, is because of the advantages it can add to the game.  Since only one geometry pass is used to compute the lights that are actually being affected, the performance does not take get bogged down as it would with other shaders.  This does however lead to problems when it comes to dealing with transparency as the shading tends to render it incorrectly.  The shadder also needs to consume more memory, as it needs to store the seperate G-Buffer created on the first pass.  These issues have not been an issue however, as many game developers still use deferred shading in games such as Bioshock Infinite, Mafia II, and Amnesia: The Dark Descent

Deferred Shading in One of my Favorite Games, Battlefield 3
For the next blog post, I am going to go over Normal Mapping. Yippieeeeeee!






No comments:

Post a Comment