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 / shadertools

Shader modules and composition

The shaders package provides reusable shader behavior and the rules that combine it with application shader code. It turns modules, uniforms, injection targets, plugins, and backend-specific source into programs that render models or run compute work. The wider shader systems page describes the rendering path, Slang integration describes source translation at this boundary, and rendering and lighting describes the lighting features that consume these modules.

Shader module model

A shader module is a named unit of shader behavior. It carries source for one or more shader languages, uniform metadata, default values, property conversion, resource layout, defines, and dependencies. This keeps application properties separate from the data layout and functions used by the shader. modules/…/shader-module.ts• L34-100

The package exports modules for common rendering needs. Their broad roles are:

Module familyPurpose
Engine featuresPicking, clipping, filtering, transforms, skinning, and animation support.
Geometry featuresPattern, dash, glow, precipitation, and stroke effects.
Lighting and materialsShared lights, lit and unlit materials, physically based materials, shadows, ambient visibility, contact shadows, surfaces, and lightmap work.
Math and data helpersRandom values, noise, volume sampling, coordinate math, and higher precision arithmetic.

The public entry point is modules/…/index.ts. It exposes the module contracts, assemblers, plugins, and the built-in module set without requiring a rendering program to know each source file. It also exposes the prefiltered environment module and its backend-specific filter programs for PBR workflows. modules/…/index.ts• L18-70, modules/…/index.ts• L156-311

References: modules/…/shader-module.ts• L34-100 modules/…/index.ts• L18-70 modules/…/index.ts• L156-311

Environment prefilter module

The prefiltered environment module prepares image-based lighting data from an environment texture. It uses one uniform contract for cube-face filtering, roughness-based environment filtering, and BRDF integration, while exposing matching GLSL and WGSL fragment programs so the same workflow can run on either backend. modules/…/prefiltered-environment.ts• L7-20, modules/…/prefiltered-environment.ts• L48-75, modules/…/prefiltered-environment.ts• L77-229, modules/…/prefiltered-environment.ts• L232-370

The module keeps filter controls and source texture bindings together. This lets a rendering program pass the environment input and its sampling policy through the normal shader-module path instead of maintaining a separate shader contract for each backend. modules/…/prefiltered-environment.ts• L15-20, modules/…/prefiltered-environment.ts• L48-70

References: modules/…/prefiltered-environment.ts• L7-20 modules/…/prefiltered-environment.ts• L48-75 modules/…/index.ts• L262-271

Module dependency composition

Modules form a dependency graph. The resolver includes each dependency once, places dependencies before the modules that use them, and rejects cycles, name collisions, and competing exclusive interfaces. The resulting order makes shared declarations and functions available before dependent shader code. modules/…/shader-module-dependencies.ts• L16-101

Material modules use this graph to build higher-level shading from shared behavior. lambertMaterial adds a diffuse material model on top of lighting; pbrMaterial adds lighting, area lights, image-based lighting, projection, and scene support. The newer PBR support modules build on this same base: shadow visibility, ambient occlusion, contact shadow visibility, and surface-normal output can be selected as separate modules. The application selects the feature modules it needs rather than assembling each lower-level feature by hand. modules/…/lambert-material.ts• L17-41, modules/…/pbr-material.ts• L326-357, modules/…/pbr-shadow.ts• L19-26, modules/…/pbr-ambient-occlusion.ts• L18-29, modules/…/pbr-contact-shadow.ts• L18-29, modules/…/pbr-surface.ts• L20-25

The same pattern applies to numeric helpers. fp64arithmetic provides the base arithmetic contract, while fp64 adds the larger function layer. A module can therefore expose a small reusable base and a higher-level feature without duplicating source. modules/…/fp64.ts• L31-62

References: modules/…/shader-module-dependencies.ts• L16-101 modules/…/lambert-material.ts• L17-41 modules/…/pbr-material.ts• L326-357 modules/…/pbr-shadow.ts• L19-26 modules/…/pbr-surface.ts• L20-25 modules/…/fp64.ts• L31-62

Lighting and material module composition

