Introducing a new way to review your PRs.

Read the announcement

visgl / luma.gl

High-performance Toolkit for WebGL-based Data Visualization

View on GitHub

30 documents · Updated Nov 20, 2026

docs / rendering-lighting

Rendering lighting and PBR

The engine lighting system turns scene lights, baked illumination, environment maps, and material properties into physically based images. It combines direct-light visibility, image-based lighting, screen-space visibility, lightmap data, and several render passes around shared PBR models for WebGL and WebGPU scenes.

Lighting model

The lighting model separates light sources from the material response. Direct lights provide local illumination, an environment provides broad indirect illumination, and visibility passes reduce light where geometry blocks it. PBR models can enable only the resources needed for the current scene.

The main lighting inputs are:

  • Direct lights: Directional, spot, point, and other lighting modules supply direct terms. WebGPU scenes can also use a clustered list of point lights.
  • Environment lighting: Diffuse irradiance, roughness-filtered specular radiance, and a BRDF lookup texture support image-based lighting.
  • Material response: The shared PBR material maps base color, metallic-roughness, normals, emission, occlusion, alpha cutouts, and supported glTF material extensions.
  • Visibility: Shadow maps, contact shadows, and ambient occlusion attenuate selected direct or indirect terms.
  • Baked lighting: Lightmap passes store linear diffuse irradiance in UV space for later material sampling.

The data and visualization assets page places this system in the wider asset model. The glTF rendering features page explains how imported glTF material, light, environment, and lightmap data enter this shared path.

PBR materials and models

PBR, or physically based rendering, describes a surface with material values that aim to match how real surfaces reflect and transmit light. The engine keeps the material resource contract separate from the model draw contract so one material can be borrowed by visible, shadow, surface, or lightmap models.

Material response

The shared PBR material combines scalar factors and optional texture maps. Its feature set includes the core metallic-roughness response plus normal and bump detail, emission, occlusion, transmission, clearcoat, sheen, iridescence, anisotropy, diffuse transmission, and selected scattering controls. Texture presence selects the matching shader paths, while UV sets and transforms select where each map is read (modules/…/pbr-material.ts• L28-55, modules/…/pbr-material.ts• L57-190).

The engine exposes this material as a reusable PBR object. It derives map-enabled state from the bindings and keeps texture resources borrowed, which lets imported and hand-built scenes use the same shader material (modules/…/pbr-material.ts• L11-27, modules/…/pbr-material.ts• L29-57).

References: modules/…/pbr-material.ts• L28-55 modules/…/pbr-material.ts• L57-190 modules/…/pbr-material.ts• L11-27 modules/…/pbr-material.ts• L29-57

PBR model variants

The PBR model is the common geometry-to-surface path. It carries positions, normals, tangents, UV sets, colors, skinning, and instancing into a material evaluation, then selects optional visibility or diagnostic behavior through model features (modules/…/pbr-model.ts• L29-77, modules/…/pbr-model.ts• L89-164).

The same model family serves three related roles:

Model rolePurposeLighting behavior
Visible PBR modelProduces the final material color.Can receive shadow maps, contact shadows, and ambient occlusion.
Shadow modelRenders caster depth from a light view.Discards color output and keeps alpha cutouts consistent with the visible material.
Lightmap modelRenders geometry into atlas UV space.Produces diffuse irradiance rather than a final shaded color.

This shared model boundary keeps material cutouts, transforms, skinning, and instancing consistent across the passes. The shader systems and shadertools pages explain how these modules become backend shader programs (modules/…/pbr-model.ts• L439-523, modules/…/pbr-model.ts• L526-607).

References: modules/…/pbr-model.ts• L439-523 modules/…/pbr-model.ts• L526-607 modules/…/pbr-model.ts• L89-164

Environment processing

Environment processing converts an equirectangular HDR or LDR image into the textures that PBR image-based lighting needs. The result contains diffuse irradiance, a GGX-filtered specular cube with roughness mip levels, and a split-sum BRDF lookup texture (modules/…/prefiltered-environment.ts• L22-47, modules/…/prefiltered-environment.ts• L74-100).

The preparation flow renders every cube face and specular mip level, then exposes the generated textures as a single lighting environment. The PBR scene uses the diffuse cube for broad ambient reflection, the specular cube for roughness-dependent reflection, and the BRDF lookup to complete the view-dependent response (modules/…/prefiltered-environment.ts• L148-212, modules/…/ibl.ts• L7-20).

This diagram shows how one source image becomes the environment inputs used by PBR materials.

