Graphics Reference
In-Depth Information
Figure 3.3. Example scene showing a volumetric shadow casting point light placed
within a shadow-casting sphere with holes.
3.2.2 Sunlight
For the sunlight we use cascaded shadow mapping [Valient 09]. Because we use
deferred rendering, we can render each cascade of the sunlight separately. This
method is very useful because we can re-use the same shadow map for each
cascade and therefore save a lot of render buffer memory.
To render the volumetric light effect for the sunlight, we draw a fullscreen quad
after each sunlight cascade using a special sunlight volumetric light shader. For
each pixel the shader will march from the cascade's near depth to the cascade's
far depth along the view ray (Figure 3.4(a) and 3.4(b)). When our ray-march
sample depth turns out to be deeper than the value in the depth buffer, we will
break out of the ray-march loop (Figure 3.4(b)).
We render each fullscreen quad at the same depth as the cascade's near plane
depth and use the depth test to make sure we don't render pixels for a cascade
that are occluded by the scene's geometry.
3.2.3 The Scattering Factor
The scattering factor will determine the intensity of the volumetric light and is
controlled by two factors, the scattering amount and the scattering phase function
(see Equation (3.2)).
The scattering amount, also known as the scattering coecient, describes how
much light will be scattered in all directions. Artists can define the scattering
amount on a per-light basis. For the sunlight we also gave them the possibility of
setting fade ranges for the scattering amount based on height and view distance.
Search WWH ::




Custom Search