Taos API Reference
    Preparing search index...

    Type Alias RenderNode

    RenderNode:
        | {
            type: "sprites";
            blendMode: "additive"
            | "alpha";
            billboard: "camera" | "velocity";
            shape?: SpriteShape;
            renderTarget?: "gbuffer" | "hdr";
            emit?: number;
            stretch?: number;
            thickness?: number;
            size?: number;
            sunDirection?: [number, number, number];
            sunColor?: [number, number, number];
        }
        | { type: "points" }
        | {
            type: "trail";
            segments: number;
            width: number;
            timeInterval?: number;
            minDistance?: number;
            emit?: number;
        }
        | {
            type: "mesh";
            mesh: Mesh;
            material: Material;
            align?: "world"
            | "velocity";
            renderTarget?: "gbuffer" | "hdr";
        }
        | {
            type: "glyph_trail";
            segments: number;
            worldHeight: number;
            timeInterval?: number;
            minDistance?: number;
            emit?: number;
            atlas: GPUTexture;
            glyphTable: Float32Array;
            wordTable: Float32Array;
            maxGlyphs: number;
            numWords: number;
            emPx: number;
        }

    Type Declaration

    • {
          type: "sprites";
          blendMode: "additive" | "alpha";
          billboard: "camera" | "velocity";
          shape?: SpriteShape;
          renderTarget?: "gbuffer" | "hdr";
          emit?: number;
          stretch?: number;
          thickness?: number;
          size?: number;
          sunDirection?: [number, number, number];
          sunColor?: [number, number, number];
      }
      • type: "sprites"
      • blendMode: "additive" | "alpha"
      • billboard: "camera" | "velocity"
      • Optionalshape?: SpriteShape
      • OptionalrenderTarget?: "gbuffer" | "hdr"
      • Optionalemit?: number

        HDR emission multiplier applied in the fragment shader (forward mode). Default 4.0 for legacy parity. Crank to ~12–24 for hot sparks/fire so they punch through bloom; drop to 1.0 for ordinary alpha sprites.

      • Optionalstretch?: number

        Velocity-aligned billboard stretch factor: streak length grows by 1 + stretch * speed. Default 0.04 (subtle). Use ~0.3–1.0 for sparks.

      • Optionalthickness?: number

        Cross-axis width multiplier for velocity-aligned billboards. Lets spark/ember configs tune line thickness independently of initialSize (which also drives streak length via stretch). Default 1.0 (no change). Use ~0.4 for fine wire-thin sparks, ~2.0 for chunky bolts.

      • Optionalsize?: number

        Uniform quad-scale multiplier for camera-aligned billboards (pixel/soft/fire/smoke). Multiplies both quad axes so the renderer can tune apparent size without touching initialSize. Default 1.0 (no change). Useful for chunkier pixel debris or oversize fire/smoke puffs without retuning the emitter.

      • OptionalsunDirection?: [number, number, number]

        Forward-mode sun direction (toward the sun, world-space, unit vector) used by the 'smoke' shape for fake side-lighting. Defaults to [0, 1, 0] (top-lit).

      • OptionalsunColor?: [number, number, number]

        Forward-mode sun color used by the 'smoke' shape's fake lighting. Defaults to white [1, 1, 1].

    • { type: "points" }
    • {
          type: "trail";
          segments: number;
          width: number;
          timeInterval?: number;
          minDistance?: number;
          emit?: number;
      }

      Ribbon trail. Each live particle records a short history of its own past positions and is drawn as a variable-width line (a camera-facing ribbon) threaded through those points — comet tails, tracers, energy beams.

      History is a per-particle ring buffer of at most segments committed points plus the live head position. A new point is committed whenever either timeInterval seconds have elapsed (a frame-rate-independent global tick) or the particle has moved minDistance world units since the last committed point — so the trail length is bounded by both time and distance. The oldest point is dropped once segments is reached.

      Renders forward into the HDR target with additive blend (glows / blooms). Width tapers from width at the head to zero at the tail, and alpha fades to zero along the same axis so the trail dissolves as it thins.

      • type: "trail"
      • segments: number

        Maximum committed history points retained per particle (ring size). Trail vertex cost is 2 * (segments + 1) per particle. Typical 16–48.

      • width: number

        Ribbon width in world units at the head (the live particle position). Tapers linearly to zero at the tail.

      • OptionaltimeInterval?: number

        Commit a new point at least every timeInterval seconds (frame-rate independent). Default 0.03. Set large to rely purely on minDistance.

      • OptionalminDistance?: number

        Also commit a new point once the particle has moved this many world units since the last committed point. Default 0.1. Set large (or 0 to disable the distance test) to rely purely on timeInterval.

      • Optionalemit?: number

        HDR emission multiplier applied in the fragment shader. Default 4.0; crank to ~12–24 for hot tracers that punch through bloom.

    • {
          type: "mesh";
          mesh: Mesh;
          material: Material;
          align?: "world" | "velocity";
          renderTarget?: "gbuffer" | "hdr";
      }
    • {
          type: "glyph_trail";
          segments: number;
          worldHeight: number;
          timeInterval?: number;
          minDistance?: number;
          emit?: number;
          atlas: GPUTexture;
          glyphTable: Float32Array;
          wordTable: Float32Array;
          maxGlyphs: number;
          numWords: number;
          emPx: number;
      }

      GPU "fountain of text": SDF glyphs typeset along each particle's trail, computed and rendered entirely on the GPU. Reuses the same per-particle position-history ring buffer as the ribbon trail mode (segments / timeInterval / minDistance behave identically), but instead of a ribbon each live particle is labeled with a word whose glyphs are distributed by arc length along the trail, billboarded to face the camera with their baseline on the local trail tangent.

      Each particle is assigned a word by slotIndex % numWords. The atlas + the glyphTable/wordTable/maxGlyphs/numWords/emPx fields come from createSdfFontAtlas() + buildGlyphTrailTables() in src/text. Renders forward into the HDR target with additive blend (glows / blooms).

      • type: "glyph_trail"
      • segments: number

        Max committed history points per particle (trail ring size). 16–48 typical.

      • worldHeight: number

        Glyph cap height in world units (scale = worldHeight / emPx).

      • OptionaltimeInterval?: number

        Commit cadence in seconds (frame-rate independent). Default 0.03.

      • OptionalminDistance?: number

        Also commit once the particle has moved this many world units. Default 0.1.

      • Optionalemit?: number

        HDR emission multiplier applied in the fragment shader. Default 4.0.

      • atlas: GPUTexture

        SDF font atlas texture from createSdfFontAtlas().

      • glyphTable: Float32Array

        Per-glyph atlas metrics, from buildGlyphTrailTables().

      • wordTable: Float32Array

        Per-word glyph runs, from buildGlyphTrailTables().

      • maxGlyphs: number

        Max glyph count across all words (drives per-particle vertex count).

      • numWords: number

        Number of words (particles pick one by slot % numWords).

      • emPx: number

        Em height in atlas px (ascent + descent), for the px → world scale.