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

    A material that can re-point itself at the graph of a projection kind.

    Hierarchy

    • NodeMaterial
      • LineTSLMaterial

    Implements

    Index
    uniforms: Record<string, THREE.IUniform>

    Public uniforms table, same shape as LineMaterial.uniforms.

    tslNodes: LineMaterialTSLNodeTable
    _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 updateLineTexture 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). Mirrors PointTSLMaterial.

    _explicitTransparent?: boolean
    _orthoVariant: boolean = false

    The projection kind of the camera last drawn with (quad variant only).

    • 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().

      Parameters

      • useColormap: boolean

      Returns void

    • Re-run the TSL factory and attach the resulting nodes + blending state to ourselves. useColormap reads defines.USE_COLORMAP, not the IUniform presence (mirrors GSplatTSLMaterial / PointTSLMaterial).

      Returns void

    • Point the material at the shared graph of its current configuration (defines, primitive, join, texture width and — for the quad — the projection variant) and re-apply the per-material blending state. No leaf is recreated, so a projection-variant switch costs a cache lookup.

      Returns void

    • Re-apply the explicit constructor overrides over the factory tail's mode-derived blending state — on EVERY rebuild, not just the constructor's, so a texture/gamma/colormap rebuild can't silently revert them (see the _explicitDepthTest field doc).

      Returns void

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

      Parameters

      • tex: DataTexture | null

      Returns void

    • Camera-dependent uniforms. The pixel-width scale AND the ortho branch are read in the graph from the projection matrix of the draw (projectionSizeScaleTSL() / isOrthoProjectionTSL(), the GLSL twin's luxarLineScale / luxarLineIsOrtho), so neither is pushed — a camera-kind flip selects no graph and rebuilds nothing.

      Parameters

      • resolution: Vector2
      • OptionalnearCull: number
      • pixelRatio: number = 1

      Returns void

    • Select the screen-space quad's projection variant for the camera this draw uses (ProjectionVariantMaterial; called from the line mesh's onBeforeRender, _shared/projection-variant.ts). The quad's graph bakes the ortho test as a constant (a runtime switch measured +4.6% on the ortho quad under WebGPU), so the material re-points at the other kind's SHARED graph — built once per configuration and kind, then a cache hit — only when the drawn camera's kind differs from the last one. Nothing is pushed from the CPU, so the environment capture's cube faces and the main view each get their own variant. The capsule reads the ortho test at runtime and ignores this.

      Parameters

      • camera: Camera

      Returns void

    • Update the volumetric absorption coefficient κ (composed node attr). Plain uniform write through the proxy — no rebuild needed (the node identity is stable). Mirrors PointTSLMaterial.updateAbsorption.

      Parameters

      • absorption: number

      Returns void

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

      Parameters

      • hasAlpha: boolean

      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

      • tex: 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