Taos API Reference
    Preparing search index...

    Class TonemapPass

    Final HDR-to-SDR tone-mapping pass (render-graph version).

    Samples an HDR input, applies an exposure multiplier and an optional ACES filmic curve, then writes the result to the supplied backbuffer attachment. The HDR input handle is supplied each frame via addToGraph; the pass owns the pipeline, sampler, and params uniform buffer.

    Hierarchy (View Summary)

    • Pass<TonemapDeps, void>
      • TonemapPass
    Index

    Properties

    name: "TonemapPass" = 'TonemapPass'

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

    Methods

    • 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: TonemapDeps

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

      Returns void

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

    • Parameters

      • ctx: RenderContext

        Render context whose queue receives the buffer write.

      • exposure: number

        Linear exposure multiplier applied before the curve.

      • operator: number | boolean

        Tonemap curve: a number (0 = none/linear, 1 = ACES Narkowicz, 2 = ACES fitted RRT/ODT) or, for back-compat, a boolean (true → ACES Narkowicz, false → none).

      • hdrCanvas: boolean

        Skip the sRGB encode (for HDR swapchains).

      • preserveAlpha: boolean = false

      Returns void

    • AR passthrough: clear the backbuffer to transparent (alpha 0) instead of opaque black. Pair with preserveAlpha in updateParams so the shader emits scene coverage as the output alpha.

      Parameters

      • enabled: boolean

      Returns void

    • Re-pack + upload the post-FX uniform. Call every frame: time (seconds) animates the film grain and width/height drive the vignette aspect and grain cell size. paniniTanHalfFov is tan(½ · verticalFov) — pass the live camera's value so the Panini warp matches the rendered FOV.

      Parameters

      • ctx: RenderContext
      • width: number
      • height: number
      • time: number
      • paniniTanHalfFov: number

      Returns void

    • Bind a parsed 3D LUT (upload via uploadCubeLut). Pass null to revert to the identity LUT. amount (0..1) blends the LUT against the ungraded display color. The pass does not take ownership of the texture.

      Parameters

      Returns void