The lighting modules provide a shared path from scene lighting inputs to material output. shadow supplies visibility factors for directional, spot, and point lights; pbrShadow applies those factors to the direct-light slots of pbrMaterial; and the contact-shadow module can supply an additional directional visibility factor. This separates shadow-map sampling from the material response and lets a program add or omit shadow features without changing its base material choice. modules/…/shadow.ts• L381-453, modules/…/pbr-shadow.ts• L21-60, modules/…/pbr-material-glsl.ts• L1049-1053, modules/…/pbr-material-wgsl.ts• L1270-1273

The package also exposes modules for distinct render passes. pbrSurface writes a view-space normal representation for later screen-space work. pbrAmbientOcclusion reads an ambient-visibility texture and changes ambient visibility without changing direct light or emission. pbrContactShadow reads a screen-space contact mask and applies it to the first directional light. unlitMaterial preserves the supplied surface color and has no lighting dependency. modules/…/pbr-surface.ts• L20-68, modules/…/pbr-ambient-occlusion.ts• L18-60, modules/…/pbr-contact-shadow.ts• L18-60, modules/…/unlit-material.ts• L29-44

Lightmap support uses two related roles. lightmapBake extends the PBR material for texture-space irradiance work, while lightmapFilter supports accumulation, copy, and chart-edge fill in the bake workflow. The modules keep the bake controls and intermediate textures in the same assembly and binding model as other shader passes. modules/…/lightmap.ts• L14-24, modules/…/lightmap-filter.ts• L6-23

The clustered light grid is a small shared lookup helper. It maps normalized screen coordinates and positive view depth to one tile in a three-dimensional light grid, so a lighting path can use the same tile selection rule across renderers. modules/…/clustered-light-grid.ts• L6-16

The contact-shadow workflow is a pass chain rather than one material function. A trace pass builds a screen-space visibility mask from depth and normals, a bilateral blur pass reduces noise while keeping edges, and a composite pass applies the result or displays debug data. modules/…/contact-shadow.ts• L26-35, modules/…/contact-shadow.ts• L177-184, modules/…/contact-shadow.ts• L284-292

This diagram shows how optional lighting passes feed the canonical PBR material.

flowchart LR
  A[Scene light and shadow resources] --> B[shadow module]
  B --> C[pbrShadow]
  D[Depth and normal inputs] --> E[Contact shadow trace]
  E --> F[Bilateral blur]
  F --> G[pbrContactShadow]
  H[Ambient occlusion texture] --> I[pbrAmbientOcclusion]
  C --> J[pbrMaterial]
  G --> J
  I --> J
  J --> K[Lit or screen-space render output]

References: modules/…/shadow.ts• L381-453 modules/…/shadow-types.ts• L21-68 modules/…/pbr-shadow.ts• L21-60 modules/…/contact-shadow.ts• L34-35 modules/…/contact-shadow.ts• L184 modules/…/contact-shadow.ts• L292 modules/…/pbr-ambient-occlusion.ts• L18-60 modules/…/lightmap.ts• L14-24 modules/…/lightmap-filter.ts• L6-23 modules/…/clustered-light-grid.ts• L6-16

Uniform and resource contracts

Uniforms connect application state to shader state. A module defines the public properties, the normalized uniform values, the shader-side formats, and any defaults. Its getUniforms function can translate a convenient application shape into the fixed layout consumed by the shader. The assembler combines these functions into one getter for the rendering program. modules/…/shader-module.ts• L71-89, modules/…/shader-assembly-shared.ts• L12-31

The host and shader must agree on field names, order, and types. GLSL uniform blocks use explicit std140 layout, and the package can compare the declared metadata with the fields found in GLSL or WGSL source. This check protects the data path from silent field shifts. modules/…/shader-module-uniform-layout.ts• L102-158, modules/…/shader-module-uniform-layout.ts• L185-216

The public input can be richer than the GPU layout. For example, lighting accepts a mixed list of ambient, point, spot, directional, rectangle, and disk lights, then packs it into fixed-size shader arrays. The shadow module follows the same boundary: it accepts resolved light descriptions and maps, then pads the directional, spot, and point light data to the shader's fixed limits. The PBR material and its optional modules use typed flags, texture bindings, and UV transforms to select only the material features active in a program. modules/…/lighting.ts• L21-27, modules/…/lighting.ts• L124-185, modules/…/shadow.ts• L411-453, modules/…/pbr-material.ts• L192-203

