next up previous contents
Next: 6.16.1 How to Project Up: 6 Texture Mapping Previous: 6.15 Visualizing Surface Orientations   Contents


6.16 Projective Textures

Projective textures [92] use texture coordinates which are computed as the result of a projection. The result is that the texture image can be subjected to a separate independent projection from the viewing projection. This technique may be used to simulate effects such as slide projector or spotlight illumination, to generate shadows, and to reproject a photograph of an object back onto the geometry of the object. Several of these techniques are described in more detail in later sections of these notes.

OpenGL generalizes the two component texture coordinate ($s$,$t$) to a four-component homogeneous texture coordinate ($s$,$t$,$r$,$q$). The $q$ coordinate is analogous to the $w$ component in the vertex coordinates. The $r$ coordinate is used for three dimensional texturing in implementations that support that extension and is iterated in manner similar to $s$and $t$. OpenGL provides default values for $r$ (0) and $q$ (1). The addition of the $q$ coordinate adds very little extra work to the usual texture mapping process. Rather than iterating ($s$,$t$,$r$) and dividing by 1/$w$ at each pixel, the division becomes a division by $q$/$w$. Thus, in implementations that perform perspective correction there is no extra rasterization burden associated with processing $q$.



Subsections
next up previous contents
Next: 6.16.1 How to Project Up: 6 Texture Mapping Previous: 6.15 Visualizing Surface Orientations   Contents
2001-01-10