Documentation
    Preparing search index...

    Interface GraphEffect

    §70's "custom full-screen passes", as data (§60; RFC 0001, R-14) — a shader graph in the "screen" domain over the pass's declared inputs.

    const screen = new ShaderGraphBuilder("screen");
    const texel = screen.sampler("source");
    screen.output.color = texel.multiply(screen.uniform("gain", "float"));
    graph.addPass("warm", {
    kind: "effect",
    source: sceneColor.colorTexture,
    effect: { kind: "graph", graph: screen.graph(), uniforms: { gain: 1.2 } },
    });

    A texture node names its sampler, and every name resolves against the pass's declared inputs: "source" is EffectRenderPass.source, and any other name must appear in GraphEffect.textures. Every texture a graph samples is therefore enumerable from the pass, which is what lets RenderGraph.validate() run its feedback and ordering checks over a graph effect exactly as over a built-in one — so a GraphEffect pass does not emit the "opaque" info issue a CustomRenderPass does. That asymmetry is R-5/R-6's recorded principle applied in the affirmative: the escape hatch reports its opacity because the graph cannot see inside it; a node graph does not, because the graph can. A shader source string is what would have destroyed this, and none exists at any tier (§96; RFC 0001).

    The graph must be "screen"-domain: it may read "uv" (the pass's own normalized coordinate), uniform nodes (valued per pass, below), texture nodes, and time (§9 render time) — and nothing of a mesh, which a full-screen pass does not have.

    interface GraphEffect {
        graph: ShaderGraph;
        kind: "graph";
        textures?: Readonly<Record<string, RenderTargetTexture>>;
        uniforms?: Readonly<Record<string, number | readonly number[]>>;
    }
    Index

    The "screen"-domain §60 graph — validated at addPass (§85).

    kind: "graph"

    Required, and the only value — the discriminant.

    textures?: Readonly<Record<string, RenderTargetTexture>>

    Additional sampled inputs, by the sampler names the graph uses — EffectRenderPass.source carries exactly one surface, and it is bound to the graph's "source" sampler; a graph naming more declares each here, which is precisely what keeps the pass's full sample set visible to RenderGraph.validate().

    uniforms?: Readonly<Record<string, number | readonly number[]>>

    Values for the graph's uniform nodes, by name — the per-pass analogue of NodeMaterial.setUniform. Optional per uniform: an unset uniform reads as zeroes on every backend (GL's own initial value). Validated against the graph's reflection at addPass (§85).