al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
gSPFogPositionSyntax#include <ultra64.h> /* gbi.h */ gSPFogPosition(Gfx *gdl, s32 min, s32 max) gsSPFogPosition(s32 min, s32 max)Arguments
Explanation
The fog effect is mainly used so objects don't suddenly "pop out" of view when they reach the far clipping plane and "pop into" view when they enter the clipping range. To use this effect, set max to 1000. As the object gets closer to the far plane it fades out with the fog color, becoming totally saturated with fog at the far plane. min sets the distance at which the object begins to fade into the fog. This can be set on the near clipping plane (min = 0) or between the near and far planes (0 < min < 1000). Generally, the min value is set smaller than the max value (but this is reversed when transparent fog is being used).
Note
Example Turn fog ON:
// Set the RDP cycle type. gDPSetCycleType(gdl++, G_CYC_2CYCLE); // Set the RDP fog color. gDPSetFogColor(gdl++, fog_red, fog_green, fog_blue, 0xff); // Set the blender (BL) rendering mode. gDPSetRenderMode(gdl++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2); // Specify the fog thickness. gSPFogPosition(gdl++, 500, 1000); // Set the geometry mode (fog creation ON). gSPSetGeometryMode(gdl++, G_FOG);
See also
Revision History
|