Share via


RenderState.RangeFogEnable Property

Note

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)

Syntax

public bool RangeFogEnable { get; set; }

Property Value

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

Remarks

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.

See Also

Reference

RenderState Class
RenderState Members
FogStart
FogEnd
FogEnable
FogColor
FogDensity
FogVertexMode
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Windows XP SP2, Windows Vista