#include <revolution/gx.h>
void GXSetTevOrder(
GXTevStageID stage,
GXTexCoordID coord,
GXTexMapID map,
GXChannelID color
);
stage |
Tev stage ID. Accepted values are: GX_TEVSTAGE0, GX_TEVSTAGE1, GX_TEVSTAGE2 through GX_TEVSTAGE15. |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
coord |
Texture coordinates ID. Applicable values are GX_TEXCOORD_NULL, GX_TEXCOORD0, GX_TEXCOORD1, GX_TEXCOORD2 through GX_TEXCOORD7. |
||||||||||||||
| map | Texture map ID. Applicable values are GX_TEXMAP_NULL, GX_TEXMAP0, GX_TEXMAP1, GX_TEXMAP2 through GX_TEXMAP7. The bitwise OR of GX_TEX_DISABLE and GX_TEXMAP* can be used to perform coordinate scaling without a texture lookup. |
||||||||||||||
color |
Color channel. Accepted values are:
GX_ALPHA_BUMP nor GX_ALPHA_BUMPN can be used with GX_TEVSTAGE0. |
None.
This function specifies the texture and rasterized color that will be available as inputs to this TEV stage. The texture coordinate coord is generated from input attributes used in the GXSetTexCoordGen function, and is used to look up the texture map, previously loaded by the GXLoadTexObj function.
Be aware that this function does not make TEV stages available. Use the GXSetNumTevStages function to make available the series of TEV stages beginning with stage GX_TEVSTAGE0.
The processes for each TEV stage are independent. Color processing is controlled by the GXSetTevColorIn and GXSetTevColorOp functions. Alpha processing is controlled by the GXSetTevAlphaIn and GXSetTevAlphaOp functions.
All of the texture coordinate numbers that can be used in active TEV stages are set using the GXSetNumTexGens function. All of the color channel numbers that can be used in active TEV stages are set using the GXSetNumChans function. Active TEV stages should not reference texture coordinates and colors beyond those that were generated.
Using the GXSetTevOrder function, it is possible to broadcast a single texture coordinate to many textures as long as the textures are the same size.
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP1, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD0, GX_TEXMAP2, GX_COLOR1A1);
GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);Any TEV stage can use any generated texture coordinates.
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD3, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD2, GX_TEXMAP1, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD1, GX_TEXMAP2, GX_COLOR1A1);
GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);If textures are not to be used in the TEV stage, set coord and map to NULL.
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD2, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD1, GX_TEXMAP2, GX_COLOR1A1);
GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);If colors are not to be used in the TEV stage, set color to NULL.
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD3, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD2, GX_TEXMAP1, GX_COLOR_NULL);
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD1, GX_TEXMAP2, GX_COLOR1A1);
GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);The GXSetTevOrder function will, within its calls, scale the formalized texture coordinates generated in the GXSetTexCoordGen function, to suit the size of the texture map. As a result, texture coordinates can be broadcast to multiple texture maps when the map sizes are identical. There may be times when it is desirable to generate texture coordinates within a certain scale without performing a texture lookup (which would occur when generate texture coordinates for indirect texture bump mapping). To affect this. use the GX_TEXMAP_DISABLE flag.
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP3 | GX_TEXMAP_DISABLE, GX_COLOR_NULL);This uses GX_TEXMAP3 to scale GX_TEXCOORD0, but disables the lookup for GX_TEXMAP3.
There are some special settings for the argument color. When GX_COLOR_ZERO is specified, zero is always derived as a rasterized color. When GX_ALPHA_BUMP or GX_ALPHA_BUMPN is specified, the bump alpha from the indirect texture unit can be used as a rasterized color (for more on settings for bump alphas, see the GXSetTevIndirect function). A bump alpha only has five bits of data, so GX_ALPHA_BUMP will shift the upper bits. The resulting range of values is therefore from 0 to 248. GX_ALPHA_BUMPN, however, performs normalization, allowing for a range from 0 to 255.
The GXInit function records the default TEV state.
TEV Configuration Guide, GXSetNumTevStages, GXSetChanCtrl, GXLoadTexObj, GXSetTexCoordGen
2006/03/01 Initial version.
CONFIDENTIAL