next up previous
Next: Parameter Interpolation and Normalization Up: Implementation Previous: Implementation

Lighting Model

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} [Specular Reflection]\includegraphics[height=31mm]{D:/Studium/Per-Pixel-Lighting/text_cescg/image/specular-reflection.eps}
There are many lighting models to describe this behavior. For simplicity we will use the Blinn-Phong [2] lighting model (Formula 1).

$\displaystyle I_{out}=I_{Light}k_{d}\max(0,\vec{N}\cdot\vec{L})+I_{Light}k_{s}\max(0,\vec {N}\cdot\vec{H})^{n}%%
$ (1)

$ I_{Light\,}$ is the color of the light, $ k_{d}$ is the diffuse color, $ k_{s}$ is the specular color; $ n$ is the specular exponent which defines the shininess of the surface. $ \vec{N}$ is the normalized surface normal, $ \vec
{L}$ is the normalized direction vector pointing to the light source. The half-angle vector $ \vec{H}$ is the half-way unit vector between $ \vec{L}$ and $ \vec{V}$ defined in Formula 2.

$\displaystyle \vec{H}=\frac{\vec{L}+\vec{V}}{\left\vert \vec{L}+\vec{V}\right\vert }%%
$ (2)

Where $ \vec{V}$ 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 ($ \vec{N}$, $ \vec{L}$ and $ \vec{H}$) 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 up previous
Next: Parameter Interpolation and Normalization Up: Implementation Previous: Implementation
Gerald Schröcker 2002-03-21