The LightingEffect applies ambient, point and directional lighting to layers which support material property.
new LightingEffect({light0, light1, light2, ...});Parameters:
lights(Object) - a collection of light sources. Keys can be any arbitrary name and values.ambientLight (Object, optional)An AmbientLight source which illuminates all the objects equally.
[255, 255, 255] and intensity = 1.0directionalLights (Array, optional)Array of DirectionalLight source which emits from a specific directions.
| Light Source | Color | Intensity | Direction | _shadow |
|---|---|---|---|---|
| 1 | [255, 255, 255] | 1.0 | [-1, -3, -1] | false |
| 2 | [255, 255, 255] | 0.9 | [1, 8, -2.5] | false |
_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 (Array, optional)Array of PointLight source which emits from a point in all directions.
[]