I believe that ObjectCaptureView from iOS 17 is causing an issue that breaks RealityKit occlusion.
The following code is a minimal reproducible example of the issue, as follows:
- load app, and notice that yellow box will be occluded by the real environment as you move your phone around
- press Switch button in center of screen to go to ObjectCaptureView
- ObjectCaptureView will open (notice the square in middle of screen)
- press Switch button in center of screen - go back to RealityKit view
- notice that box is no longer occluded by environment as you move around
I cannot understand why this is happening, I do nothing except .Start() and .Cancel() the Object Capture Session, but if you remove both Start() and Cancel() the issue still presents. The issue seems to only occur when you call ObjectCaptureView() somewhere in your code.
I have logged a bug with Apple but would really like any feedback - thanks.