Skip to content

Raycasters.castRay / FastModelPicker returns only a subset of models in multi-model scenes (3.4 regression, still in 3.4.6)Β #766

Description

@amirmiz

Describe the bug πŸ“

When several top-level fragment models are loaded into one world, components.get(OBC.Raycasters).get(world).castRay() β€” the GPU id-render pick (FastModelPicker / getFullPick) β€” only ever resolves items belonging to a fixed subset of the loaded models. Every other model renders normally but is completely unpickable: Highlighter selection, the measurement snapping picker (GraphicVertexPicker), and anything built on castRay silently stop working on those models.

The same scenes were fully pickable on 3.2.x. FragmentsManager.raycast() (worker BVH) resolves all models correctly at the same pointer position, so geometry/models are fine β€” only the GPU pick path is affected. This looks like the flat-multi-model counterpart of #746 (same FastModelPicker.renderPickPass() logic) and part of the #737/#747 cluster. It is not #747 (null return) β€” ours returns a valid hit for the "winning" subset β€” and we already run 3.4.6 (which includes the #747/#736 fixes), yet it persists.

Reproduction ▢️

No response

Steps to reproduce πŸ”’

  1. Standard Components + World + PostproductionRenderer + OrthoPerspectiveCamera.
  2. fragments.init(workerUrl), load 3+ top-level models as flat roots (fragments.core.load + world.scene.three.add(model.object)); wait for streaming.
  3. Sweep the pointer over the viewport; per position await raycaster.castRay({ position }) and record hit?.fragments?.modelId.
  4. Also fit the camera to each model individually and pick its centre.

Expected βœ… β€” every visible model is pickable; fitting to a model and clicking selects that model.

Actual ❌ β€” only a fixed subset (in a 12-model scene, ~3) is ever returned, even when an "unpickable" model fills the screen. The subset is stable per scene.

Debug findings (instrumented FastModelPicker)

Workaround β€” delegate castRay to FragmentsManager.raycast({ camera, mouse: raycaster.mouse.rawPosition, dom, snappingClasses }); its result is shape-compatible (carries point/normal/distance/localId/itemId/fragments/object/snappingClass/snappedEdgeP1P2/facePoints/faceIndices) and resolves all models. Can share a minimal standalone repro (2–3 small .frags).

Related: #746 (same method, delta variant), #737 (Highlighter, open), #747 (null return, fixed 3.4.6 β€” distinct), #736 (mobile castRay null, fixed 3.4.4).

System Info πŸ’»

components 3.4.6
components-front 3.4.3
fragments 3.4.6, three 0.182.0
camera-controls 3.1.2
web-ifc 0.0.77
Windows/Chrome desktop

Used Package Manager πŸ“¦

npm

Error Trace/Logs πŸ“ƒ

No response

Validations βœ…

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions