Spotlight Class |
Namespace: DigitalRune.Graphics
The Spotlight type exposes the following members.
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 | |
---|---|---|
Attenuation |
Gets or sets the attenuation exponent for the distance attenuation.
| |
Color |
Gets or sets the RGB color of the light.
| |
CutoffAngle |
Gets or sets the cutoff (penumbra) angle.
| |
DiffuseIntensity |
Gets or sets the diffuse intensity of the light.
| |
FalloffAngle |
Gets or sets the falloff (umbra) angle.
| |
HdrScale |
Gets or sets the HDR scale of the light.
| |
Name |
Gets or sets the name of the light.
(Inherited from Light.) | |
Range |
Gets or sets the range of the light.
| |
Shape |
Gets (or sets) the shape of the light volume.
(Inherited from Light.) | |
SpecularIntensity |
Gets or sets the specular intensity of the light.
| |
Texture |
Gets or sets the texture which is projected by this spotlight.
|
Spotlights have color, intensity, position, direction and range. The light emitted from a spotlight is shaped like a cone. The light intensity is maximal at the center and diminishes towards the outside of the cone. This effect is called "spotlight falloff" (see below). The Spotlight object defines the light properties of a spotlight positioned at the origin (0, 0, 0) that shines in forward direction (0, 0, -1) - see Forward. A LightNode needs to be created to position and orient a spotlight within a 3D scene.
Color, DiffuseIntensity/SpecularIntensity, HdrScale, the spotlight falloff (see GetAngularAttenuation(Single, Single, Single)) and the light distance attenuation factor (see GetDistanceAttenuation(Single, Single, Single)) 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 spotlight can be created by setting DiffuseIntensity > 0 and SpecularIntensity = 0. A pure specular spotlight can be created by setting DiffuseIntensity = 0 and SpecularIntensity > 0.
Spotlight Falloff (Dual-Cone Model): The light emitted from a spotlight is made up of a bright inner cone and a larger outer cone. The amount of light emitted continually diminishes from the inner cone to the outer cone. The angle at which the light starts to fall off is defined as the FalloffAngle. The angle at which the light is cut off (light intensity is 0) is defined as the CutoffAngle. So the size of the inner cone is 2 · FalloffAngle and the size of the outer cone is 2 · CutoffAngle. See also GetAngularAttenuation(Single, Single, Single).
The Shape of a spotlight is a PerspectiveViewVolume. (A ConeShape would be a better fit, but the PerspectiveViewVolume was chosen because it is computationally more efficient.)
A 2D texture (see Texture) can be assigned to the spotlight. By default no texture is assigned. If a texture is set, the spotlight acts like a projector and projects this texture onto the lit surroundings.
Cloning: When the Spotlight is cloned the Texture is not duplicated. The Texture is copied by reference.