GXSetTevOp

Syntax

#include <revolution/gx.h>

void GXSetTevOp( GXTevStageID id, GXTevMode mode );

Arguments

id TEV stage ID. Accepted values are: GX_TEVSTAGE0, GX_TEVSTAGE1, GX_TEVSTAGE2, ... , GX_TEVSTAGE15.
mode Predefined color combining modes. The applicable values are GX_MODULATE, GX_DECAL, GX_REPLACE, GX_BLEND and GX_PASSCLR. (For further details,  see the table below.)

Return Values

None.

Description

This is a convenient function designed to make initial programming of the texture environment unit (TEV) easier. The macros call the GXSetTevColorIn, GXSetTevColorOp, GXSetTevAlphaIn and GXSetTevAlphaOp functions with predefined arguments to implement commonly used texture combining functions.

To enable a consecutive set of TEV stages, you must call the GXSetNumTevStages function.

In the table below, Cv is the output color for the stage, Cr is the output color of the previous stage, and Ct is the texture color. Av is the output alpha for the stage, Ar is the output alpha for the previous stage, and At is the texture alpha. As a special case, in the first TEV stage, the rasterized color (GX_CC_RASC) is used as Cr, and the rasterized alpha (GX_CA_RASA) is used as Ar. This is because there is no previous stage.

Mode Color Op Alpha Op
GX_MODULATE Cv=CrCt Av=ArAt
GX_DECAL Cv=(1 - At ) Cr + AtCt Av=Ar
GX_REPLACE Cv=Ct Av=At
GX_BLEND Cv=(1 - Ct ) Cr + Ct Av=AtAr
GX_PASSCLR Cv=Cr Av=Ar

See Also

TEV Configuration Guide, GXSetTevOrder, GXSetTevColorIn, GXSetTevColorOp, GXSetTevAlphaIn, GXSetTevAlphaOp

Revision History

2008/05/12 Changed old function names (GXSetTevStages) to new function names (GXSetNumTevStages).
2006/03/01 Initial version.


CONFIDENTIAL