12-28-2021 12:18 PM
I'm trying to use OVROverlay to render some text in a scene clearly. I've got it working, but it has different behavior on Quest 2 vs PCVR. On the former, it's always on top. On the latter, it's in the proper depth but you can make it the other way by turning off Shared Depth Buffer in PC XR settings or checking No Depth Buffer Testing on the OVROverlay script.
I'm wondering if there's something the Quest just doesn't support to make it work with the proper depth. There's no similar setting I can find like Shared Depth Buffer for Quest/Android. As far as I could tell, it seems GL_OES_depth_texture extension is what's needed to support that, and when the app runs it seems to report GL_OES_depth_texture as being on. Trying to figure out if there's some way to get it to work like it does on PCVR but coming up with nothing. Maybe Quest really doesn't support it for performance reasons but it's hard to tell.
06-22-2022 12:43 PM
I did wind up making this work with the punch through method. But I'm still interested in why it's working one way on PCVR and not on the other.
09-27-2022 09:25 PM
I'm facing this very same problem. Not sure why I can't select a shared depth buffer. How did you manage to make this work?
09-27-2022 09:36 PM
Unfortunately, I don't have a tidy piece of code handy that I can just pass on. But the method of using an Underlay and "punching a hole" through it with an alpha mask is explained here:
https://developer.oculus.com/documentation/unity/unity-ovroverlay/
Try to implement that and if you really can't get it to work, reply and I'll try to cobble together something.
09-28-2022 11:32 AM
I see, no worries. I thought you had found a solution with the Overlay type.
Thanks for the data, will evaluate if we wanna make the punch through method or just fall back to rendering the texture in a quad in the eye buffer.
09-28-2022 11:35 AM
Yes, it's kind of confusing in terminology, because it's an OVROverlay with the "Current Overlay Type" property set to Underlay. I never got it to work anywhere but always on top on native Quest apps when using that option set to Overlay.
For what it's worth, I didn't get a big performance hit when I implemented it as an Underlay punch through.
08-17-2023 12:00 PM
Where you using URP? I can't seem to get an OVROverlay set to Underlay to work. I've got a converted shader that I think is correct, I've also tried a standard UI/Transparent shader, but with it on a Layer that uses the URP Renderer's Render Objects feature to render it right after rendering all opaques. But nothing seems to properly punch a hole. (my content will show up if I stop rendering everything else though, or on top of everything if I set it to Overlay.)
08-17-2023 12:17 PM
We definitely weren't using URP.