Deferred shading is a technique that involves postponing the lighting/shading step to a second pass. We do this (among other reasons) in order to avoid shading a pixel more than once. The basic idea is as follows:
- In the first pass, we render the scene, but instead of evaluating the reflection model to determine a fragment color, we simply store all of the geometry information (position, normal, texture coordinate, reflectivity, and so on) in an intermediate set of buffers, collectively called the g-buffer (g for geometry).
- In the second pass, we simply read from the g-buffer, evaluate the reflection model, and produce a final color for each pixel.
When deferred shading is used, we avoid evaluating the reflection model for ...