DistantLight DistantLight DistantLight DistantLight Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
An infinitely large distant light source that emits light in a single direction. For example, a distant light could be used to represent sunlight.

public : sealed class DistantLight : CompositionLight, IDistantLight, IDistantLight2public sealed class DistantLight : CompositionLight, IDistantLight, IDistantLight2Public NotInheritable Class DistantLight Inherits CompositionLight Implements IDistantLight, IDistantLight2// This API is not available in Javascript.
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Inherited Members

Inherited methods

Inherited properties

Examples


_distantLight = _compositor.CreateDistantLight(); 
_distantLight.Color = Colors.Yellow; 
_distantLight.Direction = new Vector3(0,-1, 0) 
_distantLight.CoordinateSpace = root; 
_distantLight.Targets.Add(root); 

Remarks

DistantLight s and SpotLight s support direction.

DistantLight is one of the four light types derived from CompositionLight.

LightDescription
AmbientLight A light source that emits non directional light that appears to have been reflected by everything in the scene.
DistantLight An infinitely large distant light source that emits light in a single direction.
PointLight A point source of light that emits light in all directions.
SpotLight A light source that emits inner and outer cones of light.
Note

A Visual cannot be targeted by more than two non-ambient lights (PointLight, SpotLight or DistantLight).

Properties

Color Color Color Color

Color of the emitted DistantLight.

public : Color Color { get; set; }public Color Color { get; set; }Public ReadWrite Property Color As Color// This API is not available in Javascript.
Value
Color Color Color Color

Color of the emitted DistantLight.

CoordinateSpace CoordinateSpace CoordinateSpace CoordinateSpace

The Visual used to determine the light’s direction. The light's Direction property is relative to this Visual’s coordinate space.

**CoordinateSpace**

is a required property. If CoordinateSpace is not set, the DistantLight will not render.

public : Visual CoordinateSpace { get; set; }public Visual CoordinateSpace { get; set; }Public ReadWrite Property CoordinateSpace As Visual// This API is not available in Javascript.
Value
Visual Visual Visual Visual

The Visual used to determine the light’s direction. The light's Direction property is relative to this Visual’s coordinate space.

Remarks

DistantLight.Direction is relative to DistantLight.CoordinateSpace. Every Visual has an implicit 3D coordinate space, defined in this way:

X-axis runs from the left edge to the right edge of the visual.  Y-axis runs from the top of the visual to the bottom.  Z-axis is perpandicular to the visual.

X direction is from left to right. Y direction is from top to bottom. Z direction is point out of the plane. The original point of this coordinate is the upper-left corner of the visual, and the unit is DIP. A light’s offset and direction are defined in this coordinate space.

See Also

Direction Direction Direction Direction

The direction in which the light is pointing, specified relative to its CoordinateSpace Visual.

public : Vector3 Direction { get; set; }public Vector3 Direction { get; set; }Public ReadWrite Property Direction As Vector3// This API is not available in Javascript.
Value
Vector3 Vector3 Vector3 Vector3

The direction in which the light is cast.

Remarks

DistantLight.Direction is relative to DistantLight.CoordinateSpace

See Also

Intensity Intensity Intensity Intensity

Prerelease. Gets or sets the intensity of the light.

public : float Intensity { get; set; }public float Intensity { get; set; }Public ReadWrite Property Intensity As float// This API is not available in Javascript.
Value
float float float float

The intensity of the light.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

See Also