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

    GSplat material for volumetric Gaussian splatting.

    Each splat is rendered as an oriented quad expanded based on the 2D projected covariance eigenvalues. The fragment shader evaluates the Gaussian density using Mahalanobis distance from the projected center.

    Hierarchy

    • ShaderMaterial
      • GSplatMaterial

    Implements

    Index
    • Update the viewport-dependent uniforms. The projection terms (screen centre, covariance Jacobian, ortho test) are read in shader from the projection matrix, so _isOrtho is accepted and ignored.

      Parameters

      • resolution: Vector2

        Viewport resolution

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

      Returns void

    • Update the absorption coefficient κ (volumetric mode only — a plain uniform write, no recompile; inert in every other mode).

      Parameters

      • absorption: number

      Returns void

    • Declare whether the committed dataset's colors carry a per-splat alpha channel (RGBA). Plain uniform write — set by the commit layer once the color layout is known.

      Parameters

      • hasAlpha: boolean

      Returns void

    • Update max extent factor (projected splat size limit as fraction of viewport). Lower values = more aggressive culling of close/large splats (better perf). Default 0.33 means fade starts when a splat fills ~1/3 of the viewport.

      Parameters

      • factor: number

      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() fast path is recompiled in/out (mirrors the Line material).

      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). Mirrors LineMaterial._refreshNoGOGDefine.

      Returns boolean

    • Rebind the splat 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.

      Parameters

      • texture: DataTexture | null

      Returns void

    • Update the colormap texture and enable/disable colormap mode.

      Parameters

      • texture: DataTexture | null

        Colormap LUT texture (256x1 RGB), or null to disable

      Returns void

    • Set the scalar data range for colormap normalization.

      Parameters

      • min: number

        Minimum scalar value (maps to LUT index 0)

      • max: number

        Maximum scalar value (maps to LUT index 255)

      Returns void

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

      GSplat-specific because the method sets the uProjectionMode uniform — PEAK (1) for the surface modes (max / normal / opaque, see usesPeakProjection), SUM ray-integral (0) for emissive (additive/luminous/volumetric) — and owns the LUXAR_NORMAL_PREMULT + LUXAR_VOLUMETRIC define lifecycles. Without a type-specific method, the layers panel's generic mat.blending = state.blending would leave a stale uProjectionMode while the framebuffer blend state changed — physically wrong projection.

      normal is gsplat-specific too: the shader emits premultiplied coverage alpha under the LUXAR_NORMAL_PREMULT define (toggled here, alongside the LUXAR_VOLUMETRIC define for the emission–absorption branch), paired with getGSplatNormalBlendingState()'s One / OneMinusSrcAlpha state.

      Used by both the constructor and runtime mode changes from the layers panel. 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