Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
2.97k stars 1.11k forks source link

[Bug] Raycasts flicker against ARMesh on Quest 3 #1181

Open camnewnham opened 3 weeks ago

camnewnham commented 3 weeks ago

Unity bug report case number IN-77947

Describe the bug Video describes it best. Raycasts do not consistently hit the mesh provided by the ARMeshManager (Meta OpenXR, Quest 3). While this repro uses interactors to demonstrate this, it also occurs just using plain old Physics.Raycast.

https://github.com/Unity-Technologies/arfoundation-samples/assets/19278856/e6d4653d-a26a-4811-bb29-722a9ef7036c

To Reproduce

  1. Create a new project in Unity 6000.6.4f1 and import the XRI Starter Assets sample. Add dependencies (Quest OpenXR, ARFoundation , etc.)
  2. Add an ARMeshManager and an ARMesh prefab containing a MeshRenderer, MeshCollider and XRSimpleInteractable
  3. Add a XRInteractorReticle to the controllers help visualize the issue.
  4. Perform Space Setup on Quest 3 to get a room mesh.
  5. Build and run the project
  6. Go to settings/privacy and enable spatial data sharing
  7. Return to app
  8. Observe environment is visible
  9. Observe interactor flickers when moved over the spatial mesh

Expected behavior Raycasts consistently hit the spatial mesh.

Actual behavior It appears as if every second raycast misses.


This isn't directly related to these samples as it's using the XRI sample project, but since it's using the ARMeshManager I figured this was an appropriate place to report. Let me know if it belongs somewhere else.

Related (?): it appears that ARMeshManager updates more or less every frame on quest with a very slightly modified transform for the mesh.