flowchart LR
  A[Equirectangular source] --> B[Environment integration]
  B --> C[Diffuse irradiance cube]
  B --> D[Specular roughness mip chain]
  B --> E[BRDF lookup]
  C --> F[PBR image-based lighting]
  D --> F
  E --> F
  F --> G[Material response]

An application can instead load precomputed cube faces and mip levels. The glTF environment adapter keeps those asynchronous textures separate until all uploads are ready, then resolves them into the same borrowed environment contract (modules/…/pbr-environment.ts• L18-40, modules/…/pbr-environment.ts• L41-93, modules/…/pbr-environment.ts• L138-155). Scene intensity and vertical-axis rotation change the use of the environment without changing its textures (modules/…/pbr-environment.ts• L7-20, modules/…/pbr-environment.ts• L44-54).

Reflection probes

A reflection probe captures the scene from one point and publishes a filtered cube for local specular image-based lighting. It captures six views, builds roughness levels from the sharp capture, and swaps the completed result only after the full refresh is ready (modules/…/reflection-probe.ts• L17-35, modules/…/reflection-probe.ts• L62-145, modules/…/reflection-probe.ts• L218-245).

The probe is WebGPU-only and can spread face work across frames or complete capture and filtering in one frame. A frame budget controls incremental work and can lower filtering samples when same-frame updates exceed the budget. View directions can prioritize faces that matter to current receivers (modules/…/reflection-probe.ts• L93-114, modules/…/reflection-probe.ts• L155-201, modules/…/reflection-probe.ts• L261-282).

References: modules/…/reflection-probe.ts• L17-35 modules/…/reflection-probe.ts• L62-145 modules/…/reflection-probe.ts• L155-245 modules/…/reflection-probe.ts• L261-282

References: modules/…/prefiltered-environment.ts• L22-47 modules/…/prefiltered-environment.ts• L74-100 modules/…/prefiltered-environment.ts• L148-212 modules/…/ibl.ts• L7-20 modules/…/pbr-environment.ts• L138-155

Light visibility

Visibility passes produce factors that the PBR material applies to light terms. Shadow maps represent occlusion from light-space depth, contact shadows recover small near-surface details in screen space, and ambient occlusion reduces indirect visibility near nearby geometry.

Shadow-map workflow

The shadow-map workflow renders scene casters from the light's view and returns depth textures plus the matrices and light data needed by receivers. Directional lights use cascades, spot lights use perspective views, and point lights use six cube faces. The renderer owns the depth resources and records application-supplied caster draws for WebGL2 or WebGPU (modules/…/shadow-map-renderer.ts• L125-148, modules/…/shadow-map-renderer.ts• L166-281).

Before each depth pass, an optional preparation callback can upload view-specific caster state. The renderer ends each pass but does not submit the device command encoder, so the application controls submission and must preserve distinct per-view state when several shadow views share a command buffer (modules/…/shadow-map-renderer.ts• L125-131, modules/…/shadow-map-renderer.ts• L293-347).

When a receiver samples the maps, the shadow shader chooses the matching light view and visibility test. It supports soft visibility through blocker and filter samples, normal bias, cascade blending, and distance fading. The PBR shadow module applies the result to directional, spot, and point direct-light slots (modules/…/shadow.ts• L180-264, modules/…/shadow.ts• L266-377, modules/…/pbr-shadow.ts• L21-60).

The frame-level order is:

  1. Resolve active shadow lights and camera ranges.
  2. Build directional, spot, or point light views.
  3. Draw shadow casters into the depth layers.
  4. Pass the depth resources and view data to PBR receivers.
  5. Apply visibility while evaluating direct light terms.

Shadow quality is a shared choice for map sizes, cascade count, blocker samples, filter samples, and contact-shadow resolution. Low, balanced, and cinematic settings trade cost for map detail and soft-shadow quality (modules/…/shadow-quality.ts• L5-49). Resource capacities and map sizes can be changed at run time; shape changes rebuild the owned depth resources (modules/…/shadow-map-renderer.ts• L150-164, modules/…/shadow-map-renderer.ts• L519-607).

References: modules/…/shadow-map-renderer.ts• L125-148 modules/…/shadow-map-renderer.ts• L150-281 modules/…/shadow-map-renderer.ts• L293-347 modules/…/shadow-map-renderer.ts• L519-607 modules/…/shadow.ts• L180-264 modules/…/shadow.ts• L266-377 modules/…/pbr-shadow.ts• L21-60 modules/…/shadow-quality.ts• L5-49

