Graphics Reference
In-Depth Information
6.5 The WPF Reflectance Model
In Section 6.2.2, we presented Lambert's simple cosine rule for calculating
reflected light from a diffuse surface. That simple equation is just one part of
the complete WPF reflectance model, which is based on a classic approximation
strategy that provides results of acceptable quality, without complex physics-based
calculations, on a wide variety of commodity graphics hardware.
6.5.1 Color Specification
The word “color” is used to describe multiple things: the spectral distribution of
wavelengths in light, the amount of light of various wavelengths that a surface will
reflect, and the perceptual sensation we experience on seeing an object. Represent-
ing color precisely is a serious matter to which Chapter 28 is dedicated. Indeed,
specifying color via RGB triples—the common approach in graphics APIs and
drawing/painting applications—may well be the grossest of all the approxima-
tions made in computer graphics practice!
When describing a scene, we specify the colors of the light sources and of the
objects themselves. In WPF, specifying the former is straightforward (see Sec-
tion 6.2.2), but describing the latter is far more complex, requiring the separa-
tion of the material into three distinct components. Section 6.5.3 is dedicated to
describing this specification technique and the effects it can achieve.
6.5.2 Light Geometry
The two WPF lighting types we have used thus far (ambient and directional)
are useful approximations but decidedly unrealistic: They are not considered to
be emanating from a specific point in the scene, and their brightness is uniform
throughout the entire scene.
A geometric light source adds realism in that it is located in the scene and is
attenuated —that is, the amount of energy reaching a particular surface point P is
dependent on the distance from P to the light source. WPF offers two geometric
light source types.
•A point light emanates energy equally in all directions, simulating a naked
bulb suspended from a ceiling without any shade or baffles. Specification
parameters include its position and the attenuation type/rate (constant, lin-
ear, or quadratic, as described in Section 14.11.9). The lab software for this
chapter allows experimentation with this type of light source.
•A spotlight is similar, but it simulates a theatre spotlight in that it spreads
light uniformly but restricts it to a cone-shaped volume.
Geometric lights are useful but should still be considered only approximations,
since real physical light sources (described in Section 14.11.6) have volume and
surface area, and thus do not emit light from a single point.
6.5.3 Reflectance
In our modeling of desert scenes throughout this chapter, we have applied material
to our meshes by specifying either a solid color or a texture image. However, there
is more to a material than its color. If you've shopped for interior-wall paint, you
 
 
 
 
 
Search WWH ::




Custom Search