Visual → pick sync: everything that decides WHETHER an element is visible,
and which of two overlapping elements the user sees, copied from each
node's visual material onto its pick material before every pick render —
the one place the pick pass learns about the node it stands in for.
A pick shader re-derives each element's footprint and visibility itself, so
every input the visual pass consults for "is this element on screen" must
reach the pick pass with the same value — otherwise an element culled or
faded out on screen stays pickable (or a visible one becomes unpickable).
Most of those inputs are written on the VISUAL material only (by the Layers
panel, the LOD fade, the density guard, the embedder API, the commit layer),
so the pick render pulls them across here rather than every writer having
to know the pick material exists.
The UNIFORM inputs (PICK_SYNC_INPUTS): a table keyed by the
pick-side uniform. Duck-typed on material.uniforms, so it serves the
GLSL ShaderMaterial records and the TSL wrappers' proxyIUniform
records alike; each pick material declares exactly the uniforms it
consumes, and an input whose pick uniform is missing (or whose visual
value is not a finite number) is skipped. Which inputs reach which pick
type is therefore the set of uniforms that type declares —
pickSyncedInputs lists it.
The DEPTH CONVENTION: front-most wins under the depth-ordered surface
modes, brightest wins under the commutative ones, through the pick
material's capability (MeshPickAwareMaterial for mesh, which also
carries the opaque cutout and face culling; SurfacePickAwareMaterial
for points, lines and gsplats).
The camera half (pick-target resolution, near cull, pixel ratio, the TSL
line graphs' ortho variant) is NOT here: it is the CameraAwareMaterial
broadcast renderPickBuffer re-issues for the half-resolution pick target.
Every shader derives the ortho branch itself from the projection matrix.
Visual → pick sync: everything that decides WHETHER an element is visible, and which of two overlapping elements the user sees, copied from each node's visual material onto its pick material before every pick render — the one place the pick pass learns about the node it stands in for.
A pick shader re-derives each element's footprint and visibility itself, so every input the visual pass consults for "is this element on screen" must reach the pick pass with the same value — otherwise an element culled or faded out on screen stays pickable (or a visible one becomes unpickable). Most of those inputs are written on the VISUAL material only (by the Layers panel, the LOD fade, the density guard, the embedder API, the commit layer), so the pick render pulls them across here rather than every writer having to know the pick material exists.
Two parts, both run by syncPickFromVisual:
material.uniforms, so it serves the GLSLShaderMaterialrecords and the TSL wrappers'proxyIUniformrecords alike; each pick material declares exactly the uniforms it consumes, and an input whose pick uniform is missing (or whose visual value is not a finite number) is skipped. Which inputs reach which pick type is therefore the set of uniforms that type declares — pickSyncedInputs lists it.MeshPickAwareMaterialfor mesh, which also carries theopaquecutout and face culling;SurfacePickAwareMaterialfor points, lines and gsplats).The camera half (pick-target resolution, near cull, pixel ratio, the TSL line graphs' ortho variant) is NOT here: it is the
CameraAwareMaterialbroadcastrenderPickBufferre-issues for the half-resolution pick target. Every shader derives the ortho branch itself from the projection matrix.