Graphics Reference
In-Depth Information
know that you must also choose the finish (flat, eggshell, satin, semigloss), which
describes how the painted surface will reflect light.
The physics of how light is reflected from a surface is extremely complex,
so for decades, the fixed-function pipeline has relied on a classic approximation
strategy called the Phong reflectance (lighting) model that yields an effective
simulation of reflection at very little computational cost. 3 In the Phong model,
a material is described by configuring three distinct components of reflection:
ambient (a small constant amount of light, providing a gross simulation of inter-
object reflection), diffuse (representing viewer-independent light reflected equally
in all directions), and specular 4 (providing glossy highlights on shiny surfaces
when the viewpoint is close to the reflection ray). The values calculated for the
three components—Figure 6.37, (a) through (c)—are summed to produce the final
appearance, shown in part (d) of that figure.
The independent nature of the diffuse and specular components allows us to
generate the approximate appearance of materials having multiple layers with dis-
tinct reflectance characteristics. Consider a polished red apple: On top of its dif-
fuse red layer lies a colorless waxy coating that provides glossy highlights based
on the color of the light source (not of the apple). This same pattern of reflec-
tion is also very common in plastics, although it is not generated by a multilayer
reflectance, but by the nature of the plastic material itself. Our blue plastic teapot
(in Figure 6.37) shows this: Its glossy highlights have the colorless hue of the
incoming white light, while the diffuse reflections have the blue hue of the plas-
tic. In Section 6.5.3.3 we'll provide more detail on how to produce this effect. Of
course, this simplistic technique of summing noninteracting layers is inadequate
for complex materials such as human skin; Section 14.4 presents an introduction
to richer, more accurate material models, and Chapter 27 gives full details.
In this section, we describe the lighting equation for WPF's reflectance model,
which is heavily based on, but not completely identical to, the Phong model. Let's
first examine the equation's inputs that are specified as properties of the material
resources (e.g., inWPF elements such as DiffuseMaterial and others enumerated
in this chapter's online materials):
Figure 6.37: Renderings of a
teapot, showing the contribution
of each of the three compo-
nents generated by the Phong
lighting equation: (a) ambient,
(b) diffuse, (c) specular, and (d)
result generated by summing the
contributions.
Symbol
Description
Format
C d
Innate color of “diffuse layer” ( C d,R , C d,G , C d,B )
C s
Innate color of “specular layer” ( C s,R , C s,G , C s,B )
k a
Efficiency of diffuse layer at reflecting
ambient light
( k a,R , k a,G , k a,B )
k d
Efficiency of diffuse layer at reflecting
directional/geometric light
( k d,R , k d,G , k d,B )
k s
Efficiency of specular layer at reflecting
directional/geometric light
( k s,R , k s,G , k s,B )
3. This non-physics-based reflectance model was invented early in the history of raster
graphics and rendering research in the 1970s initially by University of Utah Ph.D.
student Bui Tuong Phong and then slightly modified by Blinn, and has been remarkably
long-lived, especially in real-time graphics.
4. For this chapter only, we are following the convention that “specular” refers to some-
what concentrated reflections rather than to perfect mirror reflection. Elsewhere spec-
ular means “mirrorlike,” while sort-of-specular reflection is called “glossy.” The use
of “specular” for glossy follows both Phong's original paper and the WPF convention,
but conflicts with its ordinary meaning of “having the properties of a mirror.”
 
 
Search WWH ::




Custom Search