@luma.gl/engine
Overview​
@luma.gl/engine turns common rendering patterns into reusable classes. Geometry describes
CPU-side attributes, ShaderInputs manages shader-module values, and Model connects them to
Core resources, pipelines, bindings, and draw calls while tracking redraw needs.
Import the rendering API from @luma.gl/engine/api and scene nodes and controllers from @luma.gl/engine/scenegraph.
The generated Engine reference lists the exports from the rendering, materials, and scenegraph entry points with links to their source.
Explore the Materials reference for surface properties and inline examples.
Feature card​
When to use it​
Use Engine for most rendered applications. Drop to Core when you
need exact resource or command control. Use Shaders to
make shader behavior reusable. Add GPU Core only when work becomes a scheduled GPU dataflow;
a single Model does not need a graph.
Live example​
This portable example maps the Engine objects to the Core work they manage.
Core concepts​
- resourceA GPU object or logical value that work reads or writes, such as a buffer, texture, pipeline, or graph allocation.
- A GPU object or logical value that work reads or writes, such as a buffer, texture, pipeline, or graph allocation.
- bindingThe connection that makes a buffer, texture, sampler, or uniform block available to shader code.
- The connection that makes a buffer, texture, sampler, or uniform block available to shader code.
- pipelineCompiled shader stages plus fixed GPU state used for rendering or compute work.
- Compiled shader stages plus fixed GPU state used for rendering or compute work.
- passA related sequence of render or compute commands recorded against a defined set of outputs.
- A related sequence of render or compute commands recorded against a defined set of outputs.
- redrawA request to render another frame because visible state changed; it is not necessarily a continuous loop.
- A request to render another frame because visible state changed; it is not necessarily a continuous loop.
- ownershipThe responsibility for destroying a GPU resource and deciding how long it remains valid.
- The responsibility for destroying a GPU resource and deciding how long it remains valid.
The learning spine is: geometry, shader inputs, models, redraw/frame lifecycle, dynamic resources, interaction and picking, scenegraphs, animation, compute helpers, and postprocessing. Engine objects wrap Core resources but do not make ownership disappear.
| Engine concept | Core work it manages |
|---|---|
| Geometry | Buffer data + BufferLayout |
| ShaderInputs | Bindings + uniform/storage buffers |
| Model | Shaders + RenderPipeline + VertexArray |
| model.draw(pass) | Pass bindings + draw command |
| needsRedraw() | Whether another submission is necessary |
Workflows​
- Learn the workflowBuild the mental model before choosing classes.
- Copy a focused recipeStart from a complete, small task.
- Check the complete APIConfirm exact types, defaults, and ownership.
The Engine cookbook covers rendering, updates, on-demand animation, picking and highlighting, scenes, and shader passes.
API index​
Reusable geometry, shader inputs, models, redraw state, interaction, animation, compute, and postprocessing.
- Geometry
- Shader inputs
- Model
- Redraw lifecycle
- Picking and scenes
- Animation, compute, and passes
The generated Engine API index is the exhaustive, source-linked inventory of every public value and TypeScript export. The curated pages explain how the related families fit together.
Limits and compatibility​
- Engine is portable where its underlying Core resources and shaders are portable.
- Provide WGSL and GLSL when the same application must run on WebGPU and WebGL.
- A redraw flag avoids unnecessary rendering only when the application honors it.
- Experimental helpers are labeled in their individual references and may have narrower backend support.
Related modules​
-
Use Core for direct resource and command control.
-
Use Shaders for modules, hooks, and plugins.
-
Use GPU Core for scheduled multi-stage GPU work.
-
Use directional contact shadows for short screen-space visibility refinement.
-
Use PBR surface prepasses for reusable camera depth and view-space normal textures.
-
Use PBR shadows to cast and receive shadows with standalone mesh models.
-
Use ShadowMapRenderer to record caller-owned shadow caster draws and share depth resources with receiver shaders.
-
Use standalone PBR models to render native or loaded meshes with explicit transforms and lighting.
-
Use PBR materials and environment bindings for shared physical materials and lighting resources.
-
Use PrefilteredEnvironment for reusable image-based lighting.
-
Use ClusteredLightGrid to build WebGPU light candidate lists. For choosing and combining environments, shadows, and AO, see the lighting effects guide.