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

RenderPipeline

Quick answer

RenderPipeline combines compiled Shader stages, a buffer layout and fixed render state into a drawable object. Create it with device.createRenderPipeline({vs, fs, bufferLayout, topology, parameters}); any state change requires a new pipeline. It replaces v8 Program and is usually wrapped by Model.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
device. createRenderPipeline ( props ) → RenderPipeline
Key points
Example
const vs = device.createShader({
  stage: 'vertex',
  source: [
    '#version 300 es',
    'in vec3 positions;',
    'void main() {',
    '  gl_Position = vec4(positions, 1.0);',
    '}'
  ].join('\n')
});

const fs = device.createShader({
  stage: 'fragment',
  source: [
    '#version 300 es',
    'precision highp float;',
    'out vec4 fragColor;',
    'void main() {',
    '  fragColor = vec4(0.35, 0.80, 0.62, 1.0);',
    '}'
  ].join('\n')
});

const pipeline = device.createRenderPipeline({
  vs: vs,
  fs: fs,
  topology: 'triangle-list',
  bufferLayout: [
    { name: 'positions', stepMode: 'vertex', format: 'float32x3' }
  ],
  parameters: {
    depthCompare: 'less-equal',
    depthWriteEnabled: true
  }
});
const vertexArray = device.createVertexArray({
  shaderLayout: pipeline.shaderLayout,
  bufferLayout: pipeline.bufferLayout
});

const slot = vertexArray.getBufferSlot('positions');
if (slot !== null) {
  vertexArray.setBuffer(slot, positions);
}

const pass = device.beginRenderPass({ clearColor: [0.05, 0.07, 0.1, 1] });
pass.setPipeline(pipeline);
pass.setVertexArray(vertexArray);
pass.draw({ vertexCount: 3 });
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). RenderPipeline. https://www.jingweizhi.com/en/lumagl/api/render-pipeline.html (accessed 2026-11-03).