Graphics Reference
In-Depth Information
We can rewrite the second term as a sum by splitting the
L
in the integrand
into two parts. As in Chapter 31, we let
L
r
=
L
L
e
denote the
reflected
light
(later, it will be reflected and refracted light) in the scene. At most surface points,
L
r
=
L
, because most points are not emitters. At emitters, however,
L
e
is nonzero,
so
L
r
and
L
differ. Thus,
scattered
=
−
)
L
e
(
P
,
f
s
(
P
,
v
i
,
−
v
i
)
v
i
·
n
P
d
(32.7)
v
v
i
v
i
∈
S
+
(
n
P
)
scattered direct
+
v
i
∈
S
+
(
n
P
)
)
L
r
(
P
,
f
s
(
P
,
v
i
,
−
v
i
)
v
i
·
n
P
d
.
(32.8)
v
v
i
scattered indirect
Inline Exercise 32.5:
Explain why, for a point
Q
on some luminaire and some
direction
,
L
r
(
Q
,
v
v
)
might be nonzero.
The first integral, representing scattered direct light, can be further expanded.
We write
L
e
=
j
=
1
L
j
as a sum of the illuminations due to the
k
individual
luminaires, so that
k
scattered direct
=
D
j
(
P
,
v
)
, where
(32.9)
j
=
1
)=
)
L
j
(
P
,
D
j
(
P
,
f
s
(
P
,
v
i
,
−
v
i
)
v
i
·
n
P
d
v
i
.
(32.10)
v
v
v
i
∈
S
+
(
n
P
)
Thus,
D
j
(
P
,
)
represents the light reflected from
P
in direction
v
v
due to direct
light from source
j
.
Rather than computing
D
j
by integrating over all directions
v
i
in
S
+
(
n
P
)
,we
can simplify by integrating over only those directions where there's a possibil-
ity that
L
e
(
P
,
−
v
i
)
will be nonzero, that is, directions pointing toward the
j
th
luminaire. We do so by switching to an area integral over the region
R
j
consti-
tuting the
j
th luminaire; the change of variables introduces the Jacobian we saw in
Section 26.6.5:
D
j
=
v
i
∈
S
+
(
n
P
)
)
L
j
(
P
,
f
s
(
P
,
v
i
,
−
v
i
)
v
i
·
n
P
d
(32.11)
v
v
i
=
Q
−
v
i
)
V
(
P
,
Q
)
(
v
i
·
n
P
)(
v
i
·
n
Q
)
f
s
(
P
,
v
i
,
)
E
j
(
Q
,
dQ
,
(32.12)
v
Q
−
P
2
∈
R
j
where
P
)
is the unit vector from
P
toward
Q
, and we have introduced
the visibility term
V
(
P
,
Q
)
in case the point
Q
is not visible from
P
. (Note that this
transformation converts our version of the rendering equation into the formwritten
by Kajiya [Kaj86].) The preceding argument only works for area luminaires. In
the case of a point luminaire, this integral must be computed by a limit as in
Chapter 31.
For an area luminaire, we estimate the integral with a single-sample Monte
Carlo estimate:
v
i
=
S
(
Q
−