#include <revolution/gx.h>
void GXSetTevIndBumpXYZ( GXTevStageID tev_stage,
GXIndTexStageID ind_stage,
GXIndTexMtxID matrix_sel );
| tev_stage | TEV stage to be set. Accepted values are: GX_TEVSTAGE0, GX_TEVSTAGE1, GX_TEVSTAGE2, ... , 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 offset and the indirect matrix and scale value for multiplication. Accepted values are:
|
None.
This function sets up an environment-mapped and bump-mapped indirect lookup. The indirect map specifies offsets in object (X, Y, Z) space. This kind of lookup requires only one TEV stage to calculate. However, the bump map (indirect map) is geometry-specific. Thus there is a space/calculation tradeoff between using this function and using the GXSetTevIndBumpST function.
The indirect matrix must be loaded with a transformation for normals from object space to texture space (similar to visible space, but with a possibly inverted Y axis). The surface geometry need only provide regular normals at each vertex. A normal-based texgen must be set up for regular texture coordinates.
Note: In fact, it is possible to perform this kind of bump mapping without providing vertex normals. Doing so requires centering the environment map around (0, 0) (wrapping below 0) instead of around the texture map's center. Also, the bump map must be loaded with actual normals instead of normal offsets. Regular texture coordinates must not be used. This can be done with a position-based texgen and a zero matrix. It is also possible to use the GXSetTevIndirect function (in place of the GXSetTevIndBumpXYZ function) and wrap the regular texture coordinates to zero.
The following is an example for users wanting to learn more about this function.
GXSetTevIndBumpXYZ(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_STU, // bias
GX_ITM_0, // matrix select (matrix 0 with scale 0)
GX_ITW_OFF, // wrap direct S
GX_ITW_OFF, // wrap direct T
FALSE, // add prev stage output?
FALSE, // use unmodified TC for LOD?
GX_ITBA_OFF // bump alpha select
);
}
2006/03/01 Initial version.
CONFIDENTIAL