oculus-samples / Unity-StarterSamples

This repository brings multiple samples that can help you explore features and bring them into your project.
Other
127 stars 37 forks source link

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

Closed robbbbbb closed 3 months ago

robbbbbb commented 5 months ago

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:

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 commented 5 months ago

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

image
robbbbbb commented 5 months ago

@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 commented 5 months ago

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 commented 4 months ago

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 commented 3 months ago

We released v65 with the fix for this.

WikkidEdd commented 3 months ago

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