Luxar Viewer API Documentation - v2026.10.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 factory returns a TSL NodeMaterial, not a GLSL ShaderMaterial (which WebGPURenderer cannot draw).

    interface ShaderSource {
        name: string;
        webgl?: WebGLShaderSources;
        webgpu?: (uniforms: Record<string, IUniform>) => NodeMaterial;
    }
    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, IUniform>) => NodeMaterial

    TSL / NodeMaterial factory for the WebGPU backend. Returns the renderer-specific material. This is a type-only reference, so importing the public ShaderSource type does not load WebGPU code.