G3*_PolygonAttr


C Specification

#include <nitro/gx/g3imm.h>
#include <nitro/gx/g3b.h>
#include <nitro/gx/g3c.h>
void G3_PolygonAttr( int light, GXPolygonMode polyMode, GXCull cullMode, int polygonID, int alpha, int misc );
// Below are APIs for creating the display list (command list) void G3B_PolygonAttr(GXDLInfo* info, ...); void G3C_PolygonAttr(GXDLInfo* info, ...); void G3BS_PolygonAttr(GXDLInfo* info, ...); void G3CS_PolygonAttr(GXDLInfo* info, ...);

Description

This function sets the polygon attribute values.

GX_POLYGONMODE_MODULATE Modulation mode
GX_POLYGONMODE_DECAL Decal mode
GX_POLYGONMODE_TOON Toon shading/highlight shading mode
GX_POLYGONMODE_SHADOW Shadow polygon mode

GX_CULL_ALL Do not show on either plane
GX_CULL_FRONT Do not show front plane
GX_CULL_BACK Do not show back plane
GX_CULL_NONE Show both planes

GX_POLYGON_ATTR_MISC_NONE No specifications
GX_POLYGON_ATTR_MISC_XLU_DEPTH_UPDATE Update the depth buffer when rendering translucent polygons.
GX_POLYGON_ATTR_MISC_FAR_CLIPPING Clip if the polygon intersects the FAR plane (delete if intersects when not specified).
GX_POLYGON_ATTR_MISC_DISP_1DOT Show 1-dot polygons. See also G3X_SetDisp1DotDepth.
GX_POLYGON_ATTR_MISC_DEPTHTEST_DECAL Renders when the depth value of the fragment matches the depth value in the depth buffer. When not specified, renders when smaller than the depth value.
GX_POLYGON_ATTR_MISC_FOG The rendering engine performs fog blending.

The following indicate type definitions for GXPolygonMode, GXCull, and GXPolygonAttrMisc types.

typedef enum
{
    GX_POLYGONMODE_MODULATE = 0,
    GX_POLYGONMODE_DECAL = 1,
    GX_POLYGONMODE_TOON = 2,
    GX_POLYGONMODE_SHADOW = 3
}
GXPolygonMode;

typedef enum
{
    GX_CULL_ALL = 0,
    GX_CULL_FRONT = 1,
    GX_CULL_BACK = 2,
    GX_CULL_NONE = 3
}
GXCull;

typedef enum
{
    GX_POLYGON_ATTR_MISC_NONE = 0,
    GX_POLYGON_ATTR_MISC_XLU_DEPTH_UPDATE = 1 << REG_G3_POLYGON_ATTR_XL_SHIFT,
    GX_POLYGON_ATTR_MISC_FAR_CLIPPING = 1 << REG_G3_POLYGON_ATTR_FC_SHIFT,
    GX_POLYGON_ATTR_MISC_DISP_1DOT = 1 << REG_G3_POLYGON_ATTR_D1_SHIFT,
    GX_POLYGON_ATTR_MISC_DEPTHTEST_DECAL = 1 << REG_G3_POLYGON_ATTR_DT_SHIFT,
    GX_POLYGON_ATTR_MISC_FOG = 1 << REG_G3_POLYGON_ATTR_FE_SHIFT
}
GXPolygonAttrMisc;

Arguments

info Command list information
light 4-bit mask to specify the light to illuminate
polyMode Specifies polygon mode
cullMode Specifies the screen to cull
polygonID Specifies the polygon ID
alpha Specifies the α value
misc Bit field to specify other polygon attributes

Return Values

None

See Also

Revision History

01/19/2004 Initial Version