Game Development Reference
Figure 5.1. Illustration of light culling in 2D. (a) A camera is placed on the left, and
green lines indicate tile borders. (b) Light culling creates a frustum for each tile bounded
by minimum and maximum depth of pixels in a tile.
Whereas light culling creates the list of lights overlapping each pixel, final shading
loops through the list of lights and evaluates materials using material parameters
describing the surface properties of the rendered object along with information
stored for each light. With unordered access view (UAV) support, per-material
instance information can be stored and accessed in linear structured buffers passed
to material shaders. Therefore, at least in theory, the full render equation can
be satisfied without limitation because light accumulation and shading happen
simultaneously in one place with complete material and light information.
Use of complex materials and more accurate lighting models to improve visual
quality is not constrained other than by the GPU computational cost, which is
largely determined by the average number of overlapping lights on each pixel
multiplied by the average cost for material calculation.
With this method, high pixel overdraw can kill performance; therefore, a Z
prepass is critical to minimize the cost of final shading.
Implementation and Optimization
A standard forward rendering pipeline can be converted to a Forward+ rendering
pipeline by adding the light-culling stage and modifying existing pixel shaders to
make them implement Forward+'s final shading stage as described in Section 5.2.