SceneLightingEffect SceneLightingEffect SceneLightingEffect SceneLightingEffect Class

Definition

Controls the reflective properties of a SpriteVisual. A SceneLightingEffect will overwrite CompositionLight defaults. It is used to control the reflective properties of a SpriteVisual. A NormalMap can be used as an input source but is not required.

public : sealed class SceneLightingEffect : IGraphicsEffect, IGraphicsEffectSource, ISceneLightingEffect, ISceneLightingEffect2public sealed class SceneLightingEffect : IGraphicsEffect, IGraphicsEffectSource, ISceneLightingEffect, ISceneLightingEffect2Public NotInheritable Class SceneLightingEffect Implements IGraphicsEffect, IGraphicsEffectSource, ISceneLightingEffect, ISceneLightingEffect2// This API is not available in Javascript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Examples


IGraphicsEffect graphicsEffect = new CompositeEffect() 
{ 
  Mode = CanvasComposite.Add, 
  Sources = 
  { 
    new CompositionEffectSourceParameter("ImageSource"), 
    new SceneLightingEffect() 
    { 
      Name = "Material",                                     
      AmbientAmount = 0, 
      DiffuseAmount = .75f, 
      SpecularAmount = 0, 
      SpecularShine = 20 
      NormalMapSource = new CompositionEffectSourceParameter("NormalMap"), 
    } 
  } 
}; 

Constructors

SceneLightingEffect() SceneLightingEffect() SceneLightingEffect() SceneLightingEffect()

Creates an instance of SceneLightingEffect.

public : SceneLightingEffect()public SceneLightingEffect()Public Sub New()// This API is not available in Javascript.

Properties

AmbientAmount AmbientAmount AmbientAmount AmbientAmount

The proportion of predefined AmbientLight used by the effect.

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

The proportion of predefined AmbientLight used by the effect. Values must be set between 0.0 and 1.0.

DiffuseAmount DiffuseAmount DiffuseAmount DiffuseAmount

Intensity of the diffuse light.

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

Intensity of the diffuse light.

Name Name Name Name

Name of the light.

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

Name of the light.

NormalMapSource NormalMapSource NormalMapSource NormalMapSource

The normal map for the effect.

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

Remarks

A normal map is used to assign normals to a target Visual. This creates an effect of a texture where a normal pointing towards the light will be brighter and a normal pointing away will be dimmer. If the NormalMapSource property is not set, the normal described by Vector3.UnitZ will be used.

ReflectanceModel ReflectanceModel ReflectanceModel ReflectanceModel

Gets or sets a value that indicates how the reflectance of a SceneLightingEffect is modeled.

public : SceneLightingEffectReflectanceModel ReflectanceModel { get; set; }public SceneLightingEffectReflectanceModel ReflectanceModel { get; set; }Public ReadWrite Property ReflectanceModel As SceneLightingEffectReflectanceModel// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

SpecularAmount SpecularAmount SpecularAmount SpecularAmount

Intensity of the specular light.

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

Intensity of the specular light.

SpecularShine SpecularShine SpecularShine SpecularShine

Specular power for the Blinn-Phong lighting model.

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

Specular power for the Blinn-Phong lighting model. Value must be set between 1.0 and 128. The default value is 16.

Remarks

The SpecularShine property provides the exponent for the specular term in the Phong lighting equation. A larger value corresponds to a more reflective surface. The value must be between 1.0 and 128.