#include <revolution/gx.h>
void GXSetTexCoordGen2(
GXTexCoordID dst_coord,
GXTexGenType func,
GXTexGenSrc src_param,
u32 mtx,
GXBool normalize,
u32 postmtx );
dst_coord |
name of the texture coordinate to be generated Accepted values are: GX_TEXCOORD0, GX_TEXCOORD1, GX_TEXCOORD2 through GX_TEXCOORD7. |
||||||||||
func |
feature used to generate texture coordinates Accepted values are:
|
||||||||||
src_param |
the name of source attributes used to generate texture coordinates
|
||||||||||
mtx |
|
||||||||||
normalize |
Specifies whether or not to normalize texture coordinates after conversion on the first path (GX_TG_MTX* only). |
||||||||||
postmtx |
Specifies the post conversion matrix for multiplying texture coordinates by (GX_TG_MTX* only).Specifiable values are: GX_PTTEXMTX0-19, GX_PTIDENTITY |
None.
This function is an expanded version of GXSetTexCoordGen which can specify options for generating texture coordinates.
The first four arguments are identical to those for GXSetTexCoordGen and function in the same way. Only the new arguments are reviewed here. All other requirements specified in GXSetTexCoordGen still apply for GXSetTexCoordGen2.
The new options apply only for ordinary texture coordinate generation, where the texgen type is either GX_TG_MTX2x4 or GX_TG_MTX3x4. They do not work for light-based texgens or emboss texgens.
The normalize argument allows the calculated texcoord to be normalized after the multiplication by mtx (the first-pass transformation). The following calculation is performed (where [Stn, Ttn, Qtn] is the texture coordinate after the first-pass transformation):

After the optional normalization step, the texcoord is then multiplied by the 3x4 matrix, postmtx. This matrix is referred to as the post-transform matrix (PTMatrix, below):

There are certain limitations when a vertex contains only position and one texture coordinate and the texgen type is GX_TG_MTX2x4. In this special performance case, normalization is not performed (even when specified). In addition, the value of Qtn is assumed to be 1.0, and Qt'n is not calculated.
This step results in a texture coordinate for the texture lookup.
The post-transform matrices are separate from the first-pass matrices. They are stored in a separate memory area in the same format as the first-pass matrices, except that all matrices have three rows.
GXSetNumTexGens
GXSetTexCoordGen
GXSetVtxDesc
GXSetTevOrder
03/01/2006 Initial version.