Documentation
    Preparing search index...

    Class WebgpuPickingService

    @fourjs/render's PickingService, executed on the WebGPU backend — see the module header for the pass, the interface for the contract. Built by WebgpuRenderer.createPickingService() once registerPickingPipeline has run; one service per call, each with its own id buffer.

    Implements

    Index
    • 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".

      Parameters

      Returns Promise<PickResult>

    • 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.

      Parameters

      Returns void