Graphics Reference
In-Depth Information
6.5.3.3 Specular Reflection
The specular reflectance term is the sum of a computed intensity for each direc-
tional and geometric light in the scene. Let's examine this sum for the directional
lights:
,
n
) s
I dir
k s
C s (cos
δ
(6.10)
directional lights
Most materials produce a specular reflection that is some mixture of its diffuse
color and the light source's color, but the ratio of the former to the latter varies.
You may have noticed that some shiny materials show a specular highlight that
is essentially a brighter version of the diffuse color of the material. For example,
the shiny highlights on a brass kettle illuminated by a bright light source are a
“tinted” version of the light's color, highly affected by the innate brass color. But,
as explained earlier, for plasticlike materials, specular highlights take on primar-
ily the color of the light source rather than of the diffuse color. To achieve this
plasticlike appearance, ensure that the product of k s and C s is a value not biased
toward any component color (red, green, or blue) so as to preserve the hue of the
incoming light.
This computation also includes a cosine-based attenuation factor, differing
from that of Lambert's law in two ways. First, Lambert's law compares incom-
ing light to the orientation of the surface alone, and is therefore viewpoint inde-
pendent. However, specular reflection is highly viewpoint dependent, and thus
relies on a different value
e
d
r
Figure 6.38: Phong's original
technique for computing specular
reflection, depicted in a context in
which the camera position is very
close to the reflection ray.
,
n
, which in Phong's original formulation measures the
angle between the reflection vector r (computed via the “angle of reflection equals
angle of incidence” rule mentioned in Section 1.13.1) and the surface-to-camera
vector e , as shown in Figures 6.38 and 6.39. The use of cos
δ
e
d
ensures that the
specular effect is strongest when the viewpoint lies on vector r , and weaker as the
surface-to-camera vector varies more from vector r .
δ
r
Figure 6.39: Phong's original
technique for computing specular
reflection, depicted in a context
in which the camera position is
not close to the reflection ray. The
significant difference in the value
of cos δ makes an even greater
difference when it's raised to a
large power, so the specular term
is nearly zero for this view.
ensures an intensity drop-off as e varies further from
r , we also need to control how “fast” that drop-off is. For a perfect mirror, there
is no gradual drop-off; rather, the reflection's intensity is at a maximum when the
viewpoint is directly on vector r , and is zero if not. This binary situation doesn't
occur in real-world materials; instead, there is a large variety in fall-off velocity
among different materials. Thus, the equation provides for control of the amount
of specularity through the variable s , known as the specular exponent (or spec-
ular power ) of the material. Values of s for highly shiny surfaces are typically
around 100 to 1000, providing a very sharp fall-off. A polished apple, on the other
hand, might have an s of about 10, and thus a larger but dimmer area of measurable
specular contribution. The lab software lets you experiment with different values
of s to become familiar with its effect on specular appearance, and we encourage
you to perform the specular-lighting exercises provided in the online material.
Second, whereas cos
δ
The exponent s on the specular term is sometimes denoted n, which can con-
flict with the name of the normal vector, often written n. It's also sometimes
denoted n s , with the “s” denoting “specular.” Our experience is that artists suc-
ceed better in adjusting the specularity when they're given a control that adjusts
the logarithm of this exponent. As the artist moves a slider from 0 to 3, the
specular exponent moves from 1 to 1000: the value 0 on the slider produces an
appearance like latex paint, 1 like a polished apple, 2 like a shiny coin, and 3
like a mirror.
 
 
Search WWH ::




Custom Search