Game Development Reference
In-Depth Information
Tiled forward shading attempts to combine one of the main advantages of
(tiled) deferred rendering, i.e., the reduced amount of lighting computations done,
with the advantages of forward rendering. Besides reduced memory requirements
(forward rendering does not need a large G-buffer), it also enables transparency
[Kircher and Lawrance 09,Enderton et al. 10] ( Section 4.5 ) , enables multisampling
schemes [Swoboda 09, Lauritzen 10] ( Section 4.6 ) , and does not force the use of
ubershaders if different shading models must be supported ( Section 4.7 ). See the
images in Figure 4.1 for a demonstration of these different aspects.
4.2
Recap: Forward, Deferred, and Tiled Shading
The terms forward , deferred, and tiled shading will be appearing quite frequently
in this chapter. Therefore, let us define what we mean, since usage of these terms
sometimes varies slightly in the community. The definitions we show here are
identical to the ones used by [Olsson and Assarsson 11].
With forward shading , we refer to the process of rendering where lighting
and shading computations are performed in the same pass as the geometry is
rasterized. This corresponds to the standard setup consisting of a vertex shader
that transforms geometry and a fragment shader that computes a resulting color
for each rasterized fragment.
Deferred shading splits this process into two passes. First, geometry is ras-
terized, but, in contrast to forward shading, geometry attributes are output into
a set of geometry buffers (G-buffers). After all geometry has been processed this
way, an additional pass that computes the lighting or full shading is performed
using the data stored in the G-buffers.
In its very simplest form, the second pass (the lighting pass) may look some-
thing like following:
for each G-buffer sample {
sample_attr = load attributes from G-buffer
for each light {
color += shade(sample_attr, light)
}
output pixel color;
}
Sometimes, the order of the loops is reversed. The deferred algorithm described
in Section 4.1 is an example of this.
The light pass shown above requires
N samples ) lighting computa-
tions. If we somehow know which lights were affecting what samples, we could
reduce this number significantly [Trebilco 09].
O
( N lights ยท
 
 
Search Nedrilad ::




Custom Search