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

    Line material using instanced quads with semicircle kernel rendering.

    The semicircle kernel produces parabolic intensity profiles that sum correctly at joints when using additive blending:

    • Body intensity: (1 - p²)^sharpness where p = perpendicular distance
    • Endpoint cap factor: 0.5 (half intensity at true endpoints)
    • Joint rendering: 0.5 + 0.5 = 1.0 (seamless sum)

    Hierarchy

    • ShaderMaterial
      • LineMaterial

    Implements

    Index
    • Update camera parameters for world-space line sizing. The pixel-width scale is read in shader from the projection matrix (luxarLineScale); isOrtho still drives the uIsOrtho uniform the vertex AND fragment stages branch on.

      Parameters

      • resolution: Vector2

        Viewport resolution

      • isOrtho: boolean = false
      • OptionalnearCull: number
      • pixelRatio: number = 1

      Returns void

    • Rebind the line data texture (pool acquire may hand the node a different geometry+texture pair on growth or best-fit reuse). Plain uniform update — no shader recompilation involved. Mirrors PointMaterial.updatePointTexture; null falls back to the shared placeholder so the sampler is never unbound.

      Parameters

      • texture: DataTexture | null

      Returns void

    • Update gamma correction. Only invGamma is used in shader; gamma value stored in userData for clone().

      When gamma crosses the 1.0 threshold (with epsilon), toggle the LUXAR_GAMMA_ONE define so the fragment shader's pow() path is recompiled in/out. The Three.js shader-program cache rebuilds the program on needsUpdate = true.

      Parameters

      • gamma: number

      Returns void

    • Toggle the LUXAR_NO_GOG define based on the live uniform values for intensity + offset. Called by both updateIntensity and updateOffset because the flag depends on both values jointly. Returns true if the define changed (caller may need a rebuild).

      Returns boolean

    • Update the volumetric absorption coefficient κ (composed node attr). Plain uniform write — inert unless the material is in volumetric mode. Mirrors PointMaterial.updateAbsorption.

      Parameters

      • absorption: number

      Returns void

    • Flag whether the committed colors carry a real per-endpoint alpha column (RGBA). Set per-commit by syncLineMaterialWithGeometry; gates only the volumetric w(a) optical-depth map. Mirrors PointMaterial.updateHasElementAlpha.

      Parameters

      • hasAlpha: boolean

      Returns void

    • Apply a Luxar blending mode to this material in-place.

      Draws the complete THREE state from the shared getCompleteBlendingState — the same source of truth the Point and GSplat wrappers and the TSL twin use — so creation-time wiring, runtime UI transitions, and both backends can never disagree on blend factors, depth state, or transparency.

      Sets the LUXAR_MAX_RGB_CONTRIBUTION shader define for max mode so the fragment premultiplies RGB by intensity*opacity (required because MaxEquation+OneFactor doesn't multiply by alpha at composite time). After this returns, userData.blendingMode reflects the live mode so subsequent clone() calls preserve it.

      Parameters

      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