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

    Points material rendered via TSL / NodeMaterial.

    Designed to satisfy the same surface as PointMaterial so the dispatch in MaterialManager.getPointMaterial is a drop-in. The class extends NodeMaterial (the WebGPU/WebGL-2-fallback-aware material type) instead of THREE.ShaderMaterial.

    Hierarchy

    • NodeMaterial
      • PointTSLMaterial

    Implements

    Index
    uniforms: Record<string, THREE.IUniform>

    Public uniforms table, same shape as PointMaterial.uniforms.

    tslNodes: PointMaterialTSLNodeTable
    _explicitDepthTest?: boolean

    Explicit depthTest / transparent overrides from the constructor config. Every rebuildGraph() re-applies the factory tail's MODE-DERIVED blending state (depthTest/transparent included), so an override honored only once in the constructor tail would silently revert on the first later rebuild (e.g. the guaranteed placeholder→real updatePointTexture rebuild at first commit). The GLSL twin never rebuilds, so its constructor-tail overrides stick; persisting them here and re-applying at the end of rebuildGraph keeps the two backends contract-identical. An explicit later applyBlendingMode() call CLEARS both (a runtime mode switch takes full ownership of the blending state — matching the GLSL twin, where applyBlendingStateToMaterial overwrites both fields unconditionally).

    _explicitTransparent?: boolean
    • Refresh the colormap TSL nodes so they bind to the current this.uniforms.uColormap*.value. TextureNode is bound to a specific Texture instance at construction; a texture swap requires a fresh node, hence this lives in rebuildGraph(). Mirrors LineTSLMaterial.rebuildColormapNodes.

      Parameters

      • useColormap: boolean

      Returns void

    • Re-run the TSL factory and attach the resulting vertexNode / colorNode + blending state to ourselves. Called from the constructor and from updateColormapTexture when the colormap state changes (the colormap branch is gated on a JS-side if, so the graph itself changes shape; TSL's texture() captures the Texture object at factory-call time so a swap also requires a rebuild).

      Drives useColormap from defines.USE_COLORMAP — the same source of truth the GLSL wrapper uses. Probing !!this.uniforms.uColormapTex would be wrong because setColormapTexture(null) keeps the IUniform object around with .value = null (mirroring PointMaterial's behaviour); the uniform existence outlives the colormap-enabled state.

      Returns void

    • CameraAwareMaterial. Same body shape as PointMaterial: mutate this.uniforms.X.value; the writes land directly on the wrapper-owned TSL uniform nodes via the proxyIUniform bridges. The projection terms are read in the graph from cameraProjectionMatrix, so _isOrtho is accepted and ignored.

      Parameters

      • resolution: Vector2
      • _isOrtho: boolean = false
      • OptionalnearCull: number
      • pixelRatio: number = 1

      Returns void

    • Update the volumetric absorption coefficient κ (composed node attr). Plain runtime uniform — no graph rebuild. Mirrors GSplatTSLMaterial.updateAbsorption.

      Parameters

      • absorption: number

      Returns void

    • Flag whether the committed colors carry a real per-point alpha column (RGBA). Deliberately a uniform, not a define — toggling it never rebuilds the graph. Mirrors GSplatTSLMaterial.updateHasElementAlpha.

      Parameters

      • hasAlpha: boolean

      Returns void

    • Rebind the point data texture. TSL texture() captures the THREE.Texture at factory time, so an identity change needs a fresh node + graph rebuild (exact mirror of GSplatTSLMaterial.updateSplatTexture and the colormap texture lifecycle). No-op when the texture is unchanged — the common per-commit case.

      Parameters

      • tex: DataTexture | null

      Returns void

    • Toggle the colormap branch. Rebuild the graph whenever the colormap state actually changes — either an on/off flip OR a texture-identity swap.

      TSL's texture(value, …) captures the Texture object passed to it at factory-call time; subsequent mutations to iuniform.value don't re-route the underlying TextureNode. So a swap (old non-null → new non-null) needs a graph rebuild too, not just the enable/disable transitions. The GLSL wrapper gets away with a single material.uniforms.uColormapTex.value = texture 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