Contact shadows

Contact shadows are a screen-space visibility mask for the first directional light. They trace from the current camera depth and normal surfaces, apply a bilateral blur, and either return the mask for a later PBR draw or composite it into an image pass (modules/…/contact-shadow-pass.ts• L15-29, modules/…/contact-shadow-pass.ts• L31-70, modules/…/contact-shadow-composite.ts• L13-65).

The PBR contact module maps the mask to the receiver viewport and blends its strength with the directional visibility factor. It does not replace the light's shadow map; it supplies short-range detail where a light-space map can miss thin contact regions (modules/…/pbr-contact-shadow.ts• L8-18, modules/…/pbr-contact-shadow.ts• L42-60, modules/…/pbr-shadow.ts• L43-60).

References: modules/…/contact-shadow-pass.ts• L15-29 modules/…/contact-shadow-pass.ts• L31-70 modules/…/contact-shadow-composite.ts• L13-65 modules/…/pbr-contact-shadow.ts• L8-18 modules/…/pbr-contact-shadow.ts• L42-60

Ambient occlusion

Ambient occlusion estimates how much nearby geometry blocks ambient light in the current camera view. The engine supports SSAO and GTAO modes, renders at a configurable scale, and uses depth-aware blur before returning a visibility texture (modules/…/ambient-occlusion-pass.ts• L12-30, modules/…/ambient-occlusion-pass.ts• L37-80).

The PBR ambient-occlusion module samples that texture at the receiver pixel and writes the factor into the material's ambient visibility state. This affects indirect ambient response while leaving direct lighting and emission independent (modules/…/pbr-ambient-occlusion.ts• L8-19, modules/…/pbr-ambient-occlusion.ts• L42-60).

References: modules/…/ambient-occlusion-pass.ts• L12-30 modules/…/ambient-occlusion-pass.ts• L83-121 modules/…/pbr-ambient-occlusion.ts• L8-19 modules/…/pbr-ambient-occlusion.ts• L42-60

Clustered light grids

A clustered light grid divides the camera view into screen tiles and logarithmic depth slices. It lets a lighting pass find the point lights that may affect one pixel instead of testing every point light for every pixel.

The WebGPU grid rebuilds its lists each frame from view-space point-light spheres. A binning stage marks overlapping clusters, and a compaction stage writes stable light indices and per-cluster counts. The lighting consumer uses the same screen-and-depth index rule to read its cluster (modules/…/clustered-light-grid.ts• L40-78, modules/…/clustered-light-grid.ts• L177-221, modules/…/clustered-light-grid.ts• L6-16).

The grid has fixed capacities so the lighting loop has a predictable bound. Lights beyond the configured retained count for a cluster are not added to that cluster, and the feature is available only on WebGPU (modules/…/clustered-light-grid.ts• L21-23, modules/…/clustered-light-grid.ts• L99-113, modules/…/clustered-light-grid.ts• L393-431).

This diagram shows the per-frame relationship between light data, the grid, and a lighting lookup.

flowchart LR
  A[View-space point lights] --> B[Project light bounds]
  B --> C[Mark screen and depth clusters]
  C --> D[Compact light indices]
  D --> E[Pixel cluster lookup]
  E --> F[Evaluate nearby direct lights]

References: modules/…/clustered-light-grid.ts• L21-23 modules/…/clustered-light-grid.ts• L40-78 modules/…/clustered-light-grid.ts• L99-113 modules/…/clustered-light-grid.ts• L177-221 modules/…/clustered-light-grid.ts• L393-431 modules/…/clustered-light-grid.ts• L6-16

Lightmap baking

Lightmap baking precomputes diffuse irradiance in a mesh's atlas UV space. It is useful when static geometry needs stable indirect or direct illumination without evaluating all light sources at every final pixel.

Lightmap atlas

A lightmap atlas prepares independent CPU geometry and packs planar charts into a fixed texture area before the bake. It generates the selected UV set, reserves padded chart rectangles, records chart ownership for gutter work, and reports occupancy without allocating GPU resources or changing source geometry (modules/…/lightmap-atlas.ts• L43-57, modules/…/lightmap-atlas.ts• L58-105, modules/…/lightmap-atlas.ts• L168-254).

The atlas can join suitable coplanar triangle pairs into one chart. Its validation and debug data expose overlap, ownership, draw-range, and UV placement errors before a bake uses the atlas (modules/…/lightmap-atlas.ts• L125-166, modules/…/lightmap-atlas.ts• L257-347).

