We are currently optimising a OpenXR VR game in Unity 6 URP to run on the Meta Quest 2. Our game is currently GPU bound and while analysing with the frame debugger & renderdoc meta fork, we found out that the XR Occlusion Mesh pass is not drawn.
We tried the following:
Setting XRSettings.useOcclusionMesh to true
Trying a blank project
Disabling many options in URP assets
Downgrading to unity 2022
We dug a little deeper and found out no occlusion mesh is returned in XRDisplaySubsystem.XRRenderParameter
My question is:
Is not having the XR Occlusion Pass intended or is it a bug ?
If it is intended why is that since to my knowledge this should improve performance ?
Thanks for your reply. I’m not sure about confusing the two. To my understanding: Occlusion culling is used for hiding object behind others.
On the other hand, the occlusion mesh is a mesh drawn on the headset area where the user cannot physically see. This coupled with ZWrite On prevent the game pixels from being drawn in this area, saving performance. (Cf https://docs.unity3d.com/ScriptReference/XR.XRSettings-useOcclusionMesh.html)
While URP rendergraph uses this in the editor (cf screens)
I reported a bug a while ago that on Unity 6 performance is pretty bad on Meta Quest build as soon as render graph is being used. Maybe that’s related. Do you get same performance impact / missing occlusion mesh if you switch to legacy mode (render graph off)?
Could not really try as our game rely way too much on the render graph, but i can confirm we see the terrible performance on the CPU main thread due to the render graph. (But the XR occlusion mesh would not solve that issue, it will just help with GPU performance)
Thanks for sharing. Shared it on some of my socials to get it voted some more!
For the occlusion mesh, I know this was an optimization on PC, but does it also work well on mobile? I ask because clipping or transparency is really bad on mobile. Haven’t seen it been used myself so far