Game Development Reference
In-Depth Information
N sam-
ples. (We have had particularly good successes with N = 32, but this should
be somewhat hardware and application dependent.) Lights are then assigned to
these tiles. We may optionally compute the minimum and maximum Z-bounds
of each tile, which allows us to further reduce the number of lights affecting each
tile (more discussion on this in Section 4.4) .
Benefits of tiled deferred shading [Olsson and Assarsson 11] are the following:
Tiled deferred shading does this by dividing samples into tiles of N
×
The G-buffers are read only once for each lit sample.
The framebuffer is written to once.
Common terms of the rendering equation can be factored out and computed
once instead of recomputing them for each light.
The work becomes coherent within each tile; i.e., each sample in a tile
requires the same amount of work (iterates over the same lights), which
allows for ecient implementation on SIMD-like architectures (unless, of
course, the shader code contains many branches).
For tiled deferred shading (and most deferred techniques) to be worthwhile, most
lights must have a limited range. If all lights potentially affect all of the scene,
there is obviously no benefit to the tiling ( Figure 4.2(a) ) .
Tiled deferred shading can be generalized into Tiled Shading , which includes
both the deferred and forward variants. The basic tiled shading algorithm looks
like the following:
1. Subdivide screen into tiles.
2. Optional: find minimum and maximum Z-bounds for each tile.
3. Assign lights to each tile.
4. For each sample: process all lights affecting the current sample's tile.
Step 1 is basically free; if we use regular N
N tiles, the subdivision is implicit.
Finding minimum and maximum Z-bounds for each tile is optional (Step 2).
For instance, a top-down view on a scene with low depth complexity may not
allow for additional culling of lights in the Z-direction. Other cases, however, can
benefit from tighter tile Z-bounds, since fewer lights are found to influence that
tile ( Figure 4.2(b) ) .
In tiled deferred shading, the samples in Step 4 are fetched from the G-buffers.
In tiled forward shading, the samples are generated during rasterization. We will
explore the latter in the rest of the article.
We recently presented an extension to tiled shading, called clustered shad-
ing [Olsson et al. 12b]. Clustered shading is an extension of tiled shading that
×
 
Search Nedrilad ::




Custom Search