Graphics Reference
In-Depth Information
Since the blend state used has additive blending enabled, the output is summed with
the previous contents of the render target. Thus, the output from each light is summed to
create the final color value for each pixel.
11.3 Light Pre-Pass Deferred Rendering
Deferred rendering has several advantages, but it also suffers in performance and flexibility
due to the need to have all of the surface and material properties contained in the g-buffer.
Storing many attributes in the g-buffer consumes a great deal of memory and bandwidth
(particularly when MSAA is used), and also makes it difficult to implement different types
of materials and lighting models, light pre-pass deferred rendering(Engel, 2009) is a tech-
nique that attempts to alleviate these problems somewhat by further splitting the lighting
pipeline into three steps, as opposed to two. The end result is that the g-buffer can be made
much smaller, and the lighting pass is less expensive, but all deferred scene geometry must
be rendered twice, instead of once. The basic steps are as follows:
1. Render a minimal g-buffer with only the surface properties required to evaluate
the core portions of the lighting equation.
2. Evaluate the core portion of the lighting equation for all lights in the scene by
rendering geometry covering the affected pixels, and sum the results into a light
buffer.
3. Render the scene geometry a second time, in which the light buffer value is
sampled and the material albedos are applied to determine the final surface color.
This section will walk through a basic implementation of a light pre-pass deferred
renderer without optimizations, similar to the outline in the previous section. It should
be noted that light pre-pass deferred rendering is often referred to as deferred lighting to
distinguish it from deferred rendering or deferred shading. This emphasizes the fact that
the basic lighting calculations are done in a deferred step, but the final shading step is done
while rasterizing the scene geometry.
11.3.1 Light Pre-Pass G-Buffer Layout
As mentioned in the overview, with light pre-pass deferred rendering, we can render a
minimal g-buffer. Essentially, we only want the surface properties required to evaluate
the core diffuse and specular components of the Blinn-Phong BRDF, without the albedos.
Search WWH ::




Custom Search