Graphics Reference
In-Depth Information
usual forward-rendering performance drawbacks that we discussed in the beginning of this
chapter, such as poor efficiency for small triangles, and reduced batching.
Due to the downsides associated with using dynamic lighting with transparent ma-
terials, it's desirable to use simplified materials as much as possible. For many glass-like
materials, dynamic lighting and shadowing don't provide the most important visual cues
required for realism. Typically it's more important to provide reflections, which can be
implemented with static reflection maps. The overall ambient or diffuse lighting term can
also be precomputed and stored in vertices or lightmaps, 12 which allows the transparent
geometry to blend in with the opaque geometry.
11.6.2 Multiple G-Buffer Layers
A natural extension of deferred rendering to support transparent geometry is to use multiple
g-buffers to store surface information. Having N g-buffers allows up to N surfaces to be
independently lit and blended using standard deferred lighting techniques, an arrangement
suitable for use with overlapping transparent geometry. The major downside is that ad-
ditional memory and bandwidth are required to store and write out the multiple g-buffer
layers.
Coarse Binning
To fill the g-buffer layers, a simple approach is to do a coarse binning of transparent ge-
ometry on the CPU. With this case, the first layer is reserved for opaque surfaces, and the
transparent objects are binned into the rest of the layers. Which layer an object is sent to
can be determined by reserving depth ranges for certain layers, or by attempting to deter-
mine where objects overlap by using simple bounding volumes. With both approaches, it
is impossible to properly handle the case of intersecting triangles, which is a fundamental
limitation of order-dependent transparency methods. Then, during the lighting pass, each
light can sample all of the layers and light them individually, and afterward, each layer can
be blended, based on the opacity of the surface stored in the g-buffer.
Unfortunately, in this case, depth-buffer-based optimizations for light volumes won't
work, since there is no longer one depth value that can be used. However if the depth is
sampled in the shader for each layer, dynamic branching can be used to skip the lighting
calculations if the depth is outside of the light bounds. The stencil buffer can also be used to
mark pixels where a layer doesn't need to be lit, but this requires multiple passes per light.
It is also possible to maintain a separate light buffer for each layer, which allows hardware
depth optimizations to be applied, at the expense of more memory and an additional pass.
1 2
A lightmap is a 2D texture that contains precomputed lighting values for triangle surfaces.
Search WWH ::




Custom Search