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

    Variable GSPLAT_PICK_FRAGMENT_SHADERConst

    GSPLAT_PICK_FRAGMENT_SHADER: "\n precision highp float;\n\n flat in mediump float vAmplitude2D;\n flat in highp vec3 vL2D;\n flat in highp vec2 vCenterScreen;\n flat in highp float vNodeId;\n flat in highp vec2 vElementId;\n\n uniform highp float uShiftC;\n uniform highp float uInvOneMinusC;\n uniform highp float uTruncateSq;\n // 1 = surface ('normal') mode: write real projected depth (front-most\n // wins). 0 = commutative modes: brightness-as-depth (brightest wins).\n uniform int uSurfaceDepth;\n\n out vec4 fragColor;\n\n void main() {\n vec2 d = gl_FragCoord.xy - vCenterScreen;\n\n float y0 = d.x * vL2D.x;\n float y1 = (d.y - vL2D.y * y0) * vL2D.z;\n float mahalSq = y0 * y0 + y1 * y1;\n\n if (mahalSq > uTruncateSq) discard;\n\n float intensity = vAmplitude2D * uInvOneMinusC * max(exp(-0.5 * mahalSq) - uShiftC, 0.0);\n if (intensity < 1e-4) discard;\n\n float brightness = clamp(intensity, 0.0, 1.0);\n\n fragColor = vec4(vNodeId, vElementId.x, brightness, vElementId.y);\n // Pick depth convention (synced from the MAIN material's blending\n // mode by PickingSystem.renderPickBuffer):\n // - surface ('normal') mode: the user sees a depth-sorted\n // occluding surface, so write the real projected depth (the\n // vertex puts the splat-center NDC z in gl_Position.z, so\n // gl_FragCoord.z is the true depth) — FRONT-MOST wins.\n // - commutative modes (additive/max/luminous):\n // brightness-as-depth — BRIGHTEST wins.\n gl_FragDepth = (uSurfaceDepth == 1) ? gl_FragCoord.z : 1.0 - brightness;\n }\n" = ...

    Picking fragment shader for gsplats. Outputs vec4(nodeId, elementId-low16, brightness, elementId-high16) with brightness-as-depth (or real projected depth when uSurfaceDepth == 1 — surface/'normal' mode). Uses tighter truncation (1.5σ squared = 2.25) for precise picking.