References: modules/…/lightmap-atlas.ts• L43-57 modules/…/lightmap-atlas.ts• L58-105 modules/…/lightmap-atlas.ts• L125-166 modules/…/lightmap-atlas.ts• L168-254 modules/…/lightmap-atlas.ts• L257-347

The bake model rasterizes each surface into its selected UV set and writes irradiance with a positive chart ID in alpha. The baker can accumulate multiple samples as an arithmetic mean, produce a preview, and copy a completed result into independent texture storage (modules/…/pbr-model.ts• L584-607, modules/…/lightmap-baker.ts• L15-23, modules/…/lightmap-baker.ts• L37-52, modules/…/lightmap-baker.ts• L128-205).

Chart IDs let the baker fill empty gutter texels from the correct neighboring chart. Optional dilation repeats this filter without spreading values across chart boundaries. The output stores linear irradiance, while a PBR material later applies its lightmap texture and intensity to the diffuse response (modules/…/lightmap-filter.ts• L6-17, modules/…/lightmap-filter.ts• L24-43, modules/…/pbr-material.ts• L127-142).

The bake path can include shadow visibility for the active direct lights. It does not provide specular environment illumination; that remains the responsibility of the PBR environment path (modules/…/lightmap.ts• L26-44, modules/…/pbr-model.ts• L587-601).

References: modules/…/lightmap-baker.ts• L15-23 modules/…/lightmap-baker.ts• L37-52 modules/…/lightmap-baker.ts• L128-205 modules/…/pbr-model.ts• L584-607 modules/…/lightmap.ts• L26-44 modules/…/lightmap-filter.ts• L24-43

Lightmap asset bindings

Imported lightmaps bind a texture to a primitive or material and can select UV0 or UV1. A node-level binding can replace the material binding for one primitive, and instanced atlas data composes its transform and intensity with the authored binding (modules/…/gltf-lightmap.ts• L15-39, modules/…/gltf-lightmap.ts• L61-91).

The resulting lightmap is diffuse irradiance. It multiplies the material's diffuse response but does not create specular reflections, so imported scenes may use a lightmap and an environment together (modules/…/gltf-lightmap.ts• L15-22, modules/…/pbr-environment.ts• L18-26).

References: modules/…/gltf-lightmap.ts• L15-39 modules/…/gltf-lightmap.ts• L61-91 modules/…/pbr-environment.ts• L18-26

Lightmap data exchange

Lightmap data has a portable CPU form for saving a bake and restoring it later. The form records the atlas size, the selected UV set, and linear irradiance as float32 RGBA values; alpha remains the chart-coverage channel (modules/…/lightmap-data.ts• L8-16).

The engine can read a float lightmap texture asynchronously, create an independent GPU texture from CPU data, or encode and decode the data with the compact LML1 binary format. The restored texture remains a lightmap bake result, so the same material path can consume freshly baked or loaded data (modules/…/lightmap-data.ts• L18-61, modules/…/lightmap-data.ts• L63-99, modules/…/lightmap-data.ts• L101-137).

References: modules/…/lightmap-data.ts• L8-16 modules/…/lightmap-data.ts• L18-61 modules/…/lightmap-data.ts• L63-99 modules/…/lightmap-data.ts• L101-137

Lightmap environment sampling

Lightmap environment sampling converts a linear RGB equirectangular environment into directional light samples for a bake. The fixed sample sequence spreads directions over the sphere and reads the matching environment texel, so a bake can approximate environment illumination through its normal direct-light path (modules/…/lightmap-environment.ts• L6-16, modules/…/lightmap-environment.ts• L18-69).

Each sample exposes both the direction from the surface toward the environment and a directional-light record. This lets the bake prepare shadow visibility for the sampled direction while keeping the baked result in the same linear diffuse irradiance contract (modules/…/lightmap-environment.ts• L8-15, modules/…/lightmap-environment.ts• L38-69).

References: modules/…/lightmap-environment.ts• L6-16 modules/…/lightmap-environment.ts• L18-69

Surface passes

The surface pass renders camera-space normals and depth into textures that screen-space lighting effects can share. It is a preparation pass rather than a complete scene traversal: the caller chooses which surface models to draw and owns the final command submission (modules/…/pbr-surface-pass.ts• L6-18, modules/…/pbr-surface-pass.ts• L26-35, modules/…/pbr-surface-pass.ts• L65-82).

