GXSetTevIndBumpST

Syntax

#include <revolution/gx.h>

void GXSetTevIndBumpST( GXTevStageID tev_stage, 
                        GXIndTexStageID ind_stage,
                        GXIndTexMtxID matrix_sel );

Arguments

tev_stage TEV stage to be set.
Applicable values are GX_TEVSTAGE0, GX_TEVSTAGE1, GX_TEVSTAGE2, ... , GX_TEVSTAGE13. This function sets three consecutive stages, so it cannot use GX_TEVSTAGE14 and GX_TEVSTAGE15.
ind_stage The indirect stage results used with this TEV stage.
Accepted values are: GX_INDTEXSTAGE0, GX_INDTEXSTAGE1, GX_INDTEXSTAGE2 and GX_INDTEXSTAGE3.
matrix_sel Specifies the indirect scale value for offset multiplication. Accepted values are:
Name Matrix Scale Value Used
GX_ITM_0 Matrix scale value 0.
GX_ITM_1 Matrix scale value 1.
GX_ITM_2 Matrix scale value 2.
This function cannot use any indirect matrices. Matrix scale values can only be used together with dynamic S/T matrices.

Return Values

None.

Description

This function sets an environment-mapped bump-mapped (EMBM) indirect lookup. The indirect map specifies offsets in the (S, T) coordinate space. This type of lookup requires three TEV stages to calculate. As a result of these calculations, a simple 2D bump map is properly oriented to the surface to which it is applied. Indirect maps are used to alter a normal-based texgen which is then used to look up an environment map. The environment map may be a simple light map, or a reflection map of the surrounding scenery.

When using this function, texture lookups should be disabled for the first two TEV stages. The third stage is where the texture lookup is actually performed. The associated geometry must supply normal/binormal/tangent coordinates at each vertex. Appropriate texgens must supply each of these to the proper stages. (Binormals are first, tangents are second, and normals are third.) Even when not using static indirect matrices, it is necessary to select the matrix slot, and set the scale value used for this lookup.

The following is an example for users wanting to learn more about this function.

GXSetTevIndBumpST(GX_TEVSTAGE0, GX_INDTEXSTAGE0, GX_ITM_0);

Performs the equivalent operations below:

{
  GXSetTevIndirect(
    GX_TEVSTAGE0, // tev stage
    GX_INDSTAGE0, // indirect stage
    GX_ITF_8,     // format
    GX_ITB_ST,    // bias
    GX_ITM_S0,    // matrix select (S matrix with scale 0)
    GX_ITW_0,     // wrap direct S
    GX_ITW_0,     // wrap direct T
    FALSE,        // add prev stage output?
    FALSE,        // use unmodified TC for LOD?
    GX_ITBA_OFF   // bump alpha select
  );
  GXSetTevIndirect(
    GX_TEVSTAGE1, // tev stage
    GX_INDSTAGE0, // indirect stage
    GX_ITF_8,     // format
    GX_ITB_ST,    // bias
    GX_ITM_T0,    // matrix select (T matrix with scale 0)
    GX_ITW_0,     // wrap direct S
    GX_ITW_0,     // wrap direct T
    TRUE,         // add prev stage output?
    FALSE,        // use unmodified TC for LOD?
    GX_ITBA_OFF   // bump alpha select
  );
  GXSetTevIndirect(
    GX_TEVSTAGE2, // tev stage
    GX_INDSTAGE0, // indirect stage
    GX_ITF_8,     // format
    GX_ITB_NONE,  // bias
    GX_ITM_OFF,   // matrix select
    GX_ITW_OFF,   // wrap direct S
    GX_ITW_OFF,   // wrap direct T
    TRUE,         // add prev stage output?
    FALSE,        // use unmodified TC for LOD?
    GX_ITBA_OFF   // bump alpha select
  );
}

The GXSetTevIndRepeat function can be used in subsequent TEV stages to reuse the calculated texture coordinates for additional lookups.

See Also

GXSetTevIndirect, GXSetTevIndRepeat

Revision History

2006/03/01 Initial version.


CONFIDENTIAL