Resources use the same module contract as uniforms. A module can describe its logical bind-group layout and preferred starting slot for automatic WGSL bindings. Application-owned group-0 slots stay below 100, while module-owned explicit group-0 slots start at 100 or higher. The assembler resolves active declarations and returns both assignments and a table that the pipeline setup can inspect. modules/…/shader-module.ts• L21-55, modules/…/assemble-wgsl-shaders.ts• L49-70, modules/…/assemble-wgsl-shaders.ts• L556-660

Lighting extensions use stable resource groups to keep optional features composable. Shadow resources are grouped together, PBR material textures use the material group, and screen-space visibility textures are added by the feature module that consumes them. A rendering program therefore enables a feature by selecting its module and supplying the matching resources instead of changing the base material contract. modules/…/shadow.ts• L404-410, modules/…/pbr-material.ts• L328-351, modules/…/pbr-ambient-occlusion.ts• L26-29, modules/…/pbr-contact-shadow.ts• L26-29

References: modules/…/shader-module.ts• L21-55 modules/…/shader-module.ts• L71-89 modules/…/shader-assembly-shared.ts• L12-31 modules/…/shader-module-uniform-layout.ts• L102-158 modules/…/lighting.ts• L124-185 modules/…/shadow.ts• L411-453 modules/…/pbr-material.ts• L192-203 modules/…/assemble-wgsl-shaders.ts• L556-660

Hook and injection composition

Shader injections provide stage-specific extension points that let modules and plugins add code without replacing application shader code. Each injection selects GLSL or WGSL source, uses a vertex or fragment stage, and can set an order so several features combine predictably. modules/…/shader-injections.ts• L18-71

The package supports both built-in source locations and callable injection targets. Declaration injections add interface or resource declarations, while main-start and main-end injections add code around a stage entry point. A callable target declares a shared name and stage with language-specific signatures and optional surrounding code. The assembler emits that target and places ordered contributions inside it. modules/…/shader-injections.ts• L128-220, modules/…/shader-injection-targets.ts• L7-72

Targets use vs: and fs: stage prefixes during assembly. The registry selects the language implementation and merges compatible plugin declarations. WGSL gives a target separate private names when the same public target is used by both stages, and it specializes shared helpers when their call paths cross stages. This keeps stage-local code from colliding in one WGSL source unit. modules/…/shader-injection-targets.ts• L75-147, modules/…/wgsl-injection-target-names.ts• L21-47, modules/…/wgsl-injection-target-names.ts• L50-171

Plugins package a feature's modules, defines, injections, callable injection targets, vertex inputs, and cross-stage varyings. Shared contributions can be paired with GLSL- or WGSL-only contributions. The resolver checks interface names, types, interpolation, and target signatures so a feature keeps one contract across backends. The clipping plugin illustrates this model: it adds a module, carries coordinates between stages, and injects stage code at named hooks. modules/…/shader-plugin.ts• L31-63, modules/…/shader-plugin.ts• L65-90, modules/…/shader-plugin.ts• L125-212, modules/…/clip.ts• L100-149

PBR material modules use named functions as their extension surface. Optional shadow and screen-space modules call the shared PBR color-filter functions and update the values used by direct lighting. This keeps feature ordering visible in the module graph: the base material defines the shared contract, and the add-on module supplies the extra visibility or surface behavior. modules/…/pbr-material-glsl.ts• L1049-1053, modules/…/pbr-material-wgsl.ts• L1270-1273, modules/…/pbr-shadow.ts• L43-60, modules/…/pbr-contact-shadow.ts• L51-60

Injection names include their stage prefix, such as vs: or fs:. An injection that names a target not declared by the current shader or its plugins is rejected. Conflicting target signatures, vertex-input types, or varying contracts are also rejected. These checks make the application shader and plugin interfaces explicit. modules/…/shader-injection-targets.ts• L92-147, modules/…/shader-plugin.ts• L136-182

References: modules/…/shader-injections.ts• L18-71 modules/…/shader-injection-targets.ts• L7-147 modules/…/wgsl-injection-target-names.ts• L21-171 modules/…/shader-plugin.ts• L31-63 modules/…/shader-plugin.ts• L125-212 modules/…/clip.ts• L100-149 modules/…/pbr-shadow.ts• L43-60

Shader assembly workflow

Assembly combines application source with the selected module graph and feature contributions. A stateful assembler can also hold default modules, hooks, source transpilers, and stable WGSL binding assignments for later assembly calls. modules/…/shader-assembler-base.ts• L17-99, modules/…/shader-assembler-base.ts• L101-168

