Chapter 13 - Texture Mapping

Texture mapping, or texturing, is the process of applying an image to a polygonal surface. There are many graphics books that discuss this topic; this guide assumes that you are familiar with the basic principles of texture mapping. This chapter explains the functionality of texture mapping as implemented in the Reality Display Processor (RDP).

Figure 13-1 Texture Unit Block Diagram
[Figure 13-1]

The RDP contains an on-chip texture memory called TMEM, which buffers all source image data used for texturing. TMEM contains up to eight tiles (a tile is a rectangular region of an image). A tile is loaded into TMEM using the LoadTile, LoadBlock, or LoadTlut commands, and described using the SetTile and SetTileSize commands. If the image is too large to fit entirely in TMEM, primitives must be subdivided in object space based on their texture coordinate values so that each primitive references a tile that fits in TMEM.

Texture coordinates (S,T) for each pixel are input to the texture coordinate unit and can be perspective corrected. Perspective correction is typically enabled for 3D geometry and disabled for 2D sprites (tex_rect commands). During this time, the texture coordinate unit calculates which tile descriptor to use for this primitive. The texture image coordinates are converted to tile-relative coordinates and wrapped, mirrored, and clamped. These tile coordinates are then used to generate an offset into TMEM. The texture unit can address 2x2 regions of texels in one or two cycle mode, or 4x1 regions in copy mode. Copy mode is typically used for blits (block copy of texels) with a 1:1 texel pixel relationship. In one or two cycle mode, filter or point-sample can also be selected. Typically, filter will result in a smoother image with less aliasing. The texture unit also generates S,T and L-fraction values that are used to bi-linearly or tri-linearly interpolate the texels.

The texture unit supports ten different combinations of texel size and format:

Significant memory savings can result from the smaller color-index textures or intensity textures over the more expensive 16-bit RGBA. It is a good idea to experiment with the different texel sizes. One can actually do 2-color textures using the intensity types. Also, the intensity-only textures place the texel value on the alpha channel as well where it can be used for blending or ignored.


13.1 Graphics Binary Interface for Texture
13.1.1 Primitive Commands
13.1.2 Tile Related Commands
13.1.3 Load Commands
13.1.4 Sync Commands
13.1.5 Mode Commands
13.2 Example Display List
13.3 Texture Image Space
13.4 Tile Attributes
13.4.1 Format
13.4.2 Size
13.4.3 Line
13.4.4 TMEM Address
13.4.5 Palette
13.4.6 Mirror Enable S,T
13.4.7 Mask S,T
13.4.8 Shift S,T
13.4.9 SL, TL
13.4.10 SH, TH
13.4.11 Clamp S,T
13.5 Tile Descriptor Loading
13.6 Texture Pipeline
13.7 Tile Selection
13.7.1 Functionality
13.7.2 LOD Disabled
13.7.3 LOD Enabled
13.7.4 MIP Mapping
13.7.5 Magnification
13.7.5.1 Detail Texture
13.7.5.2 Sharpen Mode
13.7.5.3 Bilinear Filtering and Point Sampling
13.8 Texture Memory
13.8.1 Memory Organization
13.8.2 Texel Formatting
13.9 Texture Loading
13.9.1 Load Tile
13.9.2 Wrapping a Large Texture Using Load Tile
13.9.3 Load Block
13.9.4 Loading Notes
13.10 Examples
13.11 Restrictions
13.11.1 Texture Types and Modes
13.11.1.1 Point Sample
13.11.1.2 Filter
13.11.1.3 Copy
13.11.1.4 LOD
13.11.2 Alignment
13.11.3 Tiles
13.11.4 Texture Types and Modes
13.12 Applications
13.12.1 Multiple Tile Effects
Appendix A : Load Block Line Limits