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

    Module rendering/picking/point/pick.tsl

    Point picking material TSL factory — NodeMaterial counterpart to the GLSL3 picking shader in shaders.ts::POINT_PICK_SOURCE.

    Renders one tight sprite per point with output:

    • R: nodeId (set as uniform)
    • G: elementId LOW 16 bits (= aSortedIndex, the STORAGE slot — identical to the draw slot under Phase-1 identity ordering, and stays the id the rest of the pipeline addresses points by once the sort worker permutes draw order in Phase 2+)
    • B: brightness (super-Gaussian falloff at the fragment position)
    • A: the same elementId's HIGH 16 bits (one f32 channel cannot carry the whole index exactly — see luxarElementIdParts)

    Per-point data comes from the RGBA32F point texture (uPointTex, 3 texels/point; picking needs texels 0-1 only — center/radius/ sharpness), fetched in the vertex stage via textureLoad and indexed by aSortedIndex (visual-factory parity, shader-tsl.ts).

    Depth is set to 1.0 - brightness (brightness-as-depth) so the picking system's tie-breaking prefers the brightest hit. Matches the GLSL gl_FragDepth = 1.0 - clamp(brightness, 0.0, 1.0) path.

    The pick sprite is 80% of the radius of the visual sprite (the 0.8 factor below) — slightly tighter than the visible disc so overlapping points still resolve to the one whose core you're over, but forgiving enough that sparse points don't need pixel-perfect aim. Keep in sync with shaders.ts.

    PointPickTSLNodes
    pointPickWebGPUFactory
    buildPointPickTSLNodesFromUniforms