Taos API Reference
    Preparing search index...

    Class ForwardPlusPass

    Forward+ (tiled forward) render pass.

    Runs three graph passes per frame:

    1. depth pre-pass (render) — rasterizes geometry depth only.
    2. light culling (compute) — one workgroup per 16×16 tile derives the tile's view-space frustum from the depth bounds and tests every point light's bounding sphere against it, writing a per-tile light index list.
    3. shading (render) — re-renders geometry with full PBR; the fragment shader iterates only the point lights its tile received.

    The directional sun (with cascaded shadows) and IBL ambient are evaluated globally; only point lights are tile-culled. Many hundreds of point lights stay cheap because each fragment touches at most MAX_LIGHTS_PER_TILE.

    Hierarchy (View Summary)

    • Pass<ForwardPlusDeps, ForwardPlusOutputs>
      • ForwardPlusPass
    Index

    Properties

    name: "ForwardPlusPass" = 'ForwardPlusPass'

    Human-readable identifier used in graph node labels and error messages.

    cullMode: ForwardPlusCullMode = 'clustered'

    Light-culling strategy.

    • 'clustered' (default) bins point lights into a 3D froxel grid (screen cells × exponential depth slices) whose bounds come purely from the projection — so it reads no depth and the depth pre-pass is dropped entirely. Each fragment looks up its own froxel by view-Z, which also lights transparents correctly (the tiled slab is derived from opaque depth only).
    • 'tiled' bins them into 16×16 screen tiles, reducing a near→far depth slab per tile from a depth pre-pass. Both pipelines compile up front, so this can flip per-frame.
    debugTiles: boolean = false

    When true the shading pass renders the per-cell light-count heatmap instead of the lit scene. Useful for visualizing the culling result.

    debugMode: number = 0

    G-buffer-style channel visualization (0 = off / lit). Matches the deferred lighting shader's debugMode numbering so a channel reads the same in either renderer: 1 albedo · 2 normals · 3 metallic · 4 roughness · 5 emission · 6 occlusion · 7 specular · 8 material id · 9 texture coords. The deferred G-buffer can't carry UV, so mode 9 is forward-only. debugTiles (the light-count heatmap) takes precedence when set.

    iblIntensity: number = 1.0

    Ambient-IBL multiplier written into the lighting uniform (iblIntensity). 1 = full daytime IBL; lower it to dim baked ambient (e.g. at night) so the forward+ path matches the deferred path's iblIntensity control.

    areaLightsUseLtc: boolean = true

    Runtime LTC toggle (only meaningful when the LTC variant is compiled). Written into LightingUniforms.areaLightLtc each frame.

    sortTransparent: boolean = true

    Sort transparent items back-to-front before rendering. Default true.

    disableAerial: boolean = true

    Skip the aerial-perspective haze. Defaults true (opt-in) so existing forward+ scenes are unchanged; the feature sets it each frame.

    Methods

    • EVSM2 sampling params (only meaningful when this pass was built with the shadowFilter: 'vsm' variant). exponent must match what DirectionalVsmPass baked the moments at. Takes effect next frame.

      Parameters

      • exponent: number
      • bleed: number
      • minVariance: number

      Returns void

    • Virtualised-clipmap (shadowMode 2) pool atlas params: slots per atlas row + atlas dimensions in texels (for the page-table indirection).

      Parameters

      • cols: number
      • width: number
      • height: number

      Returns void

    • Set the list of skinned (GPU-skinned animated) draws. Opaque skinned items participate in the depth pre-pass — so the light-culling tile bounds see the live pose — and in the tile-shaded forward+ pass. Transparent skinned items only draw in the shading pass (back-to-front when sortTransparent is true), with depth-write disabled.

      Parameters

      • items: readonly SkinnedForwardDrawItem[]

      Returns void

    • Uploads per-frame camera, culling, point-light and directional-light data. Call once per frame after camera.updateRender(ctx) and before addToGraph.

      Parameters

      • ctx: RenderContext
      • directionalLight: DirectionalLight
      • pointLights: readonly PointLight[]
      • areaLights: readonly AreaLight[] = []

      Returns void

    • Insert the pass into graph for one frame. Implementations call graph.addPass(name, type, b => { ... }) exactly once and use the supplied PassBuilder to declare reads, writes, transient resources, and the execute callback.

      Parameters

      • graph: RenderGraph

        Graph being built this frame.

      • deps: ForwardPlusDeps = {}

        Pass-specific dependency record (handles, scene data, etc.).

      Returns ForwardPlusOutputs

      Pass-specific output record (typically a set of handles downstream passes will consume).