GXSetTevColorIn

C Specification

#include <revolution/gx.h>
void GXSetTevColorIn(
    GXTevStageID   stage,
    GXTevColorArg  a,
    GXTevColorArg  b,
    GXTevColorArg  c,
    GXTevColorArg  d );

Arguments

stage the TEV stage name
Accepted values are: GX_TEVSTAGE0, GX_TEVSTAGE1, GX_TEVSTAGE2 through GX_TEVSTAGE15.
a an input color operand
An unsigned 8-bit value for the component. Accepted values are:
Name Input
GX_CC_C0 RGB color from the TEVREG0 register
GX_CC_C1 RGB color from the TEVREG1 register
GX_CC_C2 RGB color from the TEVREG2 register
GX_CC_CPREV RGB color from the TEVPREV register
GX_CC_A0 Alpha from the TEVREG0 register
GX_CC_A1 Alpha from the TEVREG1 register
GX_CC_A2 Alpha from the TEVREG2 register
GX_CC_APREV Alpha from the TEVPREV register
GX_CC_TEXC RGB color from the texture
GX_CC_TEXA Alpha from the texture
GX_CC_RASC RGB color from the rasterized vertex color
GX_CC_RASA Alpha from the rasterized vertex color
GX_CC_ONE 1.0 fixed
GX_CC_HALF 0.5 fixed
GX_CC_ZERO 0.0 fixed
GX_CC_KONST constant color input (see the GXSetTevKColorSel function)
b an input color operand
An unsigned 8-bit value for the component. Applicable values are as for a.
c an input color operand
An unsigned 8-bit value for the component. Applicable values are as for a.
d an input color operand
a 1-bit sign + a 10-bit value for the component. Applicable values are as for a.

Return Values

None.

Description

This function sets the input operands for the texture environment (TEV) color combiner unit. The input operands a, b, and c are RGB colors where each component is an unsigned 8-bit value (0 <= a,b,c <= 255). The d input operand is an RGB color where each component is a signed 10-bit input (-1024 <= d <= 1023)

In cases where the input operand is an alpha value (GX_CC_A0, GX_CC_A1, GX_CC_A2, GX_CC_APREV, GX_CC_TEXA and GX_CC_RASA), the alpha value is replicated across the three color channels (R=A, G=A, B=A).

The function implemented by this TEV stage is set with GXSetTevColorOp.

The output of this stage is directed by default to the GX_TEVPREV register (see GXInit), but may be set explicitly by GXSetTevColorOp.

The registers used to store the output of TEV stages can also be used as the GX_CC_C0, GX_CC_C1, GX_CC_C2 and GX_CC_CPREV inputs. You can program these registers with constant color values using GXSetTevColor or GXSetTevColorS10. Each register can store either an unsigned 8-bit number or a signed 10-bit number per component (RGB). If a signed 10-bit number is selected for the inputs a, b or c, it is truncated to 8 bits. No conversion is performed and the highest bits are discarded.

The input operands GX_CC_RASC and GX_CC_RASA are the result of per-vertex lighting equations. The input operands GX_CC_TEXC and GX_CC_TEXA are the texture inputs for this stage.

GXSetTevOrder associates a TEV stage with particular colors and textures.

See Also

GXSetTevOp
GXSetTevColorOp
GXSetTevAlphaIn
GXSetTevSwapMode
GXSetTevKColorSel

Revision History

2006/03/01 Initial version.


CONFIDENTIAL