Atlaslog
Atlaslog / deck.gl / API / DirectionalLight
deck.gl · API reference

DirectionalLight

Quick answer

Create a directional light source which emits from a specific direction.A directional light can be considered "infinitely" far away (like the Sun) and d.

Last verified 2026-11-03 · deck.gl 9.0 · Cite this page
Runnable examplesChinese noteAll API topics

Create a directional light source which emits from a specific direction.A directional light can be considered "infinitely" far away (like the Sun) and does not attenuate with distance. At most 5 directional lights can be supported.

Two spheres with directional light

Usage​

Create a directional light source with color, intensity and direction.

const directionalLight= new DirectionalLight({
color: [128, 128, 0],
intensity: 2.0,
direction: [0, -100, -100]
});

Methods​

constructor​

The constructor for the DirectionalLight class. Use this to create a new DirectionalLight.

const directionalLight = new DirectionalLight({color, intensity, direction});

Source​

/modules/core/src/effects/lighting/directional-light.ts

TutorialsAPI index
English reference text adapted from the official deck.gl documentation, © vis.gl contributors, licensed under MIT.
Original page: https://deck.gl/docs/api-reference/core/directional-light · Chinese note: /deckgl/api/directional-light.html
Cite this page

Atlaslog (2026). DirectionalLight. https://www.jingweizhi.com/en/deckgl/api/directional-light.html (accessed 2026-11-03).