The surface model encodes view-space normals in RGB and marks covered pixels in alpha. It can use geometric normals or material normal and bump maps, which keeps ambient occlusion and contact-shadow inputs aligned with the surface appearance selected by the PBR material (modules/…/pbr-surface.ts• L8-21, modules/…/pbr-surface.ts• L44-68, modules/…/pbr-model.ts• L526-537).

The surface textures feed both ambient occlusion and contact-shadow passes. Their depth and normal dimensions must match the camera view, so resize and camera-target changes are part of the same pass contract (modules/…/pbr-surface-pass.ts• L43-63, modules/…/ambient-occlusion-pass.ts• L83-103, modules/…/contact-shadow-pass.ts• L73-95).

References: modules/…/pbr-surface-pass.ts• L6-18 modules/…/pbr-surface-pass.ts• L26-35 modules/…/pbr-surface-pass.ts• L43-82 modules/…/pbr-surface.ts• L8-21 modules/…/pbr-surface.ts• L44-68 modules/…/pbr-model.ts• L526-537

Lighting frame flow

The lighting system joins precomputed resources, per-frame visibility work, and final material evaluation. The engine render loop explains the broader frame and submission lifecycle; this flow focuses on the lighting-specific work inside a frame.

This diagram shows how scene and lighting state moves through the main lighting stages.

flowchart TD
  A[Scene lights and camera] --> B[Shadow-map views]
  A --> C[Clustered point-light grid]
  D[Environment textures] --> H[PBR material evaluation]
  K[Reflection probe capture and filtering] --> D
  E[Surface depth and normals] --> F[Ambient occlusion]
  E --> G[Contact shadows]
  B --> H
  C --> H
  F --> H
  G --> H
  I[Lightmap texture] --> H
  J[PBR material and geometry] --> H
  H --> L[Final surface color]

The passes do not all run for every scene. A model enables the resources it receives, while environment and lightmap data remain optional inputs. This lets a simple PBR draw use only material and direct lighting, while a richer scene adds shadow, screen-space, clustered, baked, probe, and environment lighting as needed (modules/…/pbr-model.ts• L451-492, modules/…/index.ts• L16-125).

References: modules/…/pbr-model.ts• L451-492 modules/…/index.ts• L16-125 modules/…/shadow-map-renderer.ts• L166-279 modules/…/ambient-occlusion-pass.ts• L83-121 modules/…/contact-shadow-pass.ts• L73-99 modules/…/reflection-probe.ts• L147-245

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep PBR material map bindings, map-enabled uniforms, texture defines, and glTF material parsing aligned.
  • Keep environment cube face order, source color encoding, specular mip count, BRDF lookup convention, and scene environment uniforms aligned.
  • Keep reflection-probe face views, capture origin, cube targets, filtered mip levels, publication state, and frame-budget behavior aligned.
  • Keep surface-pass resolution and encoded normal/depth conventions aligned with ambient occlusion and contact-shadow inputs.
  • Keep shadow light capacities, cascade splits, array layers, view-projection matrices, samplers, and receiver light slots aligned.
  • Keep shadow quality settings aligned across shadow-map filtering and contact-shadow resolution and trace steps.
  • Keep clustered-grid dimensions, depth range, point-light record layout, capacity limits, and shader pixel lookup aligned.
  • Keep lightmap atlas chart IDs, padded rectangles, ownership data, UV-set meaning, world-space density, and baker gutter handling aligned.
  • Keep lightmap UV selection, chart IDs, linear irradiance meaning, gutter dilation, and glTF atlas transform order aligned.
  • Keep the lightmap data version, LML1 header, float32 channel order, UV-set meaning, and GPU upload format aligned.
  • Keep equirectangular environment row and longitude conventions aligned with the directional samples used for baking.
  • Keep the visible, shadow, surface, and lightmap PBR model variants aligned for alpha cutouts, skinning, instancing, and transforms.
  • Keep borrowed texture ownership clear when generated environments, probe results, lightmap results, glTF textures, and material bindings are replaced or destroyed.
  • Keep shadow caster preparation, per-view uniform state, render-pass ending, and application command submission aligned.

Important failure modes