The main flow is:

  1. Select the GLSL or WGSL assembler for the device language.
  2. Merge application modules, default modules, and plugin modules.
  3. Resolve dependencies and collect module defines and uniform converters.
  4. Translate foreign source when a registered transpiler is required.
  5. Preprocess active feature variants.
  6. Resolve plugin interfaces, injection targets, injections, and WGSL resource locations.
  7. Emit the final shader source and return runtime uniform and layout metadata.

This diagram shows how application code and reusable features become a pipeline input.

flowchart TD
  A[Application shader and properties] --> B[Language-specific assembler]
  B --> C[Modules and plugin contributions]
  C --> D[Dependency and variant resolution]
  D --> E[Targets injections and bindings]
  E --> F[GLSL pair or unified WGSL source]
  F --> G[Uniform getter and shader layout]
  G --> H[Render or compute pipeline]

GLSL assembly returns a vertex and fragment pair. WGSL assembly returns unified source, entry points, binding assignments, binding debug data, and a scanned shader layout. The two paths share module and injection concepts but follow the resource rules of their language. modules/…/glsl-shader-assembler.ts• L10-37, modules/…/wgsl-shader-assembler.ts• L18-86, modules/…/assemble-glsl-shaders.ts• L45-77, modules/…/assemble-wgsl-shaders.ts• L51-70

References: modules/…/shader-assembler-base.ts• L17-99 modules/…/glsl-shader-assembler.ts• L10-37 modules/…/wgsl-shader-assembler.ts• L18-86 modules/…/assemble-glsl-shaders.ts• L45-77 modules/…/assemble-wgsl-shaders.ts• L51-70

Rendering program integration

The engine model is the main render integration point. It chooses an assembler that matches the device, resolves plugins and shader inputs, combines their modules with model modules, then passes assembled source, uniform conversion, and layout data to pipeline setup. WebGL uses the GLSL pair; WebGPU uses unified WGSL and its resolved binding metadata. modules/…/gpu-vector-model.ts• L378-455, modules/…/gpu-vector-model.ts• L457-525

Compute uses the WGSL assembler through the same module and plugin contracts. It shares module source, defines, injections, uniform conversion, and layout discovery, but it rejects plugin vertex inputs and varyings because a compute stage has no render-stage interface. modules/…/computation.ts• L167-241

Lighting render programs pass the resolved light and shadow resources into the module system. The shader package describes the resource names and how the shader reads them; the renderer remains responsible for creating the maps, samplers, matrices, and pass targets. The shadow module makes this boundary explicit by returning no shadow uniforms until its complete resource set is ready. modules/…/shadow.ts• L411-451

The split between package responsibilities is deliberate. Shader source and module contracts live in @luma.gl/shaders; resource helpers that create backend objects can live in engine. The optional area-light LTC path is an example: the area-light module declares the lookup resources, while modules/…/ltc-textures.ts creates the caller-owned textures and returns bindings with matching names. modules/…/area-lighting.ts• L20-63, modules/…/ltc-shaders.ts• L5-18, modules/…/ltc-textures.ts• L9-29

The prefiltered environment path follows the same boundary. Its module and backend filter programs are public shader-package inputs, so a render program can assemble them through the shared module contract rather than import shader source from an engine-only location. modules/…/index.ts• L262-271, modules/…/prefiltered-environment.ts• L48-75

References: modules/…/gpu-vector-model.ts• L378-455 modules/…/gpu-vector-model.ts• L457-525 modules/…/computation.ts• L167-241 modules/…/shadow.ts• L411-451 modules/…/area-lighting.ts• L20-63 modules/…/ltc-textures.ts• L9-29 modules/…/index.ts• L262-271

Backend and source-language boundaries

A module can provide GLSL vertex and fragment source, WGSL source, or both. Shared module metadata lets a material or feature keep one dependency and uniform contract while its shader code follows each backend's syntax and resource model. modules/…/shader-module.ts• L57-76, modules/…/lambert-material.ts• L17-25

The PBR material keeps the same material behavior across GLSL and WGSL while using backend-specific stage interfaces, texture calls, and uniform representations. The optional PBR modules depend on that shared contract, so their visibility and surface features can be selected in either backend. modules/…/pbr-material-glsl.ts• L13-56, modules/…/pbr-material-wgsl.ts• L155-201, modules/…/pbr-surface.ts• L38-102

