Skip to main content

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:

  • Model uses a material when it draws.
  • ModelNode can reference a Model that 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.

CapabilityPages
Surface color and coverageBase color, opacity, double-sided surfaces
Metallic and rough surfacesMetallic, roughness
Self-emissionEmission, emissive strength
Surface detailNormal mapping, bump mapping, ambient occlusion
Light responseUnlit, specular, index of refraction
Layered and directional responseClearcoat, sheen, anisotropy, iridescence
Transmission and volumesTransmission, thickness and attenuation, dispersion
Translucency and scatteringDiffuse transmission, volume scattering, thin-wall scattering
Texture inputs and lightingCoordinates 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:
    • pbrMaterial
    • lambertMaterial
    • phongMaterial
    • gouraudMaterial
    • a possible future unlitMaterial
    • a possible future normalMaterial used 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:

MaterialSurface ModelRelative CostTypical Use
lambertMaterialDiffuse-only matte shading with no specular highlightsFastest of the lit stock materialsClean visualizations, extruded solids, and scenes where glossy highlights would add noise
phongMaterialSimple specular model with per-fragment lightingFastGeneral-purpose lit surfaces when you want readable highlights without full PBR complexity
gouraudMaterialSimple specular model with per-vertex lightingFaster than phongMaterial, but lower qualityLarge or simple meshes where lower cost matters more than highlight accuracy
pbrMaterialPhysically based material model with textures and richer surface responseMost expensive of the stock materialsAsset rendering, glTF materials, and scenes that need more realistic surface behavior

In practice:

  • choose lambertMaterial when you want a matte result and the cleanest visual output
  • choose phongMaterial when you want simple shiny highlights and solid default quality
  • choose gouraudMaterial when you want a cheaper approximation of Phong-style lighting
  • choose pbrMaterial when the scene or asset needs material textures and more realistic shading

All four stock material families also support unlit?: boolean when you want to keep the same material family on a model but skip lighting calculations.

Materials In The Binding Model​

In the current luma.gl convention:

  • group 0 holds model or draw-local engine state
  • group 2 holds scene-shared lighting and IBL state
  • group 3 holds 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.