GXSetTevOp

C Specification

#include <revolution/gx.h>
void GXSetTevOp( GXTevStageID id, GXTevMode mode );

Arguments

id TEV stage ID.
Accepted values are: GX_TEVSTAGE0, GX_TEVSTAGE1, GX_TEVSTAGE2, through 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. This macro calls GXSetTevColorIn, GXSetTevColorOp, GXSetTevAlphaIn, and GXSetTevAlphaOp with predefined arguments to implement familiar 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 previous stage, and Ct is the texture color. Av is the output alpha for a stage, Ar is the output alpha of previous stage, and At is the texture alpha. As a special case, rasterized color (GX_CC_RASC) is used as Cr and rasterized alpha (GX_CA_RASA) is used as Ar at the first TEV stage 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

2006/03/01 Initial version.


CONFIDENTIAL