11.5 Texture State

The following command sets the RSP texture state:

Table 11-8 gsSPTexture(int s,int t,int levels,int tile,int on)
ParameterValues
ss-coordinate texture scale (16-bit unsigned fraction)
tt-coordinate texture scale (16-bit unsigned fraction)
levels(maximum number of mip-map levels) - 1
tilewhich tile in the TMEM
onG_ON or G_OFF

As explained previously, a vertex's s and t coordinates are texel-space coordinates in a S10.5 format. The texture coordinate usually ranges from 0 to (texel_size - 1), possibly larger to implement "wrapped" textures. The maximum number of times that a texture may be wrapped is limited by the number of integer bits in this coordinate.

Since the s and t coordinate texture scale parameters are only fractional numbers, they cannot represent values >= 1.0. For non-scaled textures, applications typically use a vertex texture coordinate format of S9.6, and a scale value of 0.5 (0x8000 in 16-bit unsigned format).

The levels parameter tells the pipeline the maximum number of mipmap levels to use, if mip-mapping is enabled.

The tile parameter tells the pipeline which of the 8 possible tiles in the RCP texture memory to use when texturing the following primitives.

The on parameter turns texturing on or off in the RSP. If texturing is turned off in the RSP, textured primitives will not be generated, regardless of the RDP state.

Likewise, setting the RSP state is necessary, but not sufficient to generate textured primitives. The RDP state must also be set in the appropriate manner, please see Section 12.4 "TX:Texture Engine."

Texturing is sensitive to large numbers and overflows. Please refer to Section 11.3.4, "Note on Coordinate Systems and Big Numbers" for notes on how to avoid texturing problems such as textures shifting across surfaces, textures tearing, and edges between polygons becoming visible in the texture.

UP