Mesh Picking Material (GLSL backend) for GPU object picking.
Renders the mesh to an RGBA32F pick buffer encoding:
R = nodeId, G = elementId (the VERTEX ordinal) low 16 bits,
B = brightness (the coverage), A = the same ordinal's high 16 bits
Shader source-of-truth lives in ./shaders.ts.
Two deliberate divergences from the sibling pick wrappers, both following the
visual mesh material rather than the pick convention:
A CameraAwareMaterial for only half the usual reason. A mesh has no
screen-space footprint to size, so resolution and isOrtho are ignored (the
near fade's ortho test reads three's isOrthographic); what it does consume
is uNearCull, because the pick pass has to
reproduce the visual near fade or a fading surface would stay fully pickable
(#1431). Registering it therefore routes it into the camera broadcast, exactly
as the visual mesh material.
side is synced from the visual material, not pinned to DoubleSide.
The other three pick materials can hardcode DoubleSide because their quads
are view-facing; a mesh's back faces may be culled on screen, and a pick
material that rasterizes them anyway makes an invisible interior face both
pickable and depth-occluding. See MeshPickingMaterial.setPickSide.
Mesh Picking Material (GLSL backend) for GPU object picking.
Renders the mesh to an RGBA32F pick buffer encoding: R = nodeId, G = elementId (the VERTEX ordinal) low 16 bits, B = brightness (the coverage), A = the same ordinal's high 16 bits
Shader source-of-truth lives in
./shaders.ts.Two deliberate divergences from the sibling pick wrappers, both following the visual mesh material rather than the pick convention:
CameraAwareMaterialfor only half the usual reason. A mesh has no screen-space footprint to size, soresolutionandisOrthoare ignored (the near fade's ortho test reads three'sisOrthographic); what it does consume isuNearCull, because the pick pass has to reproduce the visual near fade or a fading surface would stay fully pickable (#1431). Registering it therefore routes it into the camera broadcast, exactly as the visual mesh material.sideis synced from the visual material, not pinned toDoubleSide. The other three pick materials can hardcodeDoubleSidebecause their quads are view-facing; a mesh's back faces may be culled on screen, and a pick material that rasterizes them anyway makes an invisible interior face both pickable and depth-occluding. See MeshPickingMaterial.setPickSide.