Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    A single shader for one material / pass.

    Carries the TSL webgpu factory (primary) and the GLSL3 webgl strings (reference / fallback). Both are optional but at least one must be present — enforced by buildMaterial at construction time, not by the type system, so shader authors can author either backend first.

    The webgpu field deliberately uses unknown rather than importing NodeMaterial types so this module stays three-version-agnostic.

    interface ShaderSource {
        name: string;
        webgl?: WebGLShaderSources;
        webgpu?: (uniforms: Record<string, unknown>) => unknown;
    }
    Index
    name: string

    Stable identifier for diagnostics (point, bloom-threshold, …).

    GLSL3 strings for THREE.ShaderMaterial. Optional — present today on every Luxar shader as the GLSL reference, but a future shader could ship without it if no reference is needed.

    webgpu?: (uniforms: Record<string, unknown>) => unknown

    TSL / NodeMaterial factory for the WebGPU backend. Returns the renderer-specific material; the shape is intentionally unspecified so this module stays three-version-agnostic.