tg-clr-persp

Description

The Graphics Processor's vertex color interpolation is not perspective-correct. However, the texture coordinate interpolation is perspective-correct. This demo shows how use the texture coordinate rasterizer to perform vertex color rasterization using the color texgen hardware.

Figure 1: Using the default color rasterization

Figure 2: Using texgen to rasterize vertex colors with texture unit.

Figure 2 illustrates the algorithm used to interpolate vertex colors using the texture unit. The color texgen hardware can convert the output of the color channels into texture coordinates. Red is used as s, and green is used as t. The resulting colors are then looked up with an identity ramp texture. Because the color texgen unit only converts the red and green channels, the blue and alpha channels need to be done in another texgen. * Please note that the BA vertex color information must be piped through the red and green channels.

Advantages:

Disadvantages:

For perspective-correct RGBA from lighting with vertex-color input:

Optimizations:

Operation Method

Snapshot

Mode 1

Mode 2

Mode 3

Required Data Files

$REVOLUTION_SDK_ROOT/dvddata/gxTests/tg-pc.tpl

Revision History

03/01/2006 Initial version.