Documentation
    Preparing search index...

    Class ShaderGraphBuilder

    Builds a ShaderGraph node by node — the domain-agnostic base. "surface" authors normally use NodeMaterialBuilder, which adds texture-value collection and NodeMaterialBuilder.build; "screen" authors build a §70 GraphEffect's graph here:

    const screen = new ShaderGraphBuilder("screen");
    const texel = screen.sampler("source");
    screen.output.color = texel.multiply([0.5, 0.5, 0.5, 1]);
    const effect = { kind: "graph", graph: screen.graph() } as const;

    Hierarchy (View Summary)

    Index
    collectedTextures: Record<string, MaterialTexture> = {}

    Texture values collected by ShaderGraphBuilder.texture.

    domain: ShaderDomain

    Which stage inputs this graph may name — fixed at construction.

    output: ShaderGraphOutput = ...

    The output slots — builder.output.color = … (RFC 0001's spelling).

    • Snapshots the built graph — nodes in creation order, outputs resolved — and validates it (analyzeShaderGraph, §85: a broken graph is refused here, where the code that built it is on the stack).

      Returns ShaderGraph

      RangeError when no colour output was assigned, or when the graph breaks any §60 IR rule.