I am currently creating an app where two people share an instance of an immersive space so that they are able to point to certain things in the immersive space. Right now, other people are hidden behind the immersive space, and even with people awareness enabled for everything, people are still too difficult to see. I've found this documentation (https://developer.apple.com/documentation/arkit/occluding-virtual-content-with-people) which describes what I want to do, but it is only listed as working on iOS an iPadOS. Is there anything similar to this that will work on VisionOS?
Person Occlusion on the Vision Pro
There's no supported API to enable people occlusion in visionOS. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Please include details about your use case. Once you file the request, please post the FB number here.
If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?
How are you putting 2 people in a shared immersive space? Are you using SharePlay to put their Personas in the same immersive space or are you establishing a common origin (using an image or object anchor) and syncing the positions of 2 people near each other? If it's the latter, here's an idea that may get you closer to people occlusion. Put each person in a virtual box (or shape of your choice) and occlude the box.
- Take a look at Obscuring virtual items in a scene behind real-world items. The sample shows how to use OcclusionMaterial to occlude an entity.
- Use queryDeviceAnchor(atTimestamp:) to get the location of a person's device. You can use the device position to estimate their height and scale/position the shape to contain their body.
Please let me know how it turns out.
Hi @Vision Pro Engineer
I'm using the common origin approach right now, so I'll try your suggestion of using the position of a persons headset to occlude them. I'm also thinking of using the users hand tracking information to occlude their hands as well. Thank you for the advice.