#include <revolution/gx.h>
void GXSetFog(
GXFogType type,
f32 startz,
f32 endz,
f32 nearz,
f32 farz,
GXColor color );
type |
The types of fog functions. Accepted values are:
|
|||||||||||||||||||||||||||||||||||||||
startz |
The minimum Z value for which the fog function is active, in visual space coordinates. | |||||||||||||||||||||||||||||||||||||||
endz |
The maximum Z value for which the fog function is active, in visual space coordinates. | |||||||||||||||||||||||||||||||||||||||
nearz |
The near plane (should match the projection matrix parameters). | |||||||||||||||||||||||||||||||||||||||
farz |
The far plane (must match the projection matrix parameters). farz must be greater than nearz. |
|||||||||||||||||||||||||||||||||||||||
color |
Fog color, in RGBX format (alpha is not used). |
None.
This function enables fog. Using type, the programmer may select one of several functions (see the table below) to control fog density as a function of range to a quad (2x2 pixels). The range is a cosine-corrected Z value in the XZ plane (visual coordinates), but is not corrected in the Y direction. Please refer to the GXSetFogRangeAdj function.
The parameters startz and endz allow further control over fog behavior. The arguments nearz and farz should be set consistently with the projection matrix arguments. Note that these parameters are defined in visual space.
The fog color (in RGBX format; the alpha component is ignored) is set using the color parameter. This will be the color of the pixel when fully fogged.
GXInit disables fog by default.
| Linear | Exponential | Exponential Squared |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
F: fog density [0,1] |
Inverse Exponential |
Inverse Exponential Squared |
![]() |
![]() |
|
![]() |
![]() |
GXSetFogRangeAdj
GXSetFogColor
03/01/2006 Initial version.