cancel
Showing results for 
Search instead for 
Did you mean: 

OVROverlay hides controller models

AndyDeveloper
Explorer
HI all,  I am attempting to build a UI using OVROverlay in Unity.  It looks great BUT on mobile the overlay renders in front of any scene geometry, thus occluding the controller models and pointer rays.  The same behavior can be observed in the OVROverlay scene in SampleFramework. A message in Player Settings indicates that the shared depth buffer is not available on mobile, so I am thinking it might be a limitation.
However, the Oculus Home scene and video player apps don't have this issue. 

Any ideas?
7 REPLIES 7

MikeSwanson
Protege
You need to configure the OVROverlay as an underlay. See: https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovroverlay/

AndyDeveloper
Explorer
Thanks Mike, it worked!!   I set the OVROverlay as an underlay, and added a quad with the Impostor shader to "punch a hole" in the eye buffer.
Unfortunately my overlay is dynamic, translucent, and has irregular edges. I tweaked the Impostor shader to handle the texture's alpha, but the edges flicker a lot. This doesn't happen in overlay mode, perhaps because it's getting the alpha from a clearer texture. 

yesbird
Explorer
Hi guys !

I am trying to do the same thing but can not figure out how to do it.

Doc says: "Use the Underlay Imposter.shader (VR/Resources) on your to draw imposters in the delta space after all opaque textures are drawn, but before the alpha."

The questions are: 
1. What object should use "U
nderlay Imposter.shader" ? I am using special toon shader for all my objects in scene, should I switch them to  "Underlay Imposter" ?

2. How to implement "after all opaque textures are drawn, but before the alpha." What is the method to controls this order ?

Please, provide more details or point to appropriate information source. Any working Unity example could help a lot also.
Thanks in advance.




daniel_gorgen_9
Honored Guest
I had the same problem. Maybe it helps somebody.
In order to "punch a hole” in the eye buffer do the following.

Lets assume you have a quad with an OVROverlay-underlay on it.

- Create a quad with same size and add it to the same position in the scene. Make sure that it comes after your original quad in the tree.

- Create a new material with the "oculus/underlay imposter" shader. 
hnagaa5kck89.png
It is important that the color is all black. Set smoothness and metallic to 1. It even works if you set it to 0, but then the result seems to be too bright. Best is to just try it.

- Add the material to the new quad

Thats it!


Heaney-555
Heroic Explorer
This doesn't work for me. I'm doing exactly as described and yet I still see avatar hands behind the underlay, not in front.

Does anyone have a sample they can share or a possible solution?

Eclectus
Explorer

This does work, for me - I used a new material with the "oculus/underlay imposter" shader, for my Lighting --> Environment --> Skybox Material.

Eclectus_0-1625319558765.png

There is a warning about the material not supporting skybox rendering - but it works fine, my Equirect underlay compositor layer is 'punched through to' by this shader, but rendered geometry (in the eye buffers) appears in front of it as I intend it to, see railings below.

Eclectus_1-1625319701120.png

 

Let me know if you need more details.

 



RoxGame
Protege

 nothing worked for me i tried everything !