Game Development Reference
par en t
Z-bounds used for (a) opaque and (b) transparent geometries.
For transparent geometry, we would like to find the transparent objects' min-
imum Z-value and the minimum of the transparent objects' and opaque objects'
respective maximum Z-values. However, this is somewhat cumbersome, requir-
ing several passes over the transparent geometry; therefore, we simply use the
maximum Z-value from the opaque geometry to cap the tiles in the far direction.
This discards lights that are hidden by opaque geometry. In the near direction,
we extend the tiles to the camera's near plane, as shown in Figure 4.3(b).
Using separate bounds turned out to be slightly faster than using the same tile
bounds for both opaque and transparent geometry; in Figure 4.1(b) , when using
separate bounds, rendering takes 15 . 1 ms (upper) and 21 . 9 ms (lower), compared
to 16 . 1msand23 . 5 ms when using the extended bounds for both opaque and
We would like to note that this is, again, scene dependent. Regardless of
whether we use the approximate variant or the exact one, we can still use the
depth buffer from the opaque geometry during the final render in order to enable
early-Z and similar optimizations. If we do not use the minimum or maximum
reduction to learn a tile's actual bounds, no modifications are required to support
Light assignment. If separate sets of tiles are used, light assignment must be done
twice. In our case, a special optimization is possible: we can first assign lights in
two dimensions and then discard lights that lie behind opaque geometry (use the
maximum Z-bound from the tiles only). This yields the light lists for transparent
geometry. For opaque geometry, we additionally discard lights based on the
minimum Z-bound information ( Listing 4.2 ).