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.5.1  Texture Filter State and Input/Output

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 the special case 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 1  gsSetTextureFilter(type)
Parameter Value
type G_TF_POINT
G_TF_AVERAGE
G_TF_BILERP

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 2  gsSetTextureConvert(mode)
Parameter Value
mode G_TF_CONV
G_TF_FILTCONV
G_TF_FILT

Table 3  gsSetConvert(k0,k1,k2,k3,k4,k5)
Parameter Value
k0, k1, k2 G_CV_K0, G_CV_K1, G_CV_K2
k3, k4, k5 G_CV_K3, G_CV_K4, G_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).

Copyright © 1999
Nintendo of America Inc. All Rights Reserved
Nintendo and N64 are registered trademarks of Nintendo
Last Updated January, 1999