Documentation
    Preparing search index...

    Interface StandardPipeline

    The surface the renderer's draw loop needs from §59's program — StandardProgram's contract, structural so the renderer never names the class that implements it.

    interface StandardPipeline {
        dispose(): void;
        setAmbientLight(color: readonly [number, number, number]): void;
        setBaseColor(
            color: readonly [number, number, number, number],
            opacity?: number,
        ): void;
        setCameraPosition(x: number, y: number, z: number): void;
        setDirectionalLight(
            direction: { x: number; y: number; z: number },
            color: readonly [number, number, number],
        ): void;
        setFeatures(
            useMap: boolean,
            useMetalRoughnessMap?: boolean,
            useEmissiveMap?: boolean,
            useNormalMap?: boolean,
            useOcclusionMap?: boolean,
        ): void;
        setHemisphereLight(lights: SceneLights): void;
        setMapFactors(normalScale?: number, occlusionStrength?: number): void;
        setModel(matrix: Matrix4): void;
        setPunctualLights(lights: SceneLights): void;
        setReceivesShadow(receiving: boolean): void;
        setShadow(lights: SceneLights): void;
        setSurface(
            metalness: number,
            roughness: number,
            emissive: readonly [number, number, number],
        ): void;
        setViewProjection(matrix: Matrix4): void;
        use(): void;
    }
    Index
    • Uploads the scene ambient term (§68).

      Parameters

      • color: readonly [number, number, number]

      Returns void

    • Uploads the base colour, scaled by its opacity.

      Parameters

      • color: readonly [number, number, number, number]
      • Optionalopacity: number

      Returns void

    • Uploads the eye position the specular lobe needs.

      Parameters

      • x: number
      • y: number
      • z: number

      Returns void

    • Uploads the directional light (§68).

      Parameters

      • direction: { x: number; y: number; z: number }
      • color: readonly [number, number, number]

      Returns void

    • Selects the albedo, metal-roughness, emissive, normal and occlusion map switches.

      The last two were added with the S59 normalMap/occlusionMap WebGL work and reached both StandardProgram and the renderer's draw loop, but not this seam - so the renderer's five-argument call failed to compile against its own contract (TS2554). Kept optional so an implementation that predates the maps still satisfies the interface.

      Parameters

      • useMap: boolean
      • OptionaluseMetalRoughnessMap: boolean
      • OptionaluseEmissiveMap: boolean
      • OptionaluseNormalMap: boolean
      • OptionaluseOcclusionMap: boolean

      Returns void

    • Uploads the glTF normal-scale and occlusion-strength factors.

      Offset-encoded by the implementation so GL's zero-initialised uniforms are the glTF defaults; callers pass the material values directly.

      Parameters

      • OptionalnormalScale: number
      • OptionalocclusionStrength: number

      Returns void

    • Switches the shadow comparison per draw (§49's receiveShadow).

      Parameters

      • receiving: boolean

      Returns void

    • Uploads metalness, roughness and the emissive term.

      Parameters

      • metalness: number
      • roughness: number
      • emissive: readonly [number, number, number]

      Returns void