lhyanor.org

  • Increase font size
  • Default font size
  • Decrease font size

Deferred Shading

E-mail Print PDF

Since modern graphics hardware is able to render to multiple targets, the rendering process can be splitted into more than one pass. Deferre d shading is a name for the idea to split the rendering process into 2 (or more) passes.

A first pass is needed for the pixelwise calculation of the geometry, where all the information to shade the geometry is calculated and stored into buffers  (render targets) on a per pixel level (normals, positions, unlit texture color, et cetera).

The actual shading is done in a second pass (or more, one for each light source in the scene), where the buffers can be read and the shading from each light source be calculated from them.

The geometry buffers: The color, the normal and the position buffer

This way, it is possible to separate the material properties completely from the properties of the light, and account for them in different rendering passes. This reduces shader complexity, since if we want to add another light source type, we just have to write another lighting shader, and dont have to touch the material shaders.

The ninja head rendered using deferred shading and shadow mapping

These shaders were authored in AMD Rendermonkey, which I used to get a first hold on HLSL. The Rendermonkey project file is available for download here.

Last Updated on Tuesday, 12 January 2010 19:20