Skip to main content

LightingEffect

The LightingEffect applies ambient, point and directional lighting to layers which support material property.

Constructor

new LightingEffect({light0, light1, light2, ...});

Parameters:

  • lights(object) - a collection of light sources. Keys can be any arbitrary name and values.

Members

Light Sources

ambientLight (AmbientLight, optional)

An AmbientLight source which illuminates all the objects equally.

  • Default: ambient light source with color = [255, 255, 255] and intensity = 1.0

directionalLights (DirectionalLight[], optional)

Array of DirectionalLight source which emits from a specific directions.

  • Default: two directional light sources
Light SourceColorIntensityDirection_shadow
1[255, 255, 255]1.0[-1, -3, -1]false
2[255, 255, 255]0.9[1, 8, -2.5]false
  • For rendering experimental shadow effect, _shadow prop of DirectionalLight must be set to true. The effect can be toggled on and off for a layer by setting layer's shadowEnabled prop.

pointLights (PointLight[], optional)

Array of PointLight source which emits from a point in all directions.

  • Default: []

Remarks

  • Only one ambient light is supported.
  • Point light position uses the same coordinate system as view state.

Source

/modules/core/src/effects/lighting/lighting-effect.ts