#include <revolution/gx.h>
void GXSetVtxAttrFmt(
GXVtxFmt vtxfmt,
GXAttr attr,
GXCompCnt cnt,
GXCompType type,
u8 frac)
vtxfmt |
Specifies the vertex format number | |||||||||||||||||
attr |
Specifies the attribute name. Specifiable values are: GX_VA_POS, GX_VA_NRM, GX_VA_NBT, GX_VA_CLR0, GX_VA_CLR1, GX_VA_TEX0, GX_VA_TEX1, GX_VA_TEX2, GX_VA_TEX3, GX_VA_TEX4, GX_VA_TEX5, GX_VA_TEX6, GX_VA_TEX7. |
|||||||||||||||||
cnt |
|
|||||||||||||||||
type |
|
|||||||||||||||||
frac |
Number of fractional bits of a fixed point number. Range is 0 <= frac <= 31. frac is ignored when a floating point number or color is used. |
None.
This function sets the attribute format (attr) for a single attribute in the vertex attribute format table (VAT). Each attribute format describes the data type, number of elements (cnt), and fixed point format (frac), if required. There are eight vertex formats available in the VAT. The vertex format describes the format of all attributes in a vertex. The application can pre-program all eight vertex formats, and then select one of the them during the actual drawing of geometry (See GXBegin).
Note: All vertices used to draw a particular graphics primitive will have the same format. The vertex format set using GXSetVtxAttrFmt, along with the current vertex descriptor set using GXSetVtxDesc, completely define the vertex data format.
The vertex format allows data to be sent to the graphics processor in its most quantized format. The graphics hardware will inverse-quantize the data (into floating point format) before it's used. The vertex attribute format is used to communicate the data quantization format to the hardware.
Note: The GX_VA_NRM and GX_VA_NBT attributes share the same type. Also, the frac for these attributes is fixed according to the type. The component count, cnt, for GX_VA_NRM must be set to GX_NRM_XYZ. The component count for GX_VA_NBT must be set to GX_NRM_NBT.
GXSetVtxAttrFmtv
GXGetVtxAttrFmtv
GXSetVtxDescv
GXGetVtxDescv
GXSetVtxDesc
GXBegin
2006/03/01 Initial version.
CONFIDENTIAL