next up previous
Next: Bump Mapping Up: Implementation Previous: Register Combiners

Tangent Space

Lighting can be computed in an arbitrary 3D coordinate system as long as all vector parameters involved are oriented with respect to the same coordinate system [10]. This allows one to select the most convenient coordinate system for lighting. Tangent space is just such a local coordinate system. There are two reasons why lighting in tangent space is very efficient. The first one is that the normal vector $ \vec{N}$ equals always $ (0,0,1)$ in tangent space, therefore $ \vec{N}$ needs no longer interpolated and normalized. The second reason is that in tangent space the perturbed normal for bump mapping can be read directly from a texture2 as Kilgard[10] develop. The orthonormal basis for tangent space is formed by the surface normal $ \vec{N}$, the surface tangent vector $ \vec{T}$, and the binormal $ \vec{B}$ defined as $ \vec{N}\times\vec{T}$ (Figure 6)

Figure 6: Definition of Tangent Space
\includegraphics[]{D:/Studium/Per-Pixel-Lighting/text_cescg/image/tangent-space.eps}
For the illumination calculation to proceed properly, the light and half-angle vectors are transformed into tangent space via a $ 3\times3$ matrix whose columns are $ \vec{T}$, $ \vec{B}$, and $ \vec{N}$. The transformations of the light and half-angle vectors should be performed at every pixel; however, if the change of the local tangent space across a polygon is small, a good approximation can be obtained by transforming the vectors only at the polygon vertices. They are then interpolated and normalized in the polygon interior. Therefore tangent space is constructed efficiently on a per-vertex basis with the help of a vertex shader (Section 3.1).


next up previous
Next: Bump Mapping Up: Implementation Previous: Register Combiners
Gerald Schröcker 2002-03-21