The shadow module follows the same boundary. WebGPU uses depth-array and cube-array sampling with comparison samplers, while WebGL uses explicit depth comparisons over array textures. Both backends expose the same high-level directional, spot, and point visibility functions to consuming material modules. modules/…/shadow.ts• L103-379, modules/…/shadow-glsl.ts• L5-204

The prefiltered environment module uses this boundary directly. It exports matching GLSL and WGSL fragment programs for the same filter controls and source texture, while each program follows its backend's texture sampling and entry-point rules. modules/…/prefiltered-environment.ts• L22-46, modules/…/prefiltered-environment.ts• L77-229, modules/…/prefiltered-environment.ts• L232-370

Foreign source languages are translated before native assembly. An application registers a ShaderTranspiler for one source language; the assembler joins the application source with modules written in that language, translates the unit, and preserves the module metadata without emitting the foreign source twice. A translation unit cannot mix several foreign source languages. modules/…/shader-transpiler.ts• L7-34, modules/…/shader-assembler-base.ts• L41-99

Backend variants can also be selected by defines and platform data. The fp64 module keeps a common public numeric shape while choosing classic, integer, or hybrid WGSL arithmetic when the target needs it. This allows device-specific shader choices without changing the module used by the application. modules/…/fp64.ts• L31-62, modules/…/fp64-arithmetic-wgsl.ts• L642-648, modules/…/fp64-arithmetic-wgsl-hybrid.ts• L5-16

References: modules/…/shader-module.ts• L57-76 modules/…/pbr-material-glsl.ts• L13-56 modules/…/pbr-material-wgsl.ts• L155-201 modules/…/shadow.ts• L103-379 modules/…/shadow-glsl.ts• L5-204 modules/…/prefiltered-environment.ts• L22-46 modules/…/shader-transpiler.ts• L7-34 modules/…/shader-assembler-base.ts• L41-99 modules/…/fp64.ts• L31-62

Change checklist

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

  • Keep uniformTypes, shader block or struct fields, and host-side packing aligned in name, order, and type.
  • Keep application injection targets present in every shader stage and backend that receives module or plugin injections.
  • Keep plugin vertex inputs and varyings consistent across the selected GLSL and WGSL variants.
  • Keep target signatures and stage declarations consistent across built-in and plugin target registries.
  • Keep module names, binding names, groups, and active defines stable when WGSL binding reuse matters.
  • Keep application group-0 bindings below 100 and module-owned explicit group-0 bindings at 100 or higher.
  • When changing a material dependency graph, preserve declaration order and the resource contracts of its dependent modules.
  • When changing PBR material extension fields or filter functions, update the GLSL and WGSL material sources and every PBR add-on that calls the shared contract.
  • When changing shadow light limits, packed arrays, or shadow map bindings, update the shadow types, WGSL source, GLSL source, and PBR shadow consumer together.
  • When changing contact-shadow pass outputs, keep the trace, blur, composite, and PBR consumer texture names and viewport conventions aligned.
  • When changing ambient occlusion or surface passes, keep their group and texture contracts aligned with the pass that creates the input texture.
  • When changing lightmap bake or filter behavior, keep the PBR lightmap fields and the baker's intermediate texture bindings aligned.
  • When changing an LTC module binding, update the engine texture helper and the caller-owned binding map together.
  • When changing source-language support, keep the one-foreign-language translation-unit rule and entry-point mapping intact.
  • When changing a WGSL numeric variant, keep platform selection aligned with the shared fp64 public API.
  • When changing the prefiltered environment module, keep its public exports, uniform names, binding names, and GLSL/WGSL filter behavior aligned.

Important failure modes

