Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...
    • Squared Mahalanobis radius beyond which NO gsplat fragment can survive the shaders' discard tests — the CPU mirror of the vertex-stage footprint math in shader-glsl.ts / shader-tsl.ts and the two pick shaders.

      A fragment at squared Mahalanobis distance m survives only if m <= T² (truncation discard), and P · (exp(−m/2) − C) >= floor (visibility discard), where P is the per-splat peak scale (vAmplitude2D / (1 − C), times the alpha factor and max(gain, 1) in the visual shader) and C = exp(−T²/2). The second condition rearranges EXACTLY to m <= −2·ln(C + floor/P), so the surviving set is the ellipse of squared radius min(T², −2·ln(C + floor/P)). For bright splats that is T² (unchanged); a dim splat's visible core can be far smaller, yet the quad used to be sized for T regardless.

      P is inflated by GSPLAT_FOOTPRINT_PEAK_MARGIN first, which only GROWS the returned radius (conservative).

      Parameters

      • peakScale: number

        P as defined above (before the margin).

      • shiftC: number

        C = exp(−T²/2) (the uShiftC uniform).

      • truncateSq: number

        T² (the uTruncateSq uniform).

      Returns number

      The squared radius, or a negative number when no fragment of the splat can pass (P <= 0, or even the peak falls below the floor) — the shaders cull such a splat outright. A NaN P returns T² (the legacy quad).