Atlaslog
Atlaslog / luma.gl / Tutorial / luma.gl and deck.gl
luma.gl · Tutorial

luma.gl and deck.gl

Quick answer

This tutorial positions luma.gl as the GPU abstraction beneath deck.gl and explains which layer owns which responsibility. It maps Deck and MapboxOverlay to layers such as ScatterplotLayer and GeoJsonLayer, then down to Device, Buffer, Model and RenderPipeline, and lists the v9 packages core, webgl, webgpu, shadertools and engine. It ends with criteria for writing luma.gl directly instead of a custom deck.gl layer. Readers can decide where their rendering code belongs.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
Key points
Example
import { luma } from '@luma.gl/core';
import { webgl2Adapter } from '@luma.gl/webgl';
import { Model, AnimationLoop } from '@luma.gl/engine';
const device = await luma.createDevice({
  type: 'webgl',
  adapters: [webgl2Adapter],
  createCanvasContext: { canvas }
});

const buffer = device.createBuffer(new Float32Array([
  -0.5, -0.5, 0,
   0.5, -0.5, 0,
   0.0,  0.5, 0
]));
const model = new Model(device, {
  vs: vertexShaderSource,
  fs: fragmentShaderSource,
  attributes: { positions: buffer },
  bufferLayout: [
    { name: 'positions', stepMode: 'vertex', format: 'float32x3' }
  ],
  vertexCount: 3,
  topology: 'triangle-list'
});
const loop = new AnimationLoop({
  device,
  onRender: function (props) {
    const pass = props.device.beginRenderPass({ clearColor: [0.05, 0.07, 0.1, 1] });
    model.draw(pass);
    pass.end();
  }
});

loop.start();
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). luma.gl and deck.gl. https://www.jingweizhi.com/en/lumagl/tutorials/luma-and-deck.html (accessed 2026-11-03).