Interface PickDiscardRule
key: string;
storage?: readonly PickDiscardStorage[];
vertexData?: PickVertexDataAttribute;
wgsl: string;
worldAdjustWgsl?: string;
}
Properties
Readonlykey
Stable cache key for the generated picking pipeline set. Change it when the WGSL or layout changes.
Optional Readonlystorage
Optional typed-array storage inputs exposed to WGSL at group 2.
Optional Readonlyvertex Data
Optional existing regular-mesh attribute forwarded flat as a padded PickDiscardInput.vertexData vec4.
Values come from the mesh's source attribute buffer (not skin/morph-deformed). Meshes without the
requested buffer and all thin instances receive zero.
Readonlywgsl
WGSL source that defines shouldDiscardPick(input: PickDiscardInput) -> bool.
Optional Readonlyworld Adjust Wgsl
Optional WGSL source that defines fn adjustPickWorld(input: PickWorldInput) -> vec3f.
Use it to mirror a visible material's vertex displacement in the GPU pick pass. The hook runs before
projection and fragment discard for regular and thin-instanced meshes. PickWorldInput exposes the base
world/local position, affine basis and origin, spare thin-instance matrix lanes, instance identity, and the
optional selected regular-mesh vertex attribute. Omit for identity projection.
Optional GPU-side discard rule for pickAsync.
This lets apps remove pick hits with custom WGSL while keeping the main scene render untouched. The WGSL must define
fn shouldDiscardPick(input: PickDiscardInput) -> bool.