Reputation: 12897
Default behavior of the hand occlusion in RealityKit VisionOS apps is to draw all entities under the hands.
This behavior can be changed with upperLimbVisibility(.hidden)
but this draws all entities over the hands and even hides the hands completely in fully immersive mode.
Is there a way to have some entities drawn over the hands and some entities under?
Or any way to still keep the hands displayed in full immersion but allow to draw entities over them?
Upvotes: 2
Views: 157
Reputation: 1581
In ".visible" everything will be rendered behind the hands. in ".automatic" both worlds are half transparent and ".hidden" everthing will be rendered over your hands.
RealityView { content in
...
}
.upperLimbVisibility(.automatic)
.upperLimbVisibility(.hidden)
Currently there is no way, I believe, how to switch the modes while rendering (e.g. rendering half way with hands fully visible, then turn off the limb and render the rest over it)
I believe its a good way to track you hand and use a completely virtual Hand model instead, if you want to have the users hand interact correctly with the 3d models.
In theory it should be possible to use .automatic or .hidden and just leave the areas out where your hands should be visible. This could be achieved with rendering a virtual hand with a special material that uses masking or clever z-buffer writing. But this is just theory.
Upvotes: 1