i
i
i
i
i
i
i
i
426 9. Global Illumination
rays over the hemisphere around each surface location or vertex. The cast
rays may be restricted to a certain distance, and in some cases the inter-
section distance may be used in addition to, or instead of, a simple binary
hit/miss determination. The computation of obscurance factors is one ex-
ample where intersection distances are used.
The computation of ambient occlusion or obscurance factors usually
includes a cosine weighting factor. The most efficient way to incorporate
this factor is by means of importance sampling. Instead of casting rays
uniformly over the hemisphere and cosine-weighting the results, the distri-
bution of ray directions is cosine-weighted (so rays are more likely to be
cast closer to the surface normal). Most commercially available modeling
and rendering software packages include an option to precompute ambient
occlusion.
Ambient occlusion precomputations can also be accelerated on the
GPU, using GPU features such as depth maps [1012] or occlusion
queries [362].
Strictly speaking, precomputed ambient occlusion factors are only valid
as long as the scene’s geometry does not change. For example, ambient
occlusion factors can be precomputed over a racetrack, and they will stay
valid as the camera moves through the scene. The effect of secondary
bounce lighting for light sources moving through the environment can be
approximated by applying the ambient occlusion factors to the lights, as
discussed in Section 9.2.2. In principle, the introduction of additional ob-
jects (such as cars) invalidates the precomputation. In practice, the simple
approach of precomputing ambient occlusion factors for the track (without
cars), and for each car in isolation, works surprisingly well.
For improved visuals, the ambient occlusion of the track on the cars
(and vice versa) can be approximated by placing each car on a large, flat
plane when performing its ambient occlusion precomputation. The ambient
occlusion factors on the plane can be captured into a texture and projected
onto the track underneath the car [728]. This works well because the track
is mostly flat and the cars are likely to remain in a fixed relationship to the
track surface.
Another reason the simple scheme described above works well is that
the cars are rigid objects. For deformable objects (such as human char-
acters) the ambient occlusion solution loses its validity as the character
changes pose. Kontkanen and Aila [690] propose a method for precomput-
ing ambient occlusion factors for many reference poses, and for finding a
correspondence between these and animation parameters, such as joint an-
gles. At rendering time, they use over 50 coefficients stored at each vertex
to compute the ambient occlusion from the parameters of the current pose
(the computation is equivalent to performing a dot product between two
long vectors). Kirk and Arikan [668] further extend this approach. Both