TriggerConsequenceGuard
Environment textures use different devices or wrong cube/2D dimensionsPBR environment bindings are rejectedResolve all three textures into the documented environment contract before binding them
An HDR environment is prepared in an unsuitable unorm or sRGB output formatEnvironment radiance loses its linear high-range valuesUse a renderable and filterable linear floating-point format
A reflection probe publishes before all six faces and filtered mips are completeReceivers sample an incomplete or stale local environmentPublish only the completed back target and submit recorded work before the next update
Reflection-probe capture uses a non-WebGPU device or unsupported rgba16float targetsProbe creation failsCheck the device type and render/filter format capabilities before creating the probe
Surface depth and normal targets use different sizes or camerasScreen-space occlusion and contact masks sample the wrong pixelsResize together and pass same-camera targets to both effects
A shadow light count exceeds configured capacityShadow rendering rejects the frameMatch active light counts to renderer capacities
A caller reuses mutable per-view caster uniforms across recorded shadow passesEarlier shadow views can render with later view matricesPrepare distinct per-view state before each pass or use immutable recorded data
A receiver uses shadow maps without the matching matrices or samplersShadow shader inputs are incomplete or invalidUse the complete result returned by the shadow-map renderer
The application submits before all caster and shadow passes are recordedShadow textures or receiver commands are incompleteLet the renderer end its passes, then submit the device work at the application frame boundary
Clustered point lights exceed grid capacity or a cluster overflowsLights are rejected or omitted from a clusterSet capacities explicitly and treat the retained per-cluster count as bounded
Lightmap geometry lacks normals or the selected atlas UV setBake geometry cannot produce valid irradiance coordinatesValidate normals and UV0 or UV1 before creating the bake model
Lightmap atlas charts overlap, exceed the atlas, or have inconsistent ownershipBake UVs or gutter dilation address the wrong chartRun atlas validation and adjust atlas dimensions, density, or padding before baking
Lightmap dilation has no chart texture or uses the wrong chart IDsGutter values bleed across charts or the pass cannot runSupply a same-size chart texture with positive chart ownership
Lightmap data has the wrong header, dimensions, UV set, or channel countDecode or texture creation rejects the saved bakeValidate the version 1 linear-irradiance contract before exchange
Lightmap RGB is treated as a final shaded colorBaked diffuse illumination is applied with the wrong energy modelTreat the texture as linear diffuse irradiance and keep specular lighting separate
A PBR feature is bound without its matching map flag or defineThe material reads the wrong shader path or ignores the textureDerive binding flags and texture defines from the same resource set

Key files

FileWhy to read it
modules/…/index.tsPublic lighting entry point for environments, PBR models, shadows, passes, clustered grids, lightmaps, probes, and atlases.
modules/…/pbr-model.tsDefines the shared visible, shadow, surface, and lightmap model roles.
modules/…/pbr-material.tsDefines the reusable engine-side PBR material boundary.
modules/…/pbr-material.tsDefines PBR material features, bindings, uniforms, and texture-driven shader paths.
modules/…/prefiltered-environment.tsDefines conversion from an environment image to PBR diffuse, specular, and BRDF textures.
modules/…/reflection-probe.tsDefines WebGPU scene capture, incremental refresh, specular filtering, and completed-result publication for local environments.
modules/…/pbr-environment.tsDefines scene-level environment bindings, intensity, rotation, and mip metadata.
modules/…/shadow-map-renderer.tsDefines shadow views, owned depth resources, caster callbacks, and receiver shader data.
modules/…/shadow.tsDefines receiver-side shadow visibility for directional, spot, and point lights.
modules/…/ambient-occlusion-pass.tsDefines SSAO and GTAO visibility generation from camera depth and normals.
modules/…/contact-shadow-pass.tsDefines screen-space contact visibility generation and filtering.
modules/…/clustered-light-grid.tsDefines WebGPU point-light binning, compaction, capacities, and lookup metadata.
modules/…/lightmap-atlas.tsDefines CPU chart generation, atlas packing, ownership diagnostics, and lightmap UV preparation.
modules/…/lightmap-baker.tsDefines UV-space irradiance accumulation, preview, result ownership, and dilation flow.
modules/…/lightmap-data.tsDefines the portable linear-irradiance lightmap format and GPU restore path.
modules/…/lightmap-environment.tsDefines environment-to-directional samples used during lightmap baking.
modules/…/pbr-surface-pass.tsDefines the shared camera depth and normal target for screen-space lighting.
modules/…/pbr-surface.tsDefines the encoded surface normal output used by screen-space effects.
modules/…/gltf-lightmap.tsDefines imported lightmap binding, UV, atlas, and instance transform behavior.
modules/…/pbr-environment.tsDefines asynchronous loading and resolution of imported PBR environments.
modules/…/lightmap.tsDefines baked irradiance evaluation and direct-light visibility during baking.
modules/…/pbr-shadow.tsDefines how shadow visibility enters the PBR direct-light response.