Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OVROverlay example Depth Buffer Testing doesn't work with OpenXR plugin #13

Closed
robbbbbb opened this issue Apr 3, 2024 · 6 comments
Closed

Comments

@robbbbbb
Copy link

robbbbbb commented Apr 3, 2024

Description

When switching to the OpenXR Plugin the overlay using depth buffer testing in the OVROverlay scene sample no longer composites correctly vs other objects in the scene.

Using the Oculus XR Plugin the compositing works as expected.

Setup

Unity: 2021.3.36f1
Packages: Meta XR Core SDK v 62.0.0; OpenXR Plugin 1.10.0; XR Plugin Management 4.4.0
Device: Quest 3, OS version 63.0.0.399.366

Repro

With no other modifications to the code or project configuration:

  • Open the OVROverlay.unity scene
  • Add a single default cube to the scene, ensure it sits between the camera and the OverlayUIGeometry object
  • Build using Oculus > Samples > Build Starter Scene and deploy to device
  • Select the OVROverlay scene from the starter scene menu
  • Switch between 'OVROverlay' and 'Application' in the menu
  • Note that the cube sorts correctly in front of the background images
  • Back in Unity, install the OpenXR Plugin package
  • Under Project Settings > XR Plug-in Management switch Plug-in Provider to OpenXR
  • Build using Oculus > Samples > Build Starter Scene and deploy to device
  • Select the OVROverlay scene from the starter scene menu
  • Switch between 'OVROverlay' and 'Application' in the menu

Expected Results

The cube sorts correctly in front of the background images, as it does with the Oculus XR plugin.

Actual Results

In 'Application' mode the background images are rendered by the WorldVsOverlayComparison > WorldspaceUIGeometry object rendering on the Default layer directly in to the main camera. In this mode the cube sorts correctly against this geometry.

In 'OVROverlay' mode the background images are rendered by the WorldVsOverlayComparison > OverlayUIGeometry object rendering on the OVROverlayUI layer in to an orthographic camera writing to a render texture. The render texture is then set as the source texture for an OVROverlay component on the OVROverlayQuad-DisplayCamRT object with 'Enable Depth Buffer Testing' flag set. This overlay should sort in front of the cube, but instead the overlay is rendered over the top of the cube.

@tdmowrer
Copy link

Have you set the "Depth Submission Mode" in XR Plug-in Management > OpenXR?

image

@robbbbbb
Copy link
Author

@tdmowrer afraid so, as we were discussing on the other issue thread, when using the Oculus XR plugin you need to check the “Depth Submission (Vulkan)” flag for this to work, but in OpenXR plugin options that doesn’t exist and this one you point out makes no difference, irrespective of whether you choose 16 or 24 bit.

For belt-and-braces I also checked these in the Windows Standalone options tab, just in case Unity was piping these through incorrectly. Also no effect.

@tsaileo-meta
Copy link

Hey @robbbbbb, thanks for bringing this to our attention. This issue has been fixed and is in the pipeline to go out in our v65 SDK. The issue was that the depth testing OpenXR extension wasn't properly being utilized when our Meta XR Feature is enabled.

@robbbbbb
Copy link
Author

Hi @tsaileo-meta thanks for the feedback. There are also a bunch of other issues in this repo which are related (and seem to have simple solutions) just wanted to make sure you were aware of them since nobody's responded as yet:

@AlexThiv
Copy link
Contributor

We released v65 with the fix for this.

@WikkidEdd
Copy link

Thanks @AlexThiv looking forward to trying this. I'm curious though, why isn't this fix mentioned in the release notes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants