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

    Mesh surface material rendered via TSL / NodeMaterial.

    Hierarchy

    • NodeMaterial
      • MeshTSLMaterial

    Implements

    Index
    uniforms: Record<string, THREE.IUniform>

    Public uniforms table, same shape as MeshMaterial.uniforms.

    tslNodes: MeshMaterialTSLNodeTable
    _explicitDepthTest?: boolean

    Explicit depthTest / transparent overrides from the constructor config. Every rebuildGraph() re-applies the factory tail's MODE-DERIVED blending state, so an override honored only in the constructor would silently revert on the first later rebuild. The GLSL twin never rebuilds, so its constructor-tail overrides stick; persisting them here keeps the two contract-identical. An explicit applyBlendingMode() clears both — a runtime mode switch takes full ownership of the blending state, matching the GLSL twin.

    _explicitTransparent?: boolean
    • Refresh the colormap TSL nodes so they bind the current this.uniforms.uColormap*.value. TextureNode binds a specific Texture at construction, so a swap needs a fresh node — hence this lives in rebuildGraph(). Mirrors PointTSLMaterial.rebuildColormapNodes.

      Parameters

      • useColormap: boolean

      Returns void

    • (Re)create the base-colour texture node, mirroring rebuildColormapNodes.

      A fresh node is required rather than a value write, and that is the whole reason this method exists: texture() CAPTURES its THREE.Texture at construction, so mutating uniforms.uBaseColorTex.value afterwards changes nothing the graph reads. A swap that only wrote the uniform would leave the mesh sampling the previous image — and on a dataset switch, an image belonging to a node that no longer exists.

      Parameters

      • useBaseColorTexture: boolean

      Returns void

    • Re-run the TSL factory and attach the resulting vertexNode / colorNode + blending state to ourselves. Every variant flag is read back out of defines, the same source of truth the GLSL twin's preprocessor consumes.

      Returns void

    • Parameters

      • _resolution: Vector2
      • _isOrtho: boolean = false
      • OptionalnearCull: number
      • Optional_pixelRatio: number

      Returns void

      MeshMaterial.updateCameraParams — _resolution / _isOrtho are accepted and ignored (a mesh has no screen-space size, and the near fade's ortho test reads cameraProjectionMatrix); only nearCull is consumed. It is a plain runtime uniform, so this never rebuilds the graph.

    • Swap the base-colour texture. The TSL twin of MeshMaterial.updateBaseColorTexture, and it rebuilds on a texture-identity swap as well as an on/off flip — texture() captures the Texture at factory-call time, so writing the uniform alone would leave the graph sampling the old image.

      Routed through the shared colour-source resolver rather than toggling its own define, so dropping a texture from a node that also has a colormap LUT re-enables USE_COLORMAP instead of leaving the mesh with no colour source.

      Parameters

      • texture: Texture<unknown, TextureEventMap> | null
      • luminance: boolean = false

      Returns void

    • Toggle the colormap branch. Rebuilds on an on/off flip OR a texture-identity swap: TSL's texture() captures the Texture at factory-call time, so a swap needs a fresh node too. (The GLSL twin gets away with a plain uniform write because ShaderMaterial reads the IUniform by reference at render time.)

      Parameters

      • texture: DataTexture | null

      Returns void

    • Bind a colormap LUT texture (or null to disable colormap mode).

      When texture is non-null, the USE_COLORMAP define is added and the uniforms (uColormapTex, uScalarMin, uScalarScale) are allocated with neutral defaults if they don't exist yet. When texture is null, the define is removed and the uniform values are cleared so a subsequent clone() doesn't resurrect a stale colormap.

      No-op when called on a material whose shader path doesn't include USE_COLORMAP-guarded uniforms.

      Parameters

      • texture: DataTexture | null

      Returns void

    • Update the scalar range [min, max] the colormap maps over. Encoded as uScalarMin = min and uScalarScale = 1/max(1e-10, max-min) for the shader. No-op when colormap mode is not active (uniforms are absent until setColormapTexture has been called once).

      Parameters

      • min: number
      • max: number

      Returns void