Haze Files and the Haze Table

Haze files have a .haz extension and are located in the Textures directory. The files are 4096-byte color entry tables; each color is represented by a 1-byte index that indexes into a palette (.pal) file of the same name. A run of 16 colors chosen from the associated .pal file is defined for each of the colors in the .pal file. The color runs are designed to fade a color as smoothly as possible, from fully saturated color to gray.

The following table describes the byte-by-byte structure of a haze.

Byte Description
0–255 Palette number colors at full saturation, viewed at zero distance.
256–511 Palette number colors, viewed at 1x distance.
512–767 Palette number colors, viewed at 2x distance.
3840–4095 Palette number colors, viewed at 15x distance.

The haze file is loaded into a haze table. The haze table is located in the 2-D graphics driver segment. The  table and the associated haze table loaders only exist in 2-D drivers with hazing capabilities.

A palette file has "dim" colors that adjust in intensity depending on time of day. For example, the colors get very dark at night. The .pal file also includes bright colors that stay bright all the time and aren't adjusted for dusk and night effects. The haze table consists of entries that fade the saturated palette colors (top row on the 256 x 16 color rectangle) toward gray. It's important that the dim color columns only use index color values from other dim colors, and bright colors only use elements from bright colors. As a result, the dim colors will "darken" at night, while the bright colors will remain bright. Ultimately, the last row in the table must always be the same gray index color for all colors, bright and dim. This row is used at a distance where objects are completely faded out; if all colors in this row are not the same, the objects will be visible. This presents a problem for bright colors. To avoid this problem (as much as possible), use bright colors for the 15 top rows of each bright color column, and set the last color to dim gray.

In Flight Simulator, there are generally very few bright colors. The 12 standard bright colors are always available. Because there are so few bright colors to work with, a good workaround has been established: you can make the top 15 haze values in each bright color's column the fully saturated bright color and make the bottom color dim gray. Because bright colors are usually used for lights, this approach lets lights shine through the haze a bit better, and at a certain distance fade out (abruptly) altogether.

Note: When working with haze tables, take into consideration any colors that you've designated as bright colors using the FIXED_COLORS or NIGHT_COLOR_RANGE command. You can use these commands to create additional night colors for bright color hazing effects.