Game Development Reference
In-Depth Information
You should study these examples until you are sure you know how they
work.
Doom-style volumetric lights can be attractive for real-time graphics for
several reasons:
They are simple and e cient, requiring only the basic functionality
of texture coordinate generation, and two texture lookups. These
are flexible operations that are easily hardwired into fixed-function
hardware such as the Nintendo Wii.
Many different light types and effects can be represented in the same
framework. This can be helpful to limit the number of different
shaders that are needed. Lighting models, light types, material prop-
erties, and lighting passes can all be dimensions in the matrix of
shaders, and the size of this matrix can grow quite quickly. It can
also be useful to reduce the amount of switching of render states.
Arbitrary falloff curves can be encoded in the gobo and falloff maps.
We are not restricted to linear or real-world inverse squared attenua-
tion.
Due to the ability to control the falloff, the bounding box that con-
tains the lighting volume can usually be relatively tight compared to
traditional spot and omni lights. In other words, a large percentage
of the volume within the box is receiving significant lighting, and the
light falls off more rapidly than for traditional models, so the volume
is as small and as tight as possible. Looking at the bottom row of
Figure 10.33, compare the size of the box needed to contain the true
spot light, versus the fake spot light.
This is perhaps the most important feature behind the introduction of
these sorts of lights in Doom 3, which used an accumulated rendering
technique with no lightmaps or precomputed lighting; every object
was fully lit in real time. Each light was added into the scene by
rerendering the geometry within the volume of the light and adding
the light's contribution into the frame buffer. Limiting the amount of
geometry that had to be redrawn (as well as the geometry that had
to be processed for purposes of the stencil shadows that were used)
was a huge performance win.
10.7.4 Precalculated Lighting
One of the greatest sources of error in the images produced in real time
(those positive thinkers among you might say the greatest opportunity for
improvement) is indirect lighting: light that has “bounced” at least one
 
Search WWH ::




Custom Search