12.5 TF - Texture Filter

Texture filter takes the four texels generated by TX and produces a simple bilinear-filtered texel. The TF can also work together with the color combiner (please see Section 12.6, "CC - Color Combiner" to perform YUV-to-RGB color space conversion).

Figure 12-8 Texture Filter State and Input/Output
[Figure 12-8]

UP


12.5.1 Filter Types

TF performs three types of filter operations: point sampling, box filter, and bilinear interpolation. Point sampling just selects the nearest texel to the screen pixel. In special cases where the screen pixel is always the center of four texels, the box filter can be used. In a typical 3D, arbitrarily rotated polygon, the bilinear filter is the best choice available.

Note: For hardware cost reduction, the RDP does not implement a true bilinear filter. Instead, the three nearest texels are linearly interpolated to produce the result pixels. This has a natural triangulation bias. This artifact is not noticeable in normal texture images. However, in regular pattern images, it can be noticed. For example, notches can be seen in the crosshair on a image of grids. This can be eliminated by prefiltering the image with a wider filter.

Table 12-18 gsSetTextureFilter(type)
ParameterValues
typeG_TF_POINT
G_TF_AVERAGE
G_TF_BILERP

UP


12.5.2 Color Space Conversion

Color space conversion can be used to convert YUV textures into RGB. This could be a useful compression technique, or it could be used for MPEG video, or for special effects.

Table 12-19 gsSetTextureConvert(mode)
ParameterValues
modeG_TF_CONV
G_TF_FILTCONV
G_TF_FILT

Table 12-20 gsSetConvert(k0,k1,k2,k3,k4,k5)
ParameterValues
k0, k1, k2G_CV_K0, G_CV_K1, G_CV_K2
k3, k4, k5G_CV_K3, G_CV_K4, C_CV_K5

Note: The default state of the RDP is G_TF_CONV (perform YUV2RGB), which is probably not what you want (if you are using RGB textures). A common bug is to forget to set this (usually it should be G_TF_FILT).

UP