Graphics Reference
In-Depth Information
Mesh instances can be batched more frequently, since lighting parameters are no lon-
ger needed when rendering scene geometry. Consequently, the active light sources do
not need to be the same for all instances of a mesh.
Scene geometry only needs to be rendered once, since there's no need to resort to
multipass rendering for lighting.
It's no longer necessary to perform CPU work to determine which lights affect differ-
ent portions of the screen. Instead, bounding volumes or screen-space quads can be
rasterized over the portion of the screen that a light affects. Depth and stencil testing
can also be used to further reduce the number of shader executions.
The overall required shader and rendering framework architecture can be simplified,
because lighting and geometry have been decoupled.
These advantages have caused deferred rendering to become extremely popular
among modem real-time rendering engines. Unfortunately, the approach also comes with
several drawbacks of its own:
A significant amount of memory and bandwidth must be dedicated to the generation
and sampling of the g-buffer, since it needs to store any information required to calcu-
late lighting for that pixel.
Using hardware MSAA is nontrivial, and generally requires that the lighting calcula-
tions be performed for each subsample. This can introduce a significantly increased
computational burden.
Transparent geometry can't be handled in the same manner as opaque geometry, since
it can't be rendered into the g-buffer. This is because the g-buffer can only hold proper-
ties for a single surface, and rendering transparent geometry requires calculating the
lighting for multiple overlapping per-pixel and combining the resulting color.
Having different BRDFs for different materials is no longer straightforward, since the
evaluation of a pixel's final color has been moved to the lighting pass.
In the following sections, we will talk about ways in which the advantages of de-
ferred rendering can be exploited, while also minimizing it drawbacks.
11.2 Classic Deferred Rendering
In this section, we will work through an extremely basic deferred rendering implementa-
tion in D3D11. To maintain simplicity in this introduction to the topic, we will assume that
Search WWH ::




Custom Search