Documentation
    Preparing search index...

    Interface NodeMaterialProgram

    One compiled node program — the surface the renderer's draw loop (and its §70 graph-effect path) needs. One instance per distinct graph structure per context; any number of materials share it.

    interface NodeMaterialProgram {
        textures: readonly string[];
        unitBase: number;
        viewStamp: number;
        setMaterial(material: NodeMaterial): void;
        setModel(matrix: Matrix4): void;
        setTime(seconds: number): void;
        setUniform(name: string, value: ArrayLike<number>): void;
        setViewProjection(matrix: Matrix4): void;
        use(): void;
    }

    Implemented by

    Index
    textures: readonly string[]

    The sampler names this program binds, in reflection order (§33) — the renderer resolves each through its own texture caches and binds unit unitBase + index.

    unitBase: number

    The first texture unit this program's samplers occupy: 2 for a "surface" program (0 is the albedo map's, 1 the §69 shadow map's — both may be live in the same frame), 0 for a "screen" program (an effect draw shares the frame with neither).

    viewStamp: number

    The per-view upload stamp: the renderer compares it against its own view counter and re-uploads the view-projection (and render time) only when this program has not seen the current view — many materials, one program, one upload per view. Owned by the renderer; initialised to -1.

    • Uploads §9 render time, mirrored — a no-op for a graph with no time.

      Parameters

      • seconds: number

      Returns void

    • Uploads one uniform by name (the §70 graph-effect path, whose values live on the pass). Unknown names are ignored — §61 forbids a frame from throwing, and validateEffectRenderPass already refused them at setup.

      Parameters

      • name: string
      • value: ArrayLike<number>

      Returns void