i
i
i
i
i
i
i
i
2 4
2 4
Global Illumination
Many surfaces in the real world receive most or all of their incident light from
other reflective surfaces. This is often called indirect lighting or mutual illumi-
nation. For example, the ceilings of most rooms receive little or no illumination
directly from luminaires (light emitting objects). The direct and indirect compo-
nents of illumination are shown in Figure 24.1.
Although accounting for the interreflection of light between surfaces is
straightforward, it is potentially costly because all surfaces may reflect any given
surface, resulting in as many as O(N
2
) interactions for N surfaces. Because the
entire global database of objects may illuminate any given object, accounting for
indirect illumination is often called the global illumination problem.
There is a rich and complex literature on solving the global illumination prob-
lem (e.g., (Appel, 1968; Goral et al., 1984; Cook et al., 1984; Immel et al., 1986;
Figure 24.1. In the left and middle images, the indirect and direct lighting, respectively,
are separated out. On the right, the sum of both components is shown. Global illumination
algorithms account for both the direct and the indirect lighting.
623
i
i
i
i
i
i
i
i
624 24. Global Illumination
Kajiya, 1986; Malley, 1988)). In this chapter we discuss two algorithms as exam-
ples: particle tracing and path tracing. The first is useful for walkthrough appli-
cations such as maze games, and as a component of batch rendering. The second
is useful for realistic batch rendering. Then we discuss separating out “direct”
lighting where light takes exactly once bounce between luminaire and camera.
24.1 Particle Tracing for Lambertian Scenes
Recall the transport equation from Section 20.2:
L
s
(k
o
)=
all k
i
ρ(k
i
, k
o
)L
f
(k
i
)cosθ
i
dσ
i
.
The geometry for this equation is shown Figure 24.2. When the illuminated point
is Lambertian, this equation reduces to:
L
s
=
R
π
all k
i
L
f
(k
i
)cosθ
i
dσ
i
,
where R is the diffuse reflectance. One way to approximate the solution to this
equation is to use finite element methods. First, we break the scene into N sur-
faces each with unknown surface radiance L
i
,reflectance R
i
, and emitted radi-
ance E
i
. This results in the set of N simultaneous linear equations
L
i
= E
i
+
R
i
π
N
j=1
k
ij
L
j
,
where k
ij
is a constant related to the original integral representation. We then
solve this set of linear equations, and we can render N constant-colored polygons.
This finite element approach is often called radiosity.
Figure 24.2. The geometry for the transport equation in its directional form.
i
i
i
i
i
i
i
i
24.1. Particle Tracing for Lambertian Scenes 625
An alternative method to radiosity is to use a statistical simulation approach by
randomly following light “particles” from the luminaire though the environment.
This is a type of particle tracing. There are many algorithms that use some form
of particle tracing; we will discuss a form of particle tracing that deposits light
in the textures on triangles. First, we review some basic radiometric relations.
The radiance L of a Lambertian surface with area A is directly proportional to the
incident power per unit area:
L =
Φ
πA
, (24.1)
where Φ is the outgoing power from the surface. Note that in this discussion, all
radiometric quantities are either spectral or RGB depending on the implementa-
tion. If the surface has emitted power Φ
e
, incident power Φ
i
,andreflectance R,
then this equation becomes
L =
Φ
e
+ RΦ
i
πA
.
If we are given a model with Φ
e
and R specified for each triangle, we can proceed
luminaire by luminaire, firing power in the form of particles from each luminaire.
We associate a texture map with each triangle to store accumulated radiance, with
all texels initialized to
L =
Φ
e
πA
.
If a given triangle has area A and n
t
texels, and it is hit by a particle carrying
power φ, then the radiance of that texel is incremented by
ΔL =
n
t
φ
πA
.
Once a particle hits a surface, we increment the radiance of the texel it hits, prob-
abilistically decide whether to reflect the particle, and if we reflect it we choose a
direction and adjust its power.
Note that we want the particle to terminate at some point. For each surface we
can assign a reflection probability p to each surface interaction. A natural choice
would be to let p = R as it is with light in nature. The particle would then scatter
around the environment not losing or gaining any energy until it is absorbed.
This approach works well when the particles carry a single wavelength (Walter et
al., 1997). However, when a spectrum or RGB triple is carried by the ray as is
often implemented (Jensen, 2001), there is no single R and some compromise for
the value of p should be chosen. The power φ
for reflected particles should be
adjusted to account for the possible extinction of the particles:
φ
=
Rφ
p
Get Fundamentals of Computer Graphics, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.