Taos API Reference
    Preparing search index...

    Interface RenderFeature

    A unit of rendering work — one or more passes plus the per-frame update and graph-wiring logic that owns them. Features are registered with the Engine at startup (typically via a preset) and drive everything the engine does each frame.

    Lifecycle:

    1. setup(engine) — runs once when the feature is added (or when the engine fully initializes if added before Engine.create completes). Construct persistent Pass instances and stash them on this.
    2. update(frame) — once per frame, after Engine has populated frame with bucketed draws and updated the camera. Push uniforms to the owned passes via their updateX methods.
    3. addPasses(frame) — once per fresh graph build (skipped when the Engine reuses the cached graph). Call pass.addToGraph(frame.graph, ...) to declare resource flow. Most features read from and write back to frame.hdr / frame.gbuffer / frame.shadowMap / frame.ao so other features see the latest output.
    4. destroy() — release owned GPU resources.

    Features should respect enabled; when false, the engine skips both update and addPasses.

    interface RenderFeature {
        name: string;
        enabled: boolean;
        setup(engine: Engine): void | Promise<void>;
        earlyUpdate?(frame: Frame): void;
        update?(frame: Frame): void;
        addPasses(frame: Frame): void;
        destroy?(): void;
    }

    Implemented by

    Index

    Properties

    name: string

    Stable identifier used for lookup, signature hashing, and pass-name keying.

    enabled: boolean

    When false, the feature is skipped each frame. Toggling triggers a cached-graph invalidation.

    Methods

    • Runs once per frame across every feature before any feature's update. Use for things that must mutate camera/uniform state before downstream features sample it — e.g. TAA's sub-pixel jitter, which has to land on the camera before geometry-fill passes read jitteredViewProjectionMatrix. Plain per-frame uniform updates belong in update, not here.

      Parameters

      Returns void