gSPFogPosition.3p 1.76 KB
.TH gSPFogPosition 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
gSPFogPosition, gsSPFogPosition
\- specify fog thickness.
.SH C SPECIFICATION
.nf
\f3#include "gbi.h"

gSPFogPosition(Gfx *gdl, int min, int max)

gsSPFogPosition(int min, int max)
\fP
.fi
.SH PARAMETERS
.TP 10
.I *gdl
graphics display list pointer.
.TP
.I min
int from 0 to 1000. Specifies where fog begins. 0=begin at near plane,
1000=begin at far plane.  min will generaly be less than max.
.TP
.I max
int from 0 to 1000. Specifies where fog saturates. 0=saturate at near plane,
1000=saturate at far plane.  max will generally be set to 1000 so that images
fade out as they approach the far plane and get clipped.
.SH DESCRIPTION
Fog changes the color of objects based on their Z position.  Generally objects 
which are farther away (from the viewer) are blended with the "fog color" (see
.IR gDPSetFogColor (3P)
).  The farther the object, the closer the objects color gets to the fog color.
This effect can be used to make objects fade into the distance instead of 
being abruptly clipped away when they reach the far clipping plane.  To use 
this effect set the max parameter to 1000 which will cause the object to be
totally fogged out at the far plane.  The min parameter is used to set the 
distance at which the object begins to fade into the fog.  This can be the
front clipping plane (min=0) or partway between the front and back planes
(0<min<1000).

.SH EXAMPLE
To turn fog on:
.Ex

gDPSetCycleType(glistp++, G_CYC_2CYCLE);
gDPSetFogColor(glistp++, fog_red, fog_green, fog_blue, 0xff);
gDPSetRenderMode(glistp++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
gSPFogPosition(glistp++, 500, 1000);
gSPSetGeometry(glistp++, G_FOG);


.SH SEE ALSO
.IR gDPSetFogColor (3P),
.IR gDPSetRenderMode (3P)
.IR gDPSetCycleType (3P)