Atlaslog
Atlaslog / deck.gl / Tutorial / Lighting and post-processing
deck.gl · Tutorial

Lighting and post-processing

Quick answer

This tutorial explains that deck.gl effects are part of the render pipeline, not CSS filters. It configures LightingEffect with AmbientLight and DirectionalLight, shows how material parameters ambient, diffuse, shininess and specularColor respond on an extruded HexagonLayer, and wraps a luma.gl BloomEffect in PostProcessEffect. Readers can light 3D geometries and add full-screen glow in the right order.

Last verified 2026-11-03 · deck.gl 9.0 · Cite this page
Key points
Example
var ambient = new deck.AmbientLight({
  color: [255, 255, 255],
  intensity: 1.2
});

var sun = new deck.DirectionalLight({
  color: [255, 240, 214],
  intensity: 1.8,
  direction: [-1.2, -3, -1.6]
});

var lighting = new deck.LightingEffect({
  ambientLight: ambient,
  dirLight: sun
});

var hexLayer = new deck.HexagonLayer({
  id: 'density-lit',
  data: stations,
  getPosition: function (d) { return [d.lng, d.lat]; },
  radius: 800,
  extruded: true,
  elevationScale: 14,
  material: {
    ambient: 0.45,
    diffuse: 0.7,
    shininess: 32,
    specularColor: [80, 90, 100]
  }
});

new deck.Deck({
  container: 'map',
  initialViewState: { longitude: 116.40, latitude: 39.93, zoom: 10.5, pitch: 50 },
  controller: true,
  effects: [lighting],
  layers: [hexLayer]
});
import { PostProcessEffect } from '@deck.gl/core';
import { BloomEffect } from '@luma.gl/effects';

var bloom = new PostProcessEffect({
  effect: new BloomEffect()
});

var deckgl = new deck.Deck({
  container: 'map',
  initialViewState: { longitude: 116.40, latitude: 39.93, zoom: 10.5 },
  controller: true,
  effects: [lighting, bloom],
  layers: layers
});
Notes
Runnable examplesChinese originalAll Tutorials
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Lighting and post-processing. https://www.jingweizhi.com/en/deckgl/tutorials/effects.html (accessed 2026-11-03).