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

    Module rendering/materials/mesh/material-tsl

    TSL / NodeMaterial counterpart to MeshMaterial.

    Mirrors the GLSL wrapper one-for-one — same MeshMaterialConfig, same update methods, same applyBlendingMode + clone semantics, same CameraAwareMaterial / ColormapAwareMaterial surface — so MaterialManager.getMeshMaterial is a drop-in swap and no caller sees the divergence.

    Uniform plumbing. This class owns one persistent UniformNode per shader input in tslNodes, and the public uniforms record exposes each as an IUniform-shaped getter/setter proxy, so material.uniforms.X.value = … lands straight on node.value with no per-render callback bridge. Identical to the three sibling TSL wrappers.

    What needs a graph rebuild. The factory branches on JS-side conditionals for the colormap path, the gamma/GOG fast paths, the flat-normal variant and the emission shape, so each of those changes the shape of the graph and rebuilds. Everything else — opacity, intensity, offset, the four lighting controls, alpha cutoff, scalar range, and the near-fade start — is a plain runtime uniform and never rebuilds. The near fade's ortho test in particular must NOT be a build flag: the ortho-mode toggle would otherwise recompile every mesh graph in the scene, which is why this graph takes perspectiveNearFadeTSL, fed from cameraProjectionMatrix per draw, rather than the compile-time-ortho variant the line graphs use.

    MeshTSLMaterial