Next: Parameter Interpolation and Normalization
Up: Implementation
Previous: Implementation
Two kinds of surfaces can be distinguished according to the way they reflect
light. On one hand, there are diffuse surfaces for which light is
reflected in every direction (Figure 3(a)). On the
other hand, there are specular surfaces for which light is reflected
only in a small area around the mirror direction
(Figure 3(b)).
Figure 3:
Blinn-Phong Lighting Model
[Diffuse Reflection] ![\includegraphics[height=31mm]{D:/Studium/Per-Pixel-Lighting/text_cescg/image/diffuse-reflection.eps}](img4.png)
[Specular Reflection] |
There are many lighting models to describe this behavior. For
simplicity we will use the Blinn-Phong [2] lighting model
(Formula 1).
 |
(1) |
is the color of the light,
is the diffuse color,
is the specular color;
is the specular exponent which defines the
shininess of the surface.
is the normalized surface normal,
is the normalized direction vector pointing to the light source. The
half-angle vector
is the half-way unit vector between
and
defined in Formula 2.
 |
(2) |
Where
is the normalized vector to the viewer. It is important to max
out negative dot product terms, as a negative dot product indicates that the
point is in shadow and receives no light. The key aspects for successful
per-pixel lighting are to provide the needed vector parameters (
,
and
) for evaluating the lighting equation and to compute
the per-pixel dot products. In the next Section we will see how to interpolate
and normalize this vectors.
Next: Parameter Interpolation and Normalization
Up: Implementation
Previous: Implementation
Gerald Schröcker
2002-03-21