Graphics Reference
In-Depth Information
and Wallace's first chapter discusses radiosity in full generality, and treats the dis-
cretization approach we've described as just one of many ways to approximate
solutions to the equation.
31.11 Separation of Transport Paths
The distinction between diffuse and specular reflections is so great that it gener-
ally makes sense to handle them separately in your program. For instance, if a
surface reflects half its light in the mirror direction, absorbs 10%, and scatters the
remaining 40 % via Lambert's law, your code for computing an outgoing scattering
direction from an incoming direction will look something like that in Listing 31.1.
This is the algorithmic version of the discussion in Section 29.6, and it involves
the ideas of mixed probabilities discussed in Chapter 30.
Listing 31.1: Scattering from a partially mirrorlike surface.
1
2
3
4
5
6
7
8
9
10
11
12
Input: an incoming direction wi, and the surface normal n
Output: an outgoing direction wo, or false if the light is absorbed
function scatter(...):
r = uniform(0, 1)
if (r > 0.5): // this is mirror scattering
wo=-wi+2 * dot(wi, n) * n;
else if (r > 0.1): // diffuse scattering
wo = sample from cosine-weighted upper hemisphere
else: // absorbed
return false;
31.12 Series Solution of the Rendering
Equation
The rendering equation, written in the form
T ) L = L e ,
( I
(31.47)
is an equation of the form
Mx = b
(31.48)
that's familiar from linear algebra, except that in place of a vector x of three or
four elements, we have an unknown function, L ; instead of a target vector b ,we
have a target function, the emitted radiance field L e ; and instead of the linear trans-
formation being defined by multiplication by a matrix M , it's defined by applying
some linear operator. Roughly speaking, the difference is between the finite-
dimensional problems familiar from linear algebra, and the infinite-dimensional
problems that arise when working with spaces of real-valued functions. (Indeed,
the radiosity approximation amounts to a finite-dimensional approximation of the
infinite-dimensional problem, so the radiosity equation ends up being an actual
matrix equation.)
 
 
 
 
Search WWH ::




Custom Search