Haze System Components
In Flight Simulator, the haze system controls the image fadeout at distance that's caused by fog and haze. A 4096-byte haze table contains 16 color entries for every color entry in the palette. These 16 colors represent a color run (of other colors in the palette) that fade color from fully saturated to gray and fade objects out at a distance.
The haze system consists of the following components:
-
Haze table—A 4096-byte table (256 color columns x 16 haze level rows). For each color in the 256-color palette, this table has 16 levels of color, from fully saturated color to gray, or fully hazed, for each color.
-
Visibility dialog box—A dialog box in the weather system (dweather.asm) that you can use to set a visibility value in global.asm. The value represents the visibility distance in miles (100=1 mile).
-
Visibility variables—Like all weather variables, there is one global and 2 local visibility values. Depending on what weather area you're working in (global, local1, local2, transition), these variables are blended into an average_visib value.
-
haze drivers—The 2-D driver uses the visibility variables to haze the visual window. In Flight Simulator's VGB driver, a routine called visibility_update_far is installed into the frame chain by the 2-D driver. In every frame, the new average_visib is interpreted and internal variables are set. The haze driver's line, polygon, and point drivers use these variables to accurately draw the hazed graphics.