Graphics Reference
In-Depth Information
To make this concrete, Listing 26.1 shows how you might actually estimate
this integral numerically, given the function g that takes a unit vector as an
argument.
Listing 26.1: Integrating a cosine-weighted function over the solid angle
subtended by a light source.
// Given rectangle information C (corner), u , v (unit edge vectors),
// w , h (width and height) and n (unit normal), a point P on
// a plane whose normal is n , and a function g
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(
.
) of a single
// unit-vector argument, estimate the
// integral of g ( v ) v · n over the set Ω of
// directions from P to points on the rectangle.
sum = 0;
for i=0toN-1
s = i/(N-1)
Δ
s = 1/(N-1);
for j=0toN-1
t = j/(N-1)
Δ t = 1/(N-1)
Q = C +s * u +t * v
v
S ( Q P )
r = Q P
=
g ( v ) | v · n | v · n |
r 2
sum +=
Δ s
Δ t
return sum
To summarize, when we change from an integral over solid angles to an inte-
gral over some planar surface with normal n , we introduce an extra factor in the
integrand, of the form | v · n |
r 2
is the unit vector from P to a point Q on the
surface and r is the distance from P to Q . Often the integrand will already have
the form g (
, where
v
)
| v ·
|
v
n
, so the integrand for the area integral will be
n |
) | v ·
n
|| v ·
g (
.
(26.38)
v
r 2
26.7 Measuring Light
With the notion of solid angle in hand, we can now precisely describe how light
energy is flowing in a scene. We'll consider a function L , called the spectral
radiance. It's a function of time, position, direction, and wavelength that cap-
tures the infinitesimal characteristics of light transport in the sense that when it's
integrated over a time interval, and over some part of a surface perpendicular to
the direction of transport, and over some solid angle of directions, and over some
range of wavelengths, the result is the total light energy that arrives at that surface,
arriving from the specified directions, within the range of wavelengths, and during
the time interval. We previously discussed summing up energies for all different
wavelengths, and we'll do that presently, but for now, we want to consider the
per-wavelength function—yet another density!
The integral of spectral radiance over a small surface, and a small range of
directions, and a small period of time, and a small range of wavelengths, is the
sort of thing that can be measured by a physical device, while the infinitesimal
 
 
 
Search WWH ::




Custom Search