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 to use the texture coordinate rasterizer to perform vertex color rasterization with 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. The red component is used as S, and the green component 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:

Using the Demo

Snapshot

Mode 1

Mode 2

Mode 3

Required Data Files

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

Revision History

2006/03/01 Initial version.


CONFIDENTIAL