EZwgl (12.12 Fog)

## 12.12 Fog

Fog uses the current blending factor to blends the current fog color with the current color and use the result to color the current vertex. Fog is enabled and disabled with `EZ_Enable(EZ_FOG)` and `EZ_Disable(EZ_FOG)`. It is disabled by default.

Blending factor is computed by one of the following equations, depending on the current `fogMode`.

`fogMode` | blending factor
`EZ_LINEAR` |
`EZ_EXP` |
`EZ_EXP2` |

where is the the z-coor of the vertex in the normalized screen space, `fogStart` `fogEnd` , `fogDensity` are state attributes.

If fog is enabled, the color of a vertex is computed using the formula

`void EZ_Fogfv(int attrName, float *values);`

This function sets the fog state attributes. Attribute is one of

    EZ_FOG_MODE, EZ_FOG_START, EZ_FOG_END,
    EZ_FOG_DENSITY, EZ_FOG_COLOR,EZ_FOG_INDEX+

If `attrName` is `EZ_FOG_MODE`, the attribute value must be one of `EZ_LINEAR`, `EZ_EXP` and `EZ_EXP2`. is `EZ_FOG_START` or `EZ_FOG_END`, the attribute value must be a floating point number in . If `attrName` is `EZ_FOG_INTENSITY`, the value must be a positive floating point number. If `attrName` is `EZ_FOG_COLOR`, the values must be RGB tripple, i.e., three floating point numbers in that specify the RGB intensity of the fog color.

HTML Documentation Maintainance:`Arturo Espinosa <arturo@nuclecu.unam.mx>`