13.4 Tile Attributes

The RDP has a small on-chip memory for buffering up to eight tile descriptors at a time. A tile descriptor contains all the information for a texture tile including format; size; line; TMEM address; palette; mirror enable S, T; mask S, T; shift S, T; SL, TL; SH, TH; and clamp S, T.

UP


13.4.1 Format

Format of texels in texture tile.

Table 13-1 Tile Format Encoding
Format ValueFormat
0RGBA
1YUV
2CI
3IA
4I

UP


13.4.2 Size

Size of texels in texture tile.

Table 13-2 Size of Texels in Texture Tile
Size ValueSize of texel in bits
04
18
216
332

UP


13.4.3 Line

Number of 64-bit words in one row of the tile. Dependent on tile row width as well as texel type/size. When tiles are loaded using the LoadTile command, the rows are padded to 64-bit boundaries. When LoadBlock is used to load a texture, it is assumed that the rows have already been padded. Line can also be used to control the stride through TMEM. By controlling Line, smaller tiles can be pieced together into one larger continuous tile.

UP


13.4.4 TMEM Address

Tile offset (0-511) in TMEM (64-bit) words.

UP


13.4.5 Palette

Palette number (0-15) of 4-bit Color Index (CI) textures. An 8-bit index into the high half of TMEM is formed by placing the palette number in the 4 MSBs and the 4-bit texel value in the 4 LSBs. The color in TMEM at this index becomes the color of the pixel. Therefore, for a 4-bit CI texture, you may select one of 16 palettes with each palette having up to 16 entries. Palettes can be loaded into TMEM using the LoadTLUT command or, optionally, the LoadBlock command.

UP


13.4.6 Mirror Enable S,T

This enables mirroring of texture coordinates. When the bit indicated by the (Mask Value + 1) is 0, the coordinates are unchanged. When this bit is 1, however, the coordinates are inverted. Useful for symmetric patterns like trees, faces, etc. For example, a mask of 2 with mirror enabled would yield the following texture coordinates:

0,1,2,3,4,5,6,7,...    Input coordinate
0,1,2,3,3,2,1,0,...    Mirrored Coordinate

UP


13.4.7 Mask S,T

This is the number of bits of tile coordinate to let through. For example, a mask of 1 indicates one bit of the texture coordinate should come through the mask, giving a pattern of 0,1,0,1...As another example, a mask value of 5 indicates that the texture should wrap every 32 texels, i.e., the lower 5 bits are passed through the mask. A mask value of 0 forces clamping the texture coordinates to be between (SL,TL),(SH,TH) inclusive. The mask value + 1 indicates the bit position that is looked at for mirroring. See discussion in Mirror Enable, above.

UP


13.4.8 Shift S,T

This is the shifting of texture coordinates after perspective division. It is used in MIP maps and possibly for precision reasons (see Section 13.7.5.1 "Detail Texture" later in this document).

Table 13-3 Shift Encoding
Shift ValueShift
0no shift
1>>1
2>>2
3>>3
4>>4
5>>5
6>>6
7>>7
8>>8
9>>9
10>>10
11<<5
12<<4
13<<3
14<<2
15<<1

Also useful for combining two differently scaled textures.

UP


13.4.9 SL,TL

When rendering, this is the starting texel column/row of tile in texture image space(10.2 fixed point). By changing the value of SL,TL you can slide texture w.r.t. on the primitive. When loading, this is the starting texel column/row within the DRAM texture image.

UP


13.4.10 SH,TH

When rendering, this is the ending texel column/row of tile in texture image space(10.2 fixed point). It is used for clamping only. When loading, this is the ending texel column/row within the DRAM texture image.

UP


13.4.11 Clamp S,T

This is the enable clamp during wrap or mirror. When not masking, Clamp S,T is ignored and clamping is implicitly enabled. This bit allows clamping of the texture coordinates when the mask is non-zero. It is useful when you want to mirror and then clamp, as with an airplane wing insignia. The border of the insignia would have an alpha of 0. For example, SH = 11, mask = 2, mirror = 1, clamp = 1:

0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,...    Input Coordinate
0,1,2,3,3,2,1,0,0,1, 2, 3, 3, 3, 3, 3,...    Mirrored/Clamped Coordinates

UP