RenderState.RangeFogEnable Property

This property is available only when developing for Windows.
Gets or sets enabling of range-based vertex fog. The default value is false.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public bool RangeFogEnable { get; set; }

Property Value

true if range-based vertex fog is enabled; false otherwise. If false, depth-based fog is used.

In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object in the scene. In range-based fog, all fog methods work as usual, except that they use range instead of depth in the computations.

Range is the correct factor to use for fog computations, but depth is commonly used instead because range is time-consuming to compute and depth is generally already available. Using depth to calculate fog has the undesirable effect of having the fogginess of peripheral objects change as the viewer's eye moves - in this case, the depth changes and the range remains constant.

Because no hardware currently supports per-pixel range-based fog, range correction is offered only for vertex fog.

Windows XP SP2, Windows Vista