Game Development Reference
In-Depth Information
Figure 10.32. Real-world light attenuation vs. simple linear attenuation
elegant, fast approximation. Such approximations are the essence of the
art of real-time rendering.
The most creative aspect of Doom-style volumetric lights is how they
determine the intensity at a given point. It is controlled through two texture
maps. One map is essentially a gobo, which can be projected by either
orthographic or perspective projection, similar to a spot or directional light.
The other map is a one-dimensional map, known as the falloff map, which
controls the falloff. The procedure for determining the light intensity at
point x is as follows: x is multiplied by a 4 × 4 matrix, and the resulting
coordinates are used to index into the two maps. The 2D gobo is indexed
using (x/w,y/w), and the 1D falloff map is indexed with z. The product
of these two texels defines the light intensity at x .
The examples in Figure 10.33 will make this clear. Let's look at each of
the examples in more detail. The omni light projects the circular gobo or-
thographically across the box, and places the “position” of the light (which
is used to compute the l vector) in the center of the box. The 4 × 4 matrix
 
Search WWH ::




Custom Search