ReadonlydisposedWhether PickingService.dispose has run.
Releases the service's GPU resources — its render target and id program
(§83). Idempotent and terminal: update and pick refuse afterwards.
Reads back one texel of the last PickingService.update's id buffer and resolves it to a node id. Asynchronous, always — see the interface documentation.
Refused (§85/§89, as a rejection carrying a FourError): a disposed
service, a pick before any successful update, ndcX/ndcY outside
[-1, 1] or non-finite, a viewport other than the one the last update
drew, and — CONTEXT_LOST — a context lost (or lost-and-restored) since
the id buffer was drawn, because a stale undefined would be
indistinguishable from "nothing there".
Renders the id pass for root/view into the service's own target.
Draws the resolved world transforms (§7) — the caller must have run
resolveWorldTransforms for the frame, exactly as Renderer.render's
non-interpolated path requires. Deliberately never the §43
interpolated pose: a picking pass wants exactly the simulation state
(renderer.ts records this as the interpolation contract's own example).
§85 refusals (thrown from here, the call that can see the mistake): a disposed service, a view whose resolved rectangle has zero area, a candidate count the encoding cannot express. §61 skips (never thrown): a lost context, a target or program the driver refused — the pass is skipped, and the next PickingService.pick reports that there is no id buffer to read.
§71's
"gpu"/"pixel"tier: an offscreen id pass plus an asynchronous single-texel read-back (RFC 0005).The contract is asynchronous on every backend, forever
WebGL 2's plain
readPixelsis a synchronous stall; the non-stalling paths (PIXEL_PACK_BUFFER+ fence on WebGL 2,mapAsyncon WebGPU) are both asynchronous. A capability tier may change quality or availability; it must never change an API's shape (§62) — sopickreturns aPromiseeven on a backend that could answer synchronously, and the result carries the PickResult.frame it came from.Cost, and why the pass is opt-in per frame
updateis a second render pass proportional to the render list (§86 gains a row). Nothing runs it for you: an application calls it only on frames it intends to pick against — typically the frame under the pointer event — and a scene that never picks never pays.§96
An id pass is a read-back of rendered content — the classic cross-origin texture hazard. This engine's
TextureSourcecarries raw texels (no origin-tainted handles), so the browser's own canvas-tainting rules are the enforcement tier here: a backend surface that could ever hold tainted content will throw on read-back, and the service reports that failure rather than masking it.