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.
TSL / NodeMaterial counterpart to
MegaShaderMaterial.Mirrors the GLSL
MegaShaderMaterialwrapper one-for-one — same constructor shape (MegaShaderConfig), same setter / toggle / getter surface (setExposure,toggleBloom,getToneMapping, …).Mechanics:
Holds a
uniformsIUniform table identical to the GLSL wrapper's shape; themegaWebGPUFactorybinds each primitive TSL uniform node to its IUniform via.onUpdate(() => iuniform.value, 'render'). Setter calls mutatethis.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-sideifbranches via theMegaTSLConfig; flipping any of them changes the graph shape, so the wrapper rebuilds the graph and setsneedsUpdate = true(the same trigger point the GLSL wrapper uses for its#ifdef-driven recompiles).toggleRawHdrCapture/toggleLinearLdrCaptureare 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 GLSLLUXAR_CAPTURE_RAW_HDR/LUXAR_CAPTURE_LINEAR_LDRdefines.