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

    Mega-shader material rendered via TSL / NodeMaterial. The host uses this exactly like MegaShaderMaterial:

    const mega = materialManager.createMegaShaderMaterial(cfg);
    mega.setHdrSceneTexture(hdrTex);
    mega.setResolution(w, h);
    mega.advanceTime(dt);
    mega.setExposure(2.0);
    mega.toggleBloom(true);
    mega.setBloom(0.25, bloomTex);
    

    Hierarchy

    • NodeMaterial
      • MegaShaderTSLMaterial
    Index
    uniforms: Record<string, THREE.IUniform>

    Public uniforms table, same shape as MegaShaderMaterial.uniforms.

    useBloom: boolean = false
    useLensDistortion: boolean = false
    useDetectorNoise: boolean = false
    useVignette: boolean = false
    toneMappingMode: LuxarToneMappingMode = 6
    captureRawHDR: boolean = false
    captureLinearLDR: boolean = false
    • Re-run the TSL factory with the current feature flags and tone-mapping mode. Called from the constructor and whenever a toggle changes; mirrors the needsUpdate = true recompile the GLSL wrapper triggers via define flips.

      Returns void

    • Parameters

      • p: {
            distortion?: Vector2;
            principalPoint?: Vector2;
            focalLength?: Vector2;
            skew?: number;
            dispersion?: number;
        }

      Returns void

    • Enable/disable the RAW-HDR capture short-circuit. When on, the fragment graph returns the post-bloom linear-HDR sample and skips detector noise, EOG, tone mapping, vignette, and sRGB encoding — matching the GLSL LUXAR_CAPTURE_RAW_HDR define exactly.

      Toggling forces a TSL graph rebuild because the factory branches on this flag (see shader.tsl.ts). Cost is identical to toggling any other feature flag (bloom, vignette, …).

      Parameters

      • enabled: boolean

      Returns void

    • Enable/disable the linear-LDR capture short-circuit. When on, the pipeline runs every enabled effect, EOG, and tone mapping but skips the final linearToSRGB encoding — matches the GLSL LUXAR_CAPTURE_LINEAR_LDR define exactly.

      Parameters

      • enabled: boolean

      Returns void