i
i
i
i
i
i
i
i
24.3. Accurate Direct Lighting 633
Figure 24.8. A sphere with L
e
= 1 touching a sphere of reflectance 1. Where the two
spheres touch, the reflective sphere should have L(x
) = 1 . Left: 1 sample. Middle: 100
samples. Right: 100 samples, close-up.
where k
i
is given by
k
i
=
u
x
v
x
w
x
u
y
v
y
w
y
u
z
v
z
w
z
cos φ sin α
sin φ sin α
cos α
.
We must also calculate p(x
), the probability density function with respect to the
area measure (recall that the density function q is dened in solid angle space).
Since we know that q is a valid probability density function using the ω measure,
and we know that dΩ=dA(x
)cosθ
/x
x
2
, we can relate any probability
density function q(k
i
) with its associated probability density function p(x
):
q(k
i
)=
p(x
)cosθ
x
x
2
. (24.7)
So we can solve for p(x
):
p(x
)=
cos θ
2πx
x
2
&
1
1
R
xc
2
'
.
A good debugging case for this is shown in Figure 24.8.
24.3.3 Non-diffuse Luminaries
There is no reason the luminance of the luminaire cannot vary with both direction
and position. For example, it can vary with position if the luminaire is a television.
It can vary with direction for car headlights and other directional sources. Little
in our analysis need change from the previous sections, except that L
e
(x
) must
change to L
e
(x
, k
i
). The simplest way to vary the intensity with direction is to
use a Phong-like pattern with respect to the normal vector n
. To avoid using an
exponent in the term for the total light output, we can use the form
L
e
(x
, k
i
)=
(n +1)E(x
)
2π
cos
(n1)
θ
,
i
i
i
i
i
i
i
i
634 24. Global Illumination
where E(x
) is the radiant exitance (power per unit area) at point x
,andn is the
Phong exponent. You get a diffuse light for n =1. If the light is non-uniform
across its area, e.g., as a television set is, then E will not be a constant.
Frequently Asked Questions
My pixel values are no longer in some sensible zero-to-one range. What
should I display?
You should use one of the tone reproduction techniques described in Chapter 23.
What global illumination techniques are used in practice?
For batch rendering of complex scenes, path tracing with one level of reection
is often used. Path tracing is often augmented with a particle tracing prepro-
cess as described in Jensen’s book in the chapter notes. For walkthrough games,
some form of world-space preprocess is often used, such as the particle tracing
described in this chapter. For scenes with very complicated specular transport, an
elegant but involved method, Metropolis Light Transport (Veach & Guibas, 1997)
may be the best choice.
How does the ambient component relate to global illumination?
For diffuse scenes, the radiance of a surface is proportional to the product of the
irradiance at the surface and the reectance of the surface. The ambient com-
ponent is just an approximation to the irradiance scaled by the inverse of π.So
although it is a crude approximation, there can be some methodology to guessing
it (M. F. Cohen et al., 1988), and it is probably more accurate than doing nothing,
i.e., using zero for the ambient term. Because the indirect irradiance can vary
widely within a scene, using a different constant for each surface can be used for
better results rather than using a global ambient term.
Why do most algorithms compute direct lighting using traditional ray
tracing?
Although global illumination algorithms automatically compute direct lighting,
and it is in fact slightly more complicated to make them compute only indi-
rect lighting, it is usually faster to compute direct lighting separately. There are
three reasons for this. First, indirect lighting tends to be smooth compared to
i
i
i
i
i
i
i
i
24.3. Accurate Direct Lighting 635
Figure 24.9. A comparison between a rendering and a photo.
Image courtesy Sumant
Pattanaik and the Cornell Program of Computer Graphics.
(See also Plate XXI.)
direct lighting (see Figure 24.1) so coarser representations can be used, e.g., low-
resolution texture maps for particle tracing. The second reason is that light sources
tend to be small, and it is rare to hit them by chance in a “from the eye” method
such as path tracing, while direct shadow rays are efcient. The third reason is
that direct lighting allows stratied sampling so it converges rapidly compared to
unstratied sampling. The issue of stratication is the reason that shadow rays are
used in Metropolis Light Transport despite the stability of its default technique for
dealing with direct lighting as just one type of path to handle.
How artificial is it to assume ideal diffuse and specular behavior?
For environments that have only matte and mirrored surfaces, the Lambertian/
specular assumption works well. A comparison between a rendering using that
assumption and a photograph is shown in Figure 24.9.
How many shadow rays are needed per pixel?
Typically between 16 and 400. Using narrow penumbra, a large ambient term (or
a large indirect component), and a masking texture (Ferwerda et al., 1997) can
reduce the number needed.
How do I sample something like a filament with a metal reflector where
much of the light is reflected from the filament?
Typically the whole light is replaced by a simple source that approximates its
aggregate behavior. For viewing rays, the complicated source is used. So a car
headlight would look complex to the viewer, but the lighting code might see sim-
ple disk-shaped lights.
i
i
i
i
i
i
i
i
636 24. Global Illumination
Isn’t something like the sky a luminaire?
Yes, and you can treat it as one. However, such large light sources may not be
helped by direct lighting; the brute-force techniques are likely to work better.
Notes
Global illumination has its roots in the elds of heat transfer and illumination en-
gineering as documented in Radiosity: A Programmer’s Perspective (Ashdown,
1994). Other good books related to global illumination include Radiosity and
Global Illumination (M. F. Cohen & Wallace, 1993), Radiosity and Realistic
Image Synthesis (Sillion & Puech, 1994), Principles of Digital Image Synthe-
sis (Glassner, 1995), Realistic Image Synthesis Using Photon Mapping (Jensen,
2001), Advanced Global Illumination (Dutr´e et al., 2002), and Physically Based
Rendering (Pharr & Humphreys, 2004). The probabilistic methods discussed
in this chapter are from Monte Carlo Techniques for Direct Lighting Calcula-
tions (Shirley et al., 1996).
Exercises
1. For a closed environment, where every surface is a diffuse reector and
emittor with reectance R and emitted radiance E, what is the total radi-
ance at each point? Hint: for R =0.5 and E =0.25 the answer is 0.5.
This is an excellent debugging case.
2. Using the denitions from Chapter 20, verify Equation (24.1).
3. If we want to render a typically-sized room with textures at centimeter-
square resolution, approximately how many particles should we send to get
an average of about 1000 hits per texel?
4. Develop a method to take random samples with uniform density from a
disk.
5. Develop a method to take random samples with uniform density from a
triangle.
6. Develop a method to take uniform random samples on a “sky dome” (the
inside of a hemisphere).
..................Content has been hidden....................

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