Stenciling is not directly supported by the Voodoo Graphics family graphics hardware. However, a stencil effect is possible with depth buffering by setting the depth buffer (using linear frame buffer writes) to its minimum value in the areas to be stenciled out.
The discussion thus far has described how to produce a polygon that is filled with a solid color or smoothly shaded from one color to another. This chapter describes the process of filling a polygon with a pattern: a brick wall pattern, for example, or a veined marble texture.
Texture mapping is a technique in which a two-dimensional image, a texture map, is pasted like wall-paper onto a three-dimensional surface. This allows for very realistic images without requiring the use of many small detail polygons. The Voodoo Graphics hardware provides accelerated perspective-correct texture mapping.
You will learn about:
specifying magnification and minification filters and texture clamping options
adding, modulating, and blending textures in the texture combine unit
2A Look at Texture Mapping and Glide
A texture map is a square or rectangular array of texture elements, or texels, that are addressed by (s, t) coordinates. The TMU, or texture mapping unit, contains memory for storing textures, circuitry to map texels to pixels, and more circuitry to add, scale, and blend texels.
A Voodoo Graphics subsystem includes at least one TMU and may have as many as three. Figure Texture Mapping.1 shows the connectivity. Each TMU will produce an RGBA color from its own texture memory that will be pairwise combined to produce a texture RGBA color that can be selected as an input to the color combine and alpha combine units described in Chapters Chapter 5. and Chapter 6. .
Texture memory is described in the next chapter. In this chapter, we assume that textures are already loaded into texture memory and concern ourselves with configuring the texel selection function and using the texture combine unit.
Figure Texture Mapping.1 TMU connectivity. A TMU contains texture memory, texture selection circuitry, and a texture combine unit. The texture combine units have other and local datapaths just like the color and alpha combine units. (a) A system with one TMU extracts the appropriate texel or texels from texture memory, minifies or magnifies it, filters it, and clamps or wraps it according to texture map parameters or local overrides. The texture combine unit can scale the result. (b) When the system has two TMUs they are chained together. The result from one TMU becomes an input to the texture combine unit of the next one and the texture RGBA that results is a user-selectable combination of the two textures. (c) A three TMU system continues the cascading of texels.