TriggerConsequenceGuard
Uniform metadata and shader block fields differValues can map to the wrong fields or assembly can failValidate module layouts and use explicit layout(std140) for GLSL blocks.
A dependency cycle, duplicate name, or competing interface existsModule resolution stops before source assemblyKeep the module graph acyclic and use one provider for each named interface.
An injection targets an undeclared or wrong-stage targetThe feature is rejected or its code cannot runDeclare the target for the correct stage and keep its language signatures compatible.
Plugins declare conflicting target signatures or stage interfacesPlugin resolution stops before source assemblyShare one target signature and one type/interpolation contract for each interface name.
Active WGSL bindings collideBinding resolution or pipeline layout creation failsKeep application and module binding ranges separate and preserve binding names.
A conditional resource is enabled without its matching bindingShader compilation or pipeline creation failsEnable the define and resource together; for LTC use createAreaLightLTCTextures.
More lights are supplied than the fixed module arrays supportExtra lights are truncatedRespect the lighting, shadow, and area-light limits in the module input model.
Shadow maps, matrices, or samplers are incompleteThe shadow module emits no resolved uniform set or the pipeline lacks a required resourceSupply the complete shadow resource set and keep map, sampler, and matrix variants matched.
A PBR add-on is assembled without pbrMaterial or its expected shared functionAssembly fails or the feature cannot affect the final colorUse the PBR add-on with its declared base material dependency.
A contact, ambient-occlusion, or surface texture uses a different viewport or encodingScreen-space lighting has an offset, wrong visibility, or wrong normalKeep pass output encoding, physical-pixel viewport, and consumer uniforms aligned.
Compute plugins declare vertex inputs or varyingsCompute setup throws before pipeline creationUse compute plugins only for modules, defines, injections, and compute-safe resources.
A foreign source language has no registered transpiler or mixed foreign languages are usedAssembly cannot produce native shader sourceRegister one transpiler for the input language and keep the translation unit consistent.
The environment source encoding or backend texture-coordinate convention does not match the filter inputsPrefiltered lighting can have incorrect color or face orientationKeep sourceEncoding, source texture data, and GLSL/WGSL coordinate handling aligned.

Key files

FileWhy to read it
modules/…/index.tsPublic package surface for modules, assemblers, plugins, and lighting helpers.
modules/…/shader-module.tsCore module contract and property-to-uniform boundary.
modules/…/shader-module-dependencies.tsDependency order and graph validation.
modules/…/shader-module-uniform-layout.tsHost and shader uniform layout checks.
modules/…/shader-plugin.tsPortable and backend-specific plugin contracts.
modules/…/shader-injections.tsDeclaration, entry-point, and ordered injection insertion.
modules/…/shader-injection-targets.tsStage-aware callable target declarations, merging, and validation.
modules/…/wgsl-injection-target-names.tsWGSL stage-specific target and helper name resolution.
modules/…/glsl-shader-assembler.tsGLSL assembly entry point.
modules/…/wgsl-shader-assembler.tsWGSL assembly, binding state, and layout metadata.
modules/…/assemble-wgsl-shaders.tsWGSL module source, injections, and binding resolution flow.
modules/…/gpu-vector-model.tsRender-program integration with device language, modules, plugins, and layouts.
modules/…/computation.tsCompute-program integration and its plugin limits.
modules/…/lighting.tsShared light input and normalized uniform contract.
modules/…/pbr-material.tsCanonical PBR material contract, dependencies, defines, and bindings.
modules/…/pbr-material-glsl.tsGLSL PBR stage contract and shared color-filter functions.
modules/…/pbr-material-wgsl.tsWGSL PBR stage contract and shared color-filter functions.
modules/…/shadow.tsBackend-aware shadow inputs, limits, resource bindings, and visibility functions.
modules/…/shadow-types.tsPublic directional, spot, point, and resolved shadow resource types.
modules/…/shadow-glsl.tsWebGL shadow sampling contract.
modules/…/pbr-shadow.tsPBR integration for shadow visibility.
modules/…/pbr-surface.tsNormal-output pass for screen-space consumers.
modules/…/pbr-ambient-occlusion.tsAmbient-visibility texture integration for PBR.
modules/…/pbr-contact-shadow.tsContact-mask integration for directional PBR lighting.
modules/…/contact-shadow.tsTrace, blur, and composite passes for contact shadows.
modules/…/lightmap.tsTexture-space lightmap bake module and PBR dependency.
modules/…/lightmap-filter.tsLightmap accumulation and chart-edge filter pass.
modules/…/clustered-light-grid.tsShared screen-and-depth tile lookup.
modules/…/unlit-material.tsMinimal material path when lighting is not needed.
modules/…/prefiltered-environment.tsPBR environment filter module, uniforms, bindings, and GLSL/WGSL filter programs.