i
i
i
i
i
i
i
i
Chapter 8
Area and E nvironmental
Lighting
“Light makes right.”
—Andrew Glassner
In Chapter 7 we discussed many aspects of lighting and shading. However,
only the effects of point and directional light sources were presented, thus
limiting surfaces to receiving light from a handful of discrete directions.
This description of lighting is incomplete—in reality, surfaces receive light
from all incoming directions. Outdoors scenes are not just lit by the sun.
If that were true, all surfaces in shadow or facing away from the sun would
be black. The sky is an important source of light, caused by sunlight
scattering from the atmosphere. The importance of sky light can be seen
by looking at a picture of the moon, which lacks sky light because it has
no atmosphere (see Figure 8.1).
On overcast days, at dusk, or at dawn, outdoors lighting is all sky light.
Diffuse, indirect lighting is even more important in indoor scenes. Since
directly visible light sources can cause an unpleasant glare, indoor lighting
is often engineered to be mostly or completely indirect.
The reader is unlikely to be interested in rendering only moonscapes.
For realistic rendering, the effects of indirect and area lights must be taken
into account. This is the topic of the current chapter. Until now, a sim-
plified form of the radiometric equations has sufficed, since the restriction
of illumination to point and directional lights enabled the conversion of
integrals into summations. The topics discussed in this chapter require the
full radiometric equations, so we will begin with them. A discussion of am-
bient and area lights will follow. The chapter will close with techniques for
utilizing the most general lighting environments, with arbitrary radiance
values incoming from all directions.
285
i
i
i
i
i
i
i
i
286 8. Area and Environmental Lighting
Figure 8.1. Scene on the moon, which has no sky light due to the lack of an atmosphere
to scatter sunlight. This shows what a scene looks like when it is only lit by a direct
light source. Note the pitch-black shadows and lack of any detail on surfaces facing
away from the sun. This photograph shows Astronaut James B. Irwin next to the Lunar
Roving Vehicle during the Apollo 15 mission. The shadow in the foreground is from the
Lunar Module. Photograph taken by Astronaut David R. Scott, Commander. (Image
from NASA’s collection.)
8.1 Radiometry for Arbitrary Lighting
In Section 7.1 the various radiometric quantities were discussed. However,
some relationships between them were omitted, since they were not impor-
tant for the discussion of lighting with point and directional light sources.
We will first discuss the relationship between radiance and irradiance.
Let us look at a surface point, and how it is illuminated by a tiny patch
of incident directions with solid angle
i
(see Figure 8.2). Since
i
is
i
i
i
i
i
i
i
i
8.1. Radiometry for Arbitrar y Lighting 287
l
θ
i
dω
i
n
Figure 8.2. A surface point illuminated from all directions on the hemisphere. An
example light direction l and an infinitesimal solid angle
i
around it are shown.
very small, it can be accurately represented by a single incoming direction
l, and we can assume that the incoming radiance from all directions in the
patch is a constant L
i
(l).
As discussed in Section 7.1, radiance is a measure of light in a single
ray, more precisely defined as the density of light flux (power) with respect
to both area (measured on a plane perpendicular to the ray) and solid
angle. Irradiance is a measure of light incoming to a surface point from all
directions, defined as the density of light flux with respect to area (measured
on a plane perpendicular to the surface normal n). It follows from these
definitions that
L
i
(l)=
dE
i
cos θ
i
, (8.1)
where
cos is our notation for a cosine function clamped to non-negative
values, dE is the differential amount of irradiance contributed to the surface
by the incoming light from
i
,andθ
i
is the angle between the incoming
light vector l and the surface normal. Isolating dE results in
dE = L
i
(l)
i
cos θ
i
. (8.2)
Now that we know how much irradiance is contributed to the surface
from the patch of directions
i
around l, we wish to compute the total
irradiance at the surface, resulting from light in all directions above the
surface. If the hemisphere of directions above the surface (which we will
call Ω) is divided up into many tiny solid angles, we can use Equation 8.2
to compute dE from each and sum the results. This is an integration with
respect to l,ove:
E =
Ω
L
i
(l)cosθ
i
i
. (8.3)
The cosine in Equation 8.3 is not clamped, since the integration is only
performed over the region where the cosine is positive. Note that in this
i
i
i
i
i
i
i
i
288 8. Area and Environmental Lighting
integration, l is swept over the entire hemisphere of incoming directions—
it is not a specific “light source direction.” The idea is that any incoming
direction can (and usually will) have some radiance associated with it.
Equation 8.3 describes an important relationship between radiance and
irradiance: irradiance is the cosine-weighted integral of radiance over the
hemisphere.
When rendering, we are interested in computing the outgoing radiance
L
o
in the view direction v, since this quantity determines the shaded pixel
color. To see how L
o
relates to incoming radiance L
i
, recall the definition
of the BRDF:
f(l, v)=
dL
o
(v)
dE(l)
. (8.4)
Combining this with Equation 8.2 and integrating over the hemisphere
yields the reectance equation
L
o
(v)=
Ω
f(l, v) L
i
(l)cosθ
i
i
, (8.5)
where the symbol (piecewise vector multiply) is used, since both the
BRDF f (l, v) and the incoming radiance L
i
(l) vary over the visible spec-
trum, which in practice for real-time rendering purposes means that they
are both RGB vectors. This is the full version of the simplified equation
we used in Chapter 7 for point and directional light sources. Equation 8.5
shows that to compute the radiance outgoing in a given direction v,the
incoming radiance times the BRDF times the cosine of the incoming an-
gle θ
i
needs to be integrated over the hemisphere above the surface. It
is interesting to compare Equation 8.5 to the simplified version used in
Chapter 7:
L
o
(v)=
n
k=1
f(l
k
, v) E
L
k
cos θ
i
k
. (8.6)
The most commonly used parameterization of the hemisphere uses polar
coordinates (φ and θ). For this parameterization, the differential solid angle
is equal to sin θdθdφ. Using this, a double-integral form of Equation 8.5
can be derived, which uses polar coordinates:
L(θ
o
o
)=
2π
φ
i
=0
π/2
θ
i
=0
f(θ
i
i
o
o
)L(θ
i
i
)cosθ
i
sin θ
i
i
i
. (8.7)
The angles θ
i
, φ
i
, θ
o
,andφ
o
are shown in Figure 7.15 on page 224.
i
i
i
i
i
i
i
i
8.2. Area Light Sources 289
ω
L
E
L
L
L
n
θ
i
L
n
l
L
v v
Figure 8.3. A surface illuminated by a light source. On the left, the light source is
modeled as a point or directional light. On the right, it is modeled as an area light
source.
8.2 Area Light Sources
Previous chapters have described point or directional light sources. These
light sources illuminate a surface point from one direction only. However,
real lights illuminate a surface point from a range of directions—they sub-
tend (cover) a nonzero solid angle. Figure 8.3 shows a surface that is
illuminated by a light source. It is modeled both as a point or directional
source and as an area light source with a nonzero size. The point or di-
rectional light source (on the left) illuminates the surface from a single
direction l
L
,
1
which forms an angle θ
i
L
with the normal n. Its brightness
is represented by its irradiance E
L
measured in a plane perpendicular to
l
L
.
2
The point or directional light’s contribution to the outgoing radiance
L
o
(v) in direction v is f(l
L
, v)E
L
cos θ
i
L
. On the other hand, the bright-
ness of the area light source (on the right) is represented by its radiance
L
L
. The area light subtends a solid angle of ω
L
from the surface location.
Its contribution to the outgoing radiance in direction v is the integral of
f(l, v) L
L
cos θ
i
over ω
L
. The fundamental approximation behind point
and directional light sources is expressed in the following equation:
L
o
(v)=
ω
L
f(l, v) L
L
cos θ
i
i
f (l
L
, v) E
L
cos θ
i
L
. (8.8)
The amount that an area light source contributes to the illumination of a
surface location is a function of both its radiance (L
L
) and its size as seen
from that location (ω
L
). Point and directional light sources are approx-
1
Since we are now using l to denote a generic incoming direction, specific light source
directions will be denoted with subscripts.
2
As distinguished from the overall irradiance E, measured in a plane perpendicular
to the surface normal n.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset