Graphics Reference
In-Depth Information
31
32
33
34
35
36
37
38
39
40
/ ** Given wo, samples wi from the normalized PDF of wi -> g(wi, wo) * |wi . n|. * /
virtual Vector3 scatterIn
( const Vector3 &
wo,
Color3 &
weight) const =0;
/ ** Given wo, returns the a priori probability of scattering (vs. absorption) * /
virtual Color3 probabilityOfScatteringIn( const Vector3 & wo) const =0;
};
There are two sources for BSDF implementations. Measured BSDFs are con-
structed from thousands or millions of controlled measurements of a real surface.
Measurement is expensive (or tricky to perform oneself), but it provides great
physical realism. The data describing the BSDF is typically large but generally
smooth, and thus amenable to compression.
Analytic BSDFs describe the surface appearance in terms of physically or aes-
thetically meaningful parameters. They are usually expressed as sums and prod-
ucts of simple functions that are zero for most arguments and rise in a smooth lobe
over a narrow region of the parameter space. Those analytic BSDFs that model
the underlying physics can be used predictively. We now describe some simple
yet popular analytic BSDFs.
14.9.2 Lambertian
Lambert observed that most flat, rough surfaces reflect light energy proportional
to the cosine of the angle between their surface normal and the direction of the
incoming light. This is known as Lambert's Law. It follows from geometry for
surfaces with a constant BSDF because the projected area of the surface is pro-
portional to the cosine of the incoming-light angle. A constant BSDF is named
Lambertian because it follows this law.
Although few surfaces exhibit truly Lambertian reflectance, most insulators
can be recognizably approximated by a Lambertian BSDF. The residual error is
then addressed by adding other terms, as described in the following subsection.
Examples of nearly Lambertian surfaces are a wall painted with flat (i.e.,
matte) paint, dry dirt, and skin and cloth observed from several meters away. The
primary error in approximating these as Lambertian is that they tend to appear
shinier than predicted by a constant BSDF when observed at a glancing angle.
In practice, the approximately Lambertian appearance usually arises because
the surface is somewhat permeable to light at a very shallow level and all direc-
tionality is lost by the time light emerges. Glossy highlights are caused by light
preferentially reflecting close to the mirror-reflection direction. When that does
not happen, the surface appears matte.
Listing 14.8 implements a Lambertian BSDF's evaluate method. We specify a
single “Lambertian constant” k L for each frequency band, that is, a Color3 .The
components of k L must each be in the range [0, 1]. They represent the reflectivity
of the surface to each “color” of light. Larger values are brighter, so (1, 0, 0)
appears bright red and (0.2, 0.4, 0.0) is a dark brown. Of course, few real surfaces
truly have perfect absorption or perfect reflectance along any color channel. Many
physically based rendering systems also tend to risk dividing by zero if any color
channel is at either limit, so it is a good idea to select constants on the open interval
(0, 1) in practice.
 
 
 
Search WWH ::




Custom Search