-api-id | -api-type |
---|---|
T:Windows.UI.Composition.DistantLight |
winrt class |
An infinitely large distant light source that emits light in a single direction. For example, a distant light could be used to represent sunlight.
DistantLights and SpotLights support direction.
DistantLight is one of the four light types derived from CompositionLight.
Light | Description |
---|---|
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).
Windows version | SDK version | Value added |
---|---|---|
1709 | 16299 | Intensity |
_distantLight = _compositor.CreateDistantLight();
_distantLight.Color = Colors.Yellow;
_distantLight.Direction = new Vector3(0,-1, 0);
_distantLight.CoordinateSpace = root;
_distantLight.Targets.Add(root);
CompositionLight, CompositionLight.Targets, Compositor.CreateDistantLight