#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 visible coordinates. | |||||||||||||||||||||||||||||||||||||||
| endz | The maximum Z value for which the fog function is active in visible coordinates. | |||||||||||||||||||||||||||||||||||||||
| nearz | The near plane (should match the projection matrix parameters). | |||||||||||||||||||||||||||||||||||||||
| farz | The far plane (should match the projection matrix parameters). farz must be larger 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 is set in RGBX format (where the alpha component is ignored) using the color parameter. This will be the color of the pixel when fully fogged.
The GXInit function disables fog by default.
| Linear | Exponential | Exponential Squared |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
F: Fog density [0, 1]s: startze: endzz: Pixel Z(range adjustment) |
Inverse Exponential | Inverse of Exponential Squared |
![]() |
![]() |
|
![]() |
![]() |
GXSetFogRangeAdj, GXSetFogColor
2006/03/01 Initial version.
CONFIDENTIAL