Graphics Reference
In-Depth Information
field radiance at other points, expressed in terms of spherical harmonics at those
points.
This approach, which we've only sketched here, has been developed thor-
oughly by Ramamoorthi [RH01]. There are several important challenges.
• There is a conversion of harmonic decompositions in different coordinate
systems, which we've already described.
• We replaced the work of integration with the work of matrix multiplication;
that's only a good idea if the matrix size is not too large. Unfortunately,
the more “spiky” a function is, the more terms you need in its spherical-
harmonic series to approximate it well (just as we need high-frequency
sines and cosines to approximate rapidly changing functions in one dimen-
sion). Since many BRDFs are indeed spiky (mirror reflectance is a particu-
larly difficult case), a good approximation may require a great many terms,
making the matrix multiplication expensive, especially if the matrix is not
sparse.
• We've ignored a critical property of irradiance at surfaces: It's nonzero
only on the upper hemisphere. That makes the equator generally a line of
discontinuity, and fitting spherical harmonics to discontinuities is difficult:
A good fit requires more terms.
Ramamoorthi makes a strong argument for much of field radiance being well
represented by just the first few spherical harmonics. Sloan [Slo08] has written a
useful summary of properties of spherical harmonics, and with Kautz and Sny-
der [KSS02] has shown how to use them very efficiently in rendering scenes with
either fixed view and moving lights, or vice versa.
31.16 Introduction to Monte Carlo Approaches
We now move on to Monte Carlo techniques for solving the rendering equation.
The basic idea is to estimate the integral in the rendering equation (or some other
integral) by probabilistic methods, which we discussed in Chapter 29. Broadly
speaking, we collect samples of the integrand and average them, multiplying the
size of the domain of integration.
We begin with a broad and informal view of the various techniques we'll be
examining.
Classic ray tracing, which you already saw in Chapter 15, consists of repeat-
edly casting a ray from the eye and determining the color of the point where it first
intersects a surface in the scene. This color is the sum of the illumination from
each visible light source (we use ray casting to check visibility), plus illumina-
tion from elsewhere in the scene, which we only compute if the intersection point
has some specular component, in which case we recursively trace the reflected or
refracted ray.
In Chapter 15, we only computed the direct illumination, but modifying a ray
tracer to include the recursive part is fairly straightforward. Listing 31.2 gives the
pseudocode for point light sources.
The use of “color” here is a shorthand for “spectral radiance distribution,” but
the main idea is that there's some quantity we can compute by evaluating direct
illumination at the intersection point, and a remaining quantity that we compute
by a recursion. We must generally cast rays from the eye through every pixel in
 
 
Search WWH ::




Custom Search