i
i
i
i
i
i
i
i
8.6. Irradiance Environment Mapping 317
the entire environment map. An inexpensive method to do this is given by
Brennan [140]. Imagine an irradiance map for a single light source. In the
direction of the light, the radiance is at a maximum, as the light hits the
surface straight-on. Radiance for a given surface normal direction (i.e., a
given texel) falls off with the cosine of the angle to the light, then is zero
as the surface faces away from the light. The GPU can be used to rapidly
add in this contribution directly to an existing irradiance map. Instead of
rendering a point light to a cube map and filtering the map, the filtered
appearance of the light is represented by an object. This object can be vi-
sualized as a hemisphere centered around the observer, with the pole of the
hemisphere along the light’s direction. The hemisphere itself is brightest in
this direction, falling off to zero at its edge. Rendering this object directly
into the cube map gives an irradiance contribution for that light. In this
way, each moving point light in a scene can add its effect to the irradiance
map by rendering its corresponding hemisphere.
As with specular environment maps, it is possible to modify how irradi-
ance environment maps are accessed, so that they represent local reflections
rather than infinitely far ones. One way to do this is to use a blend of the
normal and the direction from the reference location (the “center” of the
environment map) to the surface location. This gives some variation with
location, while still being affected by the surface normal [947].
8.6.1 Spherical Harmonics Irradiance
Although we have only discussed representing irradiance environment maps
with textures such as cube maps, other representations are possible. Spher-
ical harmonics (SH) have become popular in recent years as an irradiance
environment map representation. Spherical harmonics are a set of mathe-
matical functions that can be used to represent functions on the unit sphere
such as irradiance.
Spherical harmonics
5
are basis functions: a set of functions that can be
weighted and summed to approximate some general space of functions. In
the case of spherical harmonics, the space is “scalar functions on the unit
sphere.” A simple example of this concept is shown in Figure 8.25. Each
of the functions is scaled by a weight or coefficient such that the sum of
the weighted basis functions forms an approximation to the original target
function.
Almost any set of functions can form a basis, but some are more con-
venient to use than others. An orthogonal set of basis functions is a set
such that the inner product of any two different functions from the set is
5
The basis functions we discuss here are more properly called “the real spherical
harmonics,” since they represent the real part of the complex-valued spherical harmonic
functions.