i
i
i
i
i
i
i
i
290 8. Area and Environmental Lighting
imations of area light sources—they cannot be realized in practice, since
their zero solid angle implies an infinite radiance.
The approximation in Equation 8.8 is much less costly than computing
the integral, so it is worth using when possible. Understanding the visual
errors that are introduced by the approximation will help to know when
to use it, and what approach to take when it cannot be used. These errors
will depend on two factors: how large the light source is (measured by the
solid angle it covers from the shaded point), and how glossy the surface is.
For light sources that subtend a very small solid angle, the error is small.
For very rough surfaces, the error is small as well. We will take a closer
look at the important special case of Lambertian surfaces.
It turns out that for Lambertian surfaces, the approximation is exact
under some circumstances. Recall that for Lambertian surfaces, the out-
going radiance is proportional to the irradiance:
L
o
(v)=
c
diff
π
E, (8.9)
where c
diff
is the diffuse color of the surface.
This lets us use equations for irradiance, which are simpler than the cor-
responding equations for outgoing radiance. The equivalent of Equation 8.8
for computing irradiance is:
E =
ω
L
L
L
cos θ
i
i
E
L
cos θ
i
L
. (8.10)
To understand how irradiance behaves in the presence of area light
sources, the concept of vector irradiance is useful. Vector irradiance was
introduced by Gershun [392] (who called it the light vector) and further
described by Arvo [37]. Using vector irradiance, an area light source of
arbitrary size and shape can be accurately converted into a point or direc-
tional light source. There are some caveats, which we will discuss later.
Imagine a distribution of radiance coming into a point p in space (see
Figure 8.4). For now, we assume that the radiance does not vary with
wavelength, so that the incoming radiance from each direction can be rep-
resented as a scalar, rather than as a spectral distribution or RGB triple.
For every infinitesimal solid angle centered on an incoming direction l,
a vector is constructed that is aligned with l and has a length equal to the
(scalar) radiance incoming from that direction times . Finally, all these
vectors are summed to produce a total vector e (see Figure 8.5). This is the
vector irradiance. More formally, the vector irradiance is computed thus:
e(p)=
Θ
L
i
(p, l)l
i
, (8.11)
where Θ indicates that the integral is performed over the entire sphere of
directions.
i
i
i
i
i
i
i
i
8.2. Area Light Sources 291
p
Figure 8.4. Computation of vector irradiance. Point p is surrounded by light sources
of various shapes, sizes, and radiance distributions (the brightness of the yellow color
indicates the amount of radiance emitted). The orange arrows are vectors pointing in
all directions from which there is any incoming radiance, and each length is equal to
the amount of radiance coming from that direction times the infinitesimal solid angle
covered by the arrow (in principle there should be an infinite number of arrows). The
vector irradiance is the sum of all these vectors.
n
e
p
Figure 8.5. Vector irradiance. The large orange arrow is the result of summing the small
arrows in Figure 8.4. The vector irradiance can be used to compute the net irradiance
of any plane at point p.
i
i
i
i
i
i
i
i
292 8. Area and Environmental Lighting
p
p
e
Figure 8.6. Vector irradiance of a single area light source. On the left, the arrows
represent the vectors used to compute the vector irradiance. On the right, the large
orange arrow is the vector irradiance e. The short black and red vectors represent the
range of surface normals for which e can be used to compute the irradiance from the
area light source. The red dashed lines represent the extent of the light source, and the
red vectors (which are perpendicular to the red dashed lines) define the limits of the
set of surface normals. Normals outside this set will have an angle greater than 90
with some part of the area light source. Such normals cannot use e to compute their
irradiance.
The vector irradiance e is interesting because, once computed, it can
be used to find the net irradiance at p through a plane of any orientation
by performing a dot product (see Figure 8.5):
E(p, n) E(p, n)=n · e(p), (8.12)
where n is the normal to the plane. The net irradiance through a plane is
the difference between the irradiance flowing through the “positive side”
of the plane (defined by the plane normal n) and the irradiance flowing
through the “negative side.” By itself, the net irradiance is not useful for
shading. But if no radiance is emitted through the “negative side” (in
other words, the light distribution being analyzed has no parts for which
the angle between l and n exceeds 90
), then E(p, n)=0and
E(p, n)=n · e(p). (8.13)
The vector irradiance of a single area light source can be used with
Equation 8.13 to light Lambertian surfaces with any normal n,aslongas
n does not face more than 90
away from any part of the area light source
(see Figure 8.6).
The vector irradiance is for a single wavelength. Given lights with
different colors, the summed vector could be in a different direction for
each wavelength. However, if all the light sources have the same spectral
distribution, the vectors will all be in the same direction. This allows for a
trivial extension to Equation 8.13 for colored lights—just multiply n ·e by
i
i
i
i
i
i
i
i
8.2. Area Light Sources 293
the light color c
L
. This results in the same equation used to compute the
irradiance from a directional light source, with the following substitutions:
l =
e(p)
e(p)
,
E
L
= c
L
e(p),
(8.14)
so we have effectively converted an area light source of arbitrary shape and
size to a directional light source—without introducing any error! How-
ever, care must be taken only to use normals within the “valid set,” and
the directional light source is only equivalent to the area light source for
Lambertian surfaces.
This can be solved analytically for simple cases. For example, imagine
a spherical light source with a center at p
L
and a radius r
L
. The light emits
a constant radiance L
L
from every point on the sphere, in all directions.
For such a light source, Equations 8.11 and 8.14 yield the following:
l =
p
L
p
p
L
p
,
E
L
= π
r
2
L
r
2
L
L
.
(8.15)
This is the same as an omni light (see Section 7.4.1) with I
L
= πr
2
L
and
the standard distance falloff function of 1/r
2
. Since it is unclear what the
irradiance should be for points inside the sphere, it might make sense to cap
the falloff function at a value of 1. This is useful, since falloff functions that
reach arbitrarily high values can be inconvenient to use. Other practical
adjustments could be made to the falloff function (such as scaling and
biasing it to make it reach a value of 0 at some finite distance).
We see here that a simplistic light model such as an omni light can actu-
ally be a physically accurate description of an area light source. However,
this is only true for reflection from Lambertian surfaces, and only as long
as no rays to the light source form angles greater than 90
with the surface
normal (otherwise n · e = E). Another way to think about this is that no
parts of the area light source can be under the horizon,” or occluded by
the surface.
We can generalize the last statement. For Lambertian surfaces, all
differences between area and point light sources result from occlusion dif-
ferences. The irradiance from a point light source obeys a cosine law for all
normals for which the light is not occluded. Irradiance from an area light
source obeys a cosine law (for the cosine of the angle between the vector
irradiance e and the surface normal n) until some part of the source is
occluded. As the area light source continues to descend below the horizon,
the irradiance will continue to decrease until the light is 100% occluded,
i
i
i
i
i
i
i
i
294 8. Area and Environmental Lighting
at which point it will become zero. For point light sources, this happens
when the angle between the light source vector l and the surface normal
n reaches 90
—for area light sources this happens at some larger angle
when all of the light is “under the horizon.” Snyder derived an analytic
expression for a spherical light source, taking occlusion into account [1203].
This expression is quite complex. However, since it depends on only two
quantities (r/r
L
and θ
i
), it can be pre-computed into a two-dimensional
texture. Snyder also gives two functional approximations. The simpler one
uses a single cubic polynomial and approximates the original curve fairly
well. The second uses two cubic curves, resulting in a curve almost identical
to the original. For real-time rendering, the single cubic curve (or perhaps
some even simpler curve) is likely to be sufficient.
A less physically based but effective method for modeling the effects
of area lights on Lambertian surfaces is to employ wrap lighting.Inthis
technique, some simple modification is done to the value of cos θ
i
before it
is clamped to 0. One form of this is given by Forsyth [358]:
E = E
L
max
cos θ
i
+ c
wrap
1+c
wrap
, 0
, (8.16)
where c
wrap
ranges from 0 (for point light sources) to 1 (for area light
sources covering the entire hemisphere). Another form that mimics the
effect of a large area light source is used by Valve [881]:
E = E
L
cos θ
i
+1
2
2
. (8.17)
One possible problem with wrap lighting is that shadowing can cancel its
effects unless the shadows are reduced in size or softened [139]. Soft shad-
ows are perhaps the most visible effect of area light sources, and will be
discussed in Section 9.1.
The effects of area lights on non-Lambertian surfaces are more involved.
Snyder derives a solution for spherical light sources [1203], but it is limited
to the original reflection-vector Phong BRDF and is extremely complex.
The primary visual effect of area lights on glossy surfaces is the shape of
the highlight. Instead of a small point, the highlight has a size and shape
similar to the area light. The edge of the highlight is blurred according
to the roughness of the surface. The effects of area lights on the highlight
are particularly important for very smooth surfaces. The highlight from a
point light source on such surfaces is a tiny point, which is very unrealis-
tic. In reality, a sharp reflection of the light source appears. One way of
approximating this visual effect is to use a texture to define the highlight
shape, similarly to NDF mapping (see Section 7.6) or environment map-
ping (Section 8.4). Another common technique is to threshold the value of
the specular highlight [458]—Figure 8.7 shows the result.
..................Content has been hidden....................

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