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

    Module rendering/post-processing/mega/material-tsl

    TSL / NodeMaterial counterpart to MegaShaderMaterial.

    Mirrors the GLSL MegaShaderMaterial wrapper one-for-one — same constructor shape (MegaShaderConfig), same setter / toggle / getter surface (setExposure, toggleBloom, getToneMapping, …).

    Mechanics:

    • Holds a uniforms IUniform table identical to the GLSL wrapper's shape; the megaWebGPUFactory binds each primitive TSL uniform node to its IUniform via .onUpdate(() => iuniform.value, 'render'). Setter calls mutate this.uniforms.X.value, the change propagates to the GPU on the next render.

    • Feature toggles (toggleBloom, toggleLensDistortion, toggleDetectorNoise, toggleVignette) and tone-mapping mode selection drive the factory's JS-side if branches via the MegaTSLConfig; flipping any of them changes the graph shape, so the wrapper rebuilds the graph and sets needsUpdate = true (the same trigger point the GLSL wrapper uses for its #ifdef-driven recompiles).

    • toggleRawHdrCapture / toggleLinearLdrCapture are EXR/HDR export shortcuts. Each one sets a config flag and rebuilds the TSL graph; the factory then routes around tone mapping / sRGB encoding to mirror the GLSL LUXAR_CAPTURE_RAW_HDR / LUXAR_CAPTURE_LINEAR_LDR defines.

    MegaShaderTSLMaterial