DirectionalLight Class |
Namespace: DigitalRune.Graphics
The DirectionalLight type exposes the following members.
Name | Description | |
---|---|---|
DirectionalLight |
Initializes a new instance of the DirectionalLight class.
|
Name | Description | |
---|---|---|
Clone |
Creates a new Light that is a clone (deep copy) of the current instance.
(Inherited from Light.) | |
CloneCore |
Makes the instance a clone (deep copy) of the specified Light.
(Overrides LightCloneCore(Light).) | |
CreateInstanceCore |
When implemented in a derived class, creates a new instance of the
Light derived class.
(Overrides LightCreateInstanceCore.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetIntensity |
Gets the (approximated) light intensity at the given distance.
(Overrides LightGetIntensity(Single).) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Color |
Gets or sets the RGB color of the light.
| |
DiffuseIntensity |
Gets or sets the diffuse intensity of the light.
| |
HdrScale |
Gets or sets the HDR scale of the light.
| |
Name |
Gets or sets the name of the light.
(Inherited from Light.) | |
Shape |
Gets or sets the shape of the light volume.
| |
SpecularIntensity |
Gets or sets the specular intensity of the light.
| |
Texture |
Gets or sets the texture which is projected by this directional light.
| |
TextureOffset |
Gets or sets the texture offset.
| |
TextureScale |
Gets or sets the texture scale.
|
Directional lights have color, intensity, and direction - but no position or range. They emit light in the form of parallel rays. Directional lights can be used to model light sources which are positioned at infinite distance, such as the sun.
The DirectionalLight object defines the light properties of a directional light that shines in forward direction (0, 0, -1) - see Forward. A LightNode needs to be created to orient a light within a 3D scene.
Color, DiffuseIntensity/SpecularIntensity, and HdrScale are multiplied to get the final diffuse and specular light intensities which can be used in the lighting equations.
When using a low dynamic range lighting (LDR lighting) the light intensities are
When using a high dynamic range lighting (HDR lighting) the light intensities are
A pure diffuse light can be created by setting DiffuseIntensity > 0 and SpecularIntensity = 0. A pure specular light can be created by setting DiffuseIntensity = 0 and SpecularIntensity > 0.
The default Shape of a directional light is an InfiniteShape which covers the whole game world. It is allowed to set a different shape to create a local light.
A 2D texture (see Texture) can be assigned to the directional light. By default no texture is assigned. If a texture is set, the directional light projects the texture onto the lit surroundings (using texture wrapping to get an "infinite" texture). TextureOffset and TextureScale can be used to change how the texture is projected.
Cloning: When the DirectionalLight is cloned the Texture is not duplicated. The Texture is copied by reference.