Atlaslog
Atlaslog / luma.gl / API reference / Geometry
luma.gl · API reference

Geometry

Quick answer

In v9 Geometry is a CPU-only container: it stores typed attribute arrays, optional indices, topology and a derived buffer layout, and owns no GPU buffers. Construct it with new Geometry and hand it to a Model, which uploads the data. GPUGeometry represents buffers already resident on the device.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
new Geometry ( props ) → Geometry
Key points
Example
const geometry = new Geometry({
  topology: 'triangle-list',
  attributes: {
    positions: new Float32Array([
      -0.6, -0.45, 0,
       0.6, -0.45, 0,
       0.0,  0.55, 0
    ]),
    colors: new Float32Array([
      0.95, 0.36, 0.32,
      0.98, 0.78, 0.35,
      0.35, 0.80, 0.95
    ])
  },
  indices: new Uint16Array([0, 1, 2])
});

console.log(geometry.getVertexCount()); // 3
const model = new Model(device, {
  geometry: geometry,
  vs: vsSource,
  fs: fsSource
});

const pass = device.beginRenderPass({ clearColor: [0.04, 0.06, 0.09, 1] });
model.draw(pass);
pass.end();
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Geometry. https://www.jingweizhi.com/en/lumagl/api/geometry.html (accessed 2026-11-03).