Ninja Library - Special Effects Function

njSetFogDensity

Specifies the fog density

FORMAT

void njSetFogDensity( density )
Uint32 density

PARAMETER

 density  Value of fog density 

RETURN

None

DESCRIPTION

Specifies the fog density.

EXAMPLE

The following creates white fog from w = -1.f to -255.f.
NJS_FOG_TABLE fog;
njSetFogColor(0xffffffff);
njSetFogDensity(0xff07);
njGenerateFogTable(fog);
njSetFogTable(fog);
njFogEnable();
/* Drawing models etc. */
njFogDisable();

NOTE

It cannot be used with the fade feature against the same object. The fog density value is spedified as 16 bit: upper 8bit = mantissa; lower 8bit= exponent. Range for the fog is 1/w = 1/density...256/density. For example, when the fog reaches the value of w, 65536: density = 65536 = 0x8010, and the range for the fog is w=65536 to w=256. Fog color that is out of range is clumped .

REFERENCE

njSetFogColor()
njSetFogTable()
njGenerateFogTable()
njGenerateFogTable2()
njGenerateFogTable3()
njFogEnable()
njFogDisable()

njSetFogDensity
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999
 The example above only explains the flow of the fog feature, and therefore, it is not for actual use.