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

    Module rendering/materials/gsplat/material-glsl

    GSplat Material for Luxar

    Specialized THREE.ShaderMaterial for rendering Gaussian splats using instanced quads. Implements projection-aware volumetric rendering with oriented, anisotropic Gaussian density functions.

    Key features:

    • Instanced oriented quad geometry (4 vertices per splat)
    • Full 3D covariance via Cholesky factors
    • Perspective-correct projection of covariance to 2D
    • Blending-mode-aware projection (sum ray-integral for emissive additive/luminous, peak for surface max/normal/opaque)
    • Shifted Gaussian falloff: scale · max(0, exp(-½ · r²) - C) with C⁰ continuity at truncation
    • Per-splat attributes (center, cholesky, amplitude, color)

    GPU Optimizations (GLSL ES 3.0 / WebGL2):

    • flat interpolation: skips GPU interpolation for per-instance varyings
    • Reciprocal precomputation: DIV→MUL in vertex and fragment shaders
    • Early discard at truncation radius before expensive exp()
    • Higher intensity threshold (1e-4) for fewer blended pixels
    • mediump precision for color/amplitude to reduce register pressure

    Mathematical basis:

    • GSplat density: G(x) = a · scale · max(0, exp(-½ · ‖L⁻¹(x - μ)‖²) - C)
    • Sum projection: amplitude boost by σ_ray · c_s (ray integration)
    • Max projection: amplitude = a (peak value, no integration)
    • 2D covariance: Σ_2D = J · Σ_cam · Jᵀ (perspective Jacobian projection)
    GSplatMaterial
    GSplatMaterialConfig
    GSplatMaterialUniforms