XR Occlusion Mesh missing in Meta Quest headsets?

Hello,

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 time

I think you confuse the XR Occlusion Pass with the classic Occlusion Culling.

The XR Occlusion Pass occlude the 3D environnement of your application to do some mixed really. https://developers.meta.com/horizon/documentation/unity/unity-depthapi-occlusions-get-started/

You can use the standard Occlusion Culling, it works as intended with virtual reality. Unity - Manual: Occlusion culling

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)


image

It simply does not in meta quest builds, that’s the issue i’m facing.

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)

EDIT: Do you have a bug report link for the performance issue ?

EDIT2: I’ll try to use legacy on an empty project to see if the occlusion mesh is present

sure, here:

To confirm, legacy doesn’t have the XR Occlusion Mesh either.

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

Since it rely on Z Testing and not clipping or transparency that should not be an issue for mobile platform I guess

Read the last reply. The feature does indeed not exist on Quest

This post is from 2020, I hope they found a solution since then…

This is the documentation of WaveVR, but maybe Open XR is facing similar issues:
" The XRSettings.useOcclusionMesh will not work if XR Plug-in Management is used. You can only enable and disable the occlusion mesh here."
https://hub.vive.com/storage/docs/en-us/UnityXR/UnityXRSettings.html#rendermask

It’s unlikely that you use something else but I read that Occlusion Mesh is only working with OpenGL ES 3.x or Vulkan API on Android.

I also found the OVRLint.cs script in multiple git. It is used to enable the occlusion mesh (line 610 in this one).

I’ve seen this post online but it was late 2020, and looking at the web, the feature was indeed added in 2021: https://developers.meta.com/horizon/blog/oculus-developer-release-notes-v29/?locale=en_GB

And the message from Nicolqs seems to point the feature is implemented

It seems new OpenXR version fixed the issue