i
i
i
i
i
i
i
i
8.4. Environment Mapping 297
8.4 Environment Mapping
Since the full reflectance equation is expensive to compute, real-time ren-
dering tends to utilize simplifying assumptions. In the previous section, we
discussed the assumption (constant incoming radiance) behind the ambi-
ent light model. In this section, the simplifying assumption relates to the
BRDF, rather than the incoming lighting.
An optically flat surface or mirror reflects an incoming ray of light into
one direction, the light’s reflection direction r
i
(see Section 7.5.3). Similarly,
the outgoing radiance includes incoming radiance from just one direction,
the reflected view vector r. This vector is computed similarly to r
i
:
r =2(n ·v)n −v. (8.23)
The reflectance equation for mirrors is greatly simplified:
L
o
(v)=R
F
(θ
o
)L
i
(r), (8.24)
where R
F
is the Fresnel term (see Section 7.5.3). Note that unlike the
Fresnel terms in half vector-based BRDFs (which use α
h
, the angle between
the half vector h and l or v), the Fresnel term in Equation 8.24 uses the
angle θ
o
between v and the surface normal n. If the Schlick approximation
is used for the Fresnel term, mirror surfaces should use Equation 7.33,
rather than Equation 7.40 (substituting θ
o
for θ
i
; the two are equal here).
If the incoming radiance L
i
is only dependent on direction, it can be
stored in a two-dimensional table. This enables efficiently lighting a mirror-
like surface of any shape with an arbitrary incoming radiance distribution,
by simply computing r for each point and looking up the radiance in the
table. Such a table is called an environment map, and its use for rendering is
called environment mapping (EM). Environment mapping was introduced
by Blinn and Newell [96]. Its operation is conceptualized in Figure 8.8.
As mentioned above, the basic assumption behind environment map-
ping is that the incoming radiance L
i
is only dependent on direction. This
requires that the objects and lights being reflected are far away, and that
the reflector does not reflect itself. Since the environment map is a two-
dimensional table of radiance values, it can be interpreted as an image.
The steps of an EM algorithm are:
• Generate or load a two-dimensional image representing the environ-
ment.
• For each pixel that contains a reflective object, compute the normal
at the location on the surface of the object.
• Compute the reflected view vector from the view vector and the
normal.