Skip to content

Latest commit

 

History

History
59 lines (36 loc) · 2.35 KB

lighting-effect.md

File metadata and controls

59 lines (36 loc) · 2.35 KB

LightingEffect

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

<iframe height="450" width="100%" scrolling="no" title="deck.gl LightingEffect Demo" src="https://codepen.io/vis-gl/embed/ZZwrZz/?height=450&theme-id=light&default-tab=result" frameborder="no" allowtransparency="true" allowfullscreen="true"> See the Pen deck.gl LightingEffect Demo by vis.gl (@vis-gl) on CodePen. </iframe>

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 (Object, optional) {#ambientlight}

An AmbientLight source which illuminates all the objects equally.

  • Default: ambient light source with color = [255, 255, 255] and intensity = 1.0
directionalLights (Array, optional) {#directionallights}

Array of DirectionalLight source which emits from a specific directions.

  • Default: two directional light sources
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
  • 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 (Array, optional) {#pointlights}

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