Graphics Reference
In-Depth Information
meaning since the pixel's range of red values is limited to the range of 0% to 100%
illumination. Simple lighting models simply clamp excessive values to 100%. The
“extra” illumination is thus discarded, which can have a negative impact on ren-
derings, including unintended changes in hue or saturation. More sophisticated
techniques for dealing with this situation—primarily the use of physical units—
are discussed in Chapters 26 and 27. This failure is a consequence of the ill-
defined nature of “intensity” that we discussed earlier, and presents a practical and
widespread incidence of the failure of the Wise Modeling principle. The model of
intensity as a number that varies from 0 to 1 was clearly a bad choice as the scale
of scenes and complexity of lighting grew.
Inline Exercise 6.9: As we present the various components of the WPF
reflectance model below, you may want to experiment with the effects of the
configurable terms by using the lighting/materials laboratory software, and
accompanying list of suggested exercises, available in the online resources for
this chapter.
6.5.3.1 Ambient Reflection
Ambient light is constant throughout the scene, so the computation of the ambient
reflection component is extremely simple and devoid of geometric dependencies.
In the WPF reflectance model, there is no ambient innate color, so the material's
diffuse color is used. The red component of the ambient reflection is computed
via:
I a,R k a,R C d,R
(6.8)
We encourage you to immediately perform the ambient-related experiments
suggested in the lighting exercises presented online.
6.5.3.2 Diffuse Reflection
Directional light appears in the diffuse term of the reflectance model, computed
by Lambert's cosine rule described in Section 6.2.2. Here is the red portion of this
term, which takes into account all the directional lights in the scene:
I dir,R k d,R C d,R (cos
θ
)
(6.9)
directional lights
The sum here is over all directional lights in the scene. The angle
θ
will gen-
erally be different for each one, as will the intensity I dir,R .
A similar equation sums over the set of geometric light sources, to take into
account their attenuation characteristics. This equation is shown as part of the
diffuse term in the full equation shown in the table above.
We encourage you to immediately perform the diffuse-related experiments
suggested in the lighting exercises presented online.
Note that for solid-color materials, the distinction between the two terms C d
and k d is unnecessary, as far as the math is concerned; you can think of them as
a single term. That is, you can fix k d,R at 1. 0 and use C d,R to achieve any effect,
and conversely you could fix C d,R and specify only k d,R . However, the distinction
between the two terms is meaningful when the innate color C d is being provided
via texture mapping; in that case, there is a need for a k d,R factor affecting the
reflection of the varying color C d specified by the texture.
 
 
Search WWH ::




Custom Search