4 * There are two levels of support for FOG in the Creator3D series.
5 * Both involve a depth cue unit and 1 or 4 slope factors and scales
6 * for varying the pixel intensity.
8 * Chips prior to FFB2 only have a single set of such settings, FFB2
9 * and later have 4 settings.
11 * The basic depth cueing equation is:
13 * C_final = dcsf(z) * C_orig + (1 - dcsf(z)) * C_fog
15 * C_final -- The final color passed to blend unit or frame
16 * buffer (if blending is disabled).
18 * C_orig -- The color we start with, which comes either from
19 * the raster processor or cpu writes to the smart
20 * framebuffer aperture.
22 * C_fog -- This is the "fog" color, ie. the desired color
25 * dcsf(z) -- The depth cue scale as a function of Z.
27 * With pre-FFB2 chips there are four parameters to control the depth
28 * cue scaling. Here is a diagram:
33 * Sfront XXXXX---+---+
47 * dcsf(z) = Sback + ((Sfront - Sback) / (Zf - Zb)) * (Zb - z)
57 * With FFB2 and later, 3 more slope regions are provided, the first of
58 * them starts at the end of the region defined above and ends at a
59 * specified depth value, the next slop region starts there and ends
60 * at the next specified depth value, and so on. Each of the 3 slope
61 * regions also have scale and slope settings of their own.
63 * The C_fog color is programmed into the alpha blending unit color1
64 * and color2 registers as follows:
69 * If alpha blending is disabled, the bg factor is zero. Note that
70 * the alpha blending color registers specify each of the RGB values
71 * as 9 bit 1:8 signed numbers in the range -1.00 to 0.ff inclusive.
72 * (ie. 0x100 == -1.00 and 0x0ff == +0.ff)