Materials
In luma.gl, a Material describes reusable surface state for one shading model
or material schema. A MaterialFactory defines that schema and creates
compatible Material instances that can be attached to Models or shared
across many ModelNodes in a scenegraph.
Materials are scenegraph-adjacent engine resources:
Modeluses a material when it draws.ModelNodecan reference aModelthat already has a material attached.- Material-owned bindings typically live in bind group
3.
For scenegraph-specific guidance, see the Scenegraph guide. For bind-group ownership, see the Bind Groups guide.
luma.gl owns the material implementations described here. The glTF converter maps authored factors, textures, and extensions onto those shared materials; retained ANARI scenes use the same PBR shader implementation.
Material capabilities​
Each capability page explains the native material inputs and includes an existing glTF asset example. Core material features are documented alongside advanced surface and volume effects.
| Capability | Pages |
|---|---|
| Surface color and coverage | Base color, opacity, double-sided surfaces |
| Metallic and rough surfaces | Metallic, roughness |
| Self-emission | Emission, emissive strength |
| Surface detail | Normal mapping, bump mapping, ambient occlusion |
| Light response | Unlit, specular, index of refraction |
| Layered and directional response | Clearcoat, sheen, anisotropy, iridescence |
| Transmission and volumes | Transmission, thickness and attenuation, dispersion |
| Translucency and scattering | Diffuse transmission, volume scattering, thin-wall scattering |
| Texture inputs and lighting | Coordinates and transforms, lightmaps, environment lighting |
See glTF material conversion for importer contracts and ANARI materials for retained parameters.
What Is a Material?​
A material describes how a surface responds to light and how its surface colors are produced. In practice that includes the surface's bidirectional reflectance distribution function (BRDF), material uniform values, and material-owned textures and samplers.
If a change primarily affects BRDF or surface color response, it belongs in material space. If a change primarily affects how primitives are rasterized, expanded, or derived from mesh topology, it is not just a material concern.
This distinction helps keep material APIs focused:
- Material-like concerns:
pbrMateriallambertMaterialphongMaterialgouraudMaterialunlitMaterial- a possible future
normalMaterialused for debugging or inspection
- Not-just-material concerns:
- wireframe rendering
- barycentric wireframe overlays
- line-topology rendering
- point or sprite expansion
- geometry-derived outline or edge rendering
Some visual modes combine both layers. For example, wireframe rendering often needs geometry or pipeline support in addition to shader logic, so it is usually better described as a rendering technique than as a traditional material.
Choosing A Stock Material​
The current built-in lighting materials target different tradeoffs:
| Material | Surface Model | Relative Cost | Typical Use |
|---|---|---|---|
unlitMaterial | Preserves supplied RGBA without lighting | No lighting dependencies or material uniforms | Raster imagery, diagrams, UI surfaces, and baked artwork |
lambertMaterial | Diffuse-only matte shading with no specular highlights | Fastest of the lit stock materials | Clean visualizations, extruded solids, and scenes where glossy highlights would add noise |
phongMaterial | Simple specular model with per-fragment lighting | Fast | General-purpose lit surfaces when you want readable highlights without full PBR complexity |
gouraudMaterial | Simple specular model with per-vertex lighting | Faster than phongMaterial, but lower quality | Large or simple meshes where lower cost matters more than highlight accuracy |
pbrMaterial | Physically based material model with textures and richer surface response | Most expensive of the stock materials | Asset rendering, glTF materials, and scenes that need more realistic surface behavior |
In practice:
- choose
unlitMaterialwhen colors must remain independent of lights and the camera - choose
lambertMaterialwhen you want a matte result and the cleanest visual output - choose
phongMaterialwhen you want simple shiny highlights and solid default quality - choose
gouraudMaterialwhen you want a cheaper approximation of Phong-style lighting - choose
pbrMaterialwhen the scene or asset needs material textures and more realistic shading
The four lit stock material families also support unlit?: boolean when you want
to keep the same material family on a model but skip lighting calculations.
Dedicated unlit shaders​
Add unlitMaterial to a Model's shader modules and call
unlitMaterial_getColor(surfaceColor) with RGBA in either WGSL or GLSL. It returns
that color unchanged. The application still owns texture sampling, color factors,
alpha blending, and output color-space conversion.
Unlike a lit material with {unlit: true}, the dedicated module includes no light
uniforms, material bindings, normal calculations, or lighting dependencies. This
reduces the shader/resource requirements for surfaces that are always unlit;
it does not promise a specific rendering speedup. Application-owned normal
attributes and varyings must be removed separately if unused.
Use the existing unlit flag when lighting needs to toggle without changing the
shader. Selecting the dedicated module instead requires a matching shader/pipeline
variant. Its common Phong/Gouraud evaluation functions support shader migration;
include only one material family at a time. Existing PBR and glTF unlit materials
continue to use their own flag and texture processing.
See the unlitMaterial reference
for shader signatures and the resource contract.
Materials In The Binding Model​
In the current luma.gl convention:
- group
0holds model or draw-local engine state - group
2holds scene-shared lighting and IBL state - group
3holds material state
That means a material is the natural owner of per-surface uniform buffers, textures, and samplers that can be reused across many draws, while scene-level state like lighting stays outside the material itself.
Explore engine features​
Learn each material aspect and rendering capability through its API and a live sample in the engine feature guide. glTF core and extension mappings are described within each feature page; the Materials section is organized by shading capability rather than source format.