gSPSetGeometryMode

gSPSetGeometryMode [Macro]

Function

gSPSetGeometryMode

Sets the geometry pipeline modes enabled

Syntax

#include <ultra64.h>        /* gbi.h */
gSPSetGeometryMode(Gfx *gdl, u32 mode)
gsSPSetGeometryMode(         u32 mode)

Arguments

gdl
the display list pointer.
mode
the geometry pipeline mode:
G_SHADE (Calculate vertex color)
G_LIGHTING (Calculate lighting)
G_SHADING_SMOOTH (Gouraud shading)
G_ZBUFFER (Calculate Z buffer)
G_TEXTURE_GEN (Automatically generate texture s,t coordinates)
G_TEXTURE_GEN_LINEAR (Automatically generate texture s,t coordinates)
G_CULL_FRONT (Front-face culling)
G_CULL_BACK (Back-face culling)
G_CULL_BOTH (Front-face and back-face culling)
G_FOG (Generate vertex alpha coordinate fog parameters)
G_CLIPPING (Clipping)

Description

Sets the geometry pipeline modes for culling, lighting, specular highlights, reflection mapping, fog, etc. Use gSPClearGeometryMode to disable the modes.

Numerous specifications can be set for mode with a bit sum of the following flags:

G_SHADE
Enables calculation of vertex color for a triangle.
G_LIGHTING
Enables lighting calculations.
G_SHADING_SMOOTH
Enables Gouraud shading.
When this is not enabled, flat shading is used for the triangle, based on the color of one vertex (see gSP1Triangle). G_SHADE must be enabled to calculate vertex color.
G_ZBUFFER
Enables Z buffer calculations.
Other Z buffer-related parameters for the frame buffer must also be set.
G_TEXTURE_GEN
Enables automatic generation of the texture's s,t coordinates.
Spherical mapping based on the normal vector is used.
G_TEXTURE_GEN_LINEAR
Enables automatic generation of the texture's s,t coordinates.
G_CULL_FRONT
Enables front-face culling.
* This does not support F3DLX.Rej but it does support F3DLX2.Rej.
G_CULL_BACK
Enables back-face culling.
G_CULL_BOTH
Enables both back-face and front-face culling.
* This does not support F3DLX.Rej but it does support F3DLX2.Rej.
G_FOG
Enables generation of vertex alpha coordinate fog parameters.
G_CLIPPING
Enables clipping.
This mode is enabled in the initial state. When disabled, clipping is not performed (see the Comment section in gSPClearGeometryMode). This mode can only be used with F3DLX and F3DLX.NoN.

Note

Other elements which have their own commands also exist for the RSP rendering state. These involve changing the state with something more complicated than a single bit, or using other commands to optimize the RSP geometry engine.

See Also

gDPSetPrimColor, gSP1Triangle, gSPFogPosition, and gSPClearGeometryMode

Revision History

02/01/99 Completely rewritten.