GLSL3 picking shader source for lines + ShaderSource record.
Mirrors the visual line shader's near-plane safety, max-pixel-width
clamp, and width/sharpness sanitization so the pick footprint stays
in lock-step with the visible footprint. Strips colormap and color
varyings (not needed for picking) and adds the uNodeId uniform and
vNodeId / vElementId varyings written into the RGBA32F pick
buffer as (nodeId, elementId-low16, brightness, elementId-high16).
Overlapping segments resolve by the depth it writes, which follows
uSurfaceDepth (../_shared/surface-pick.ts): brightness-as-depth (the
brightest wins) in the commutative modes, the real projected depth (the
front-most wins) in the depth-ordered opaque / normal modes.
Lines use full pick width (unlike points / gsplats which truncate
— thin lines are already narrow with a sharp parabolic profile).
Source-of-truth for GLSL3; the WebGPU counterpart lives in ./pick.tsl
and is referenced through the ShaderSource.webgpu factory below.
GLSL3 picking shader source for lines +
ShaderSourcerecord.Mirrors the visual line shader's near-plane safety, max-pixel-width clamp, and width/sharpness sanitization so the pick footprint stays in lock-step with the visible footprint. Strips colormap and color varyings (not needed for picking) and adds the
uNodeIduniform andvNodeId/vElementIdvaryings written into the RGBA32F pick buffer as(nodeId, elementId-low16, brightness, elementId-high16). Overlapping segments resolve by the depth it writes, which followsuSurfaceDepth(../_shared/surface-pick.ts): brightness-as-depth (the brightest wins) in the commutative modes, the real projected depth (the front-most wins) in the depth-orderedopaque/normalmodes.Lines use full pick width (unlike points / gsplats which truncate — thin lines are already narrow with a sharp parabolic profile).
Source-of-truth for GLSL3; the WebGPU counterpart lives in
./pick.tsland is referenced through theShaderSource.webgpufactory below.