Game Development Reference
In-Depth Information
Rougher surfaces tend to scatter the light in a much broader pattern of
directions, which is modeled by the diffuse component described in Sec-
tion 10.6.3.
Now let's see how the standard model calculates the specular contribu-
tion. The important vectors are labeled in Figure 10.20.
n is a the local outward-pointing surface normal.
v points towards the viewer. (The symbol e , for “eye,” is also some-
times used to name this vector.)
l points towards the light source.
r is the reflection vector, which is the direction of a “perfect mirror
bounce.” It's the result of reflecting l about n .
θ is the angle between r and v .
Figure 10.20
Phong model for specular
reflection
For convenience, we assume that all of these vectors are unit vectors.
Our convention in this topic is to denote unit vectors with hats, but we'll
drop the hats to avoid decorating the equations excessively. Many texts
on the subject use these standard variable names and, especially in the
video game community, they are effectively part of the vernacular. It is
not uncommon for job interview questions to be posed in such a way that
assumes the applicant is familiar with this framework.
One note about the l vector before we continue. Since lights are abstract
entities, they need not necessarily have a “position.” Directional lights and
Doom-style volumetric lights (see Section 10.7) are examples for which the
position of the light might not be obvious. The key point is that the position
of the light isn't important, but the abstraction being used for the light must
facilitate the computation of a direction of incidence at any given shading
point. (It must also provide the color and intensity of incident light.)
Search WWH ::




Custom Search