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

    Module rendering/materials/gsplat/shader-tsl

    GSplat material TSL factory — NodeMaterial counterpart to the GLSL3 shaders in shader-glsl.ts.

    Renders each Gaussian splat as an oriented quad in screen space. Per-vertex aQuadCorner (±1) scaled by the 2D covariance eigen- vectors gives an axis-aligned bounding quad of the Gaussian's truncation extent.

    Per-splat data comes from the RGBA32F splat texture (uSplatTex, 4 texels/splat — layout in rendering/element-texture-layout.ts), fetched in the vertex stage via textureLoad and indexed by the ordering attributes (double-buffered pair):

    • aSortedIndex (uint) — draw-slot → storage-slot mapping (identity in Phase 1; the sort worker permutes it in Phase 2+)

    Vertex pipeline: 0. Fetch center/cholesky/amplitude/color from the splat texture.

    1. Project centre to camera space.
    2. Reject splats behind camera (gl_Position = -2 NDC).
    3. Rotate 3D Cholesky to camera space; Σ_cam = L_cam·L_camᵀ.
    4. Apply near-plane fade (perspective only) + coverage fade (both projections).
    5. Project covariance via Jacobian: Σ_2D = J·Σ_cam·Jᵀ.
    6. Compute 2D Cholesky for the fragment Mahalanobis math.
    7. Sum vs max projection modes: sum integrates along ray (needs Σ_cam⁻¹ via 3×3 cofactor expansion); max uses peak.
    8. Eigendecompose Σ_2D → major/minor axes → oriented quad.
    9. Clamp quad to viewport bound.
    10. Project to NDC + write gl_Position with proper clip-space z.

    Fragment pipeline:

    • Mahalanobis distance from packed [invL00, L10, invL11].
    • Truncation discard.
    • Shifted Gaussian intensity: a · scale · max(0, exp(-r²/2) - C).
    • GOG (gain/offset/gamma) + opacity multiply on output RGB.
    GSplatTSLConfig
    GSplatTSLNodes
    gsplatWebGPUFactory
    buildGSplatTSLNodesFromUniforms