Click or drag to resize
DigitalRuneFog Class
Represents fog.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsFog

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class Fog : INamedObject

The Fog type exposes the following members.

Constructors
  NameDescription
Public methodFog
Initializes a new instance of the Fog class.
Top
Methods
  NameDescription
Public methodClone
Creates a new Fog that is a clone (deep copy) of the current instance.
Protected methodCloneCore
Makes the instance a clone (deep copy) of the specified Fog.
Protected methodCreateInstanceCore
When implemented in a derived class, creates a new instance of the Fog derived class.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetIntensity
Gets the fog intensity at the specified target position.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyColor0
Gets or sets the color of the fog at Height0.
Public propertyColor1
Gets or sets the color of the fog at Height1.
Public propertyDensity
Gets or sets the density of the fog at a height of 0.
Public propertyDensity0
Gets or sets the density of the fog at Height0.
Public propertyDensity1
Gets or sets the density of the fog at Height1.
Public propertyEnd
Gets or sets the distance from the camera where the fog reaches its full intensity.
Public propertyHeight0
Gets or sets the reference height for Color0 and Density0.
Public propertyHeight1
Gets or sets the reference height for Color1 and Density1.
Public propertyHeightFalloff
Gets or sets the height falloff.
Public propertyName
Gets or sets the name of the fog.
Public propertyScatteringSymmetry
Gets or sets the scattering symmetry constant.
Public propertyStart
Gets or sets the distance from the camera where the fog starts.
Top
Remarks

Fog can be used to define a height-based fog where the fog density increases/decreases with height. Height-based fog can be used to create thick layer of fog in a valley or on a dungeon floor. The fog is relative to the PoseWorld of a FogNode. That means, the height fog moves up/down when the FogNode moves up/down.

The fog density can be specified using either Density and HeightFalloff or Density0 and Density1. Density defines the fog density at height 0 and the HeightFalloff determines whether the fog density increases or decrease with height. Alternatively, the fog density can be set at two reference heights using Density0 and Density1. The properties are coupled: If Density or HeightFalloff are changed, Density0 and Density1 are updated automatically and vice versa. In practice, you will use either Density and HeightFalloff, or Density0 and Density1 to control the fog settings.

To disable the fog, simply set Density to 0. To create a height-independent fog, set HeightFalloff to 0.

The fog color can be specified using Color0 and Color1, where Color0 defines the fog color at a height of Height0, and Color1 defines the fog color at a height of Height1. Colors between Height0 and Height1 are interpolated.

The fog colors, Color0 and Color1, use premultiplied alpha. The alpha value is usually 1, but lower values can be used to reduce the overall fog intensity.

The properties Start and End define a ramp over which the fog fades in.

See Also