Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

OVROverlay hides controller models

AndyDeveloperAndyDeveloper Posts: 3
edited May 2019 in Unity Development
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?


  • MikeSwansonMikeSwanson Posts: 39
    Brain Burst
    You need to configure the OVROverlay as an underlay. See: https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovroverlay/
  • AndyDeveloperAndyDeveloper Posts: 3
    edited June 2019
    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. 
  • yesbirdyesbird Posts: 21
    Brain Burst
    edited June 2019
    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 "Underlay 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.

    Oculus GO / Unity 2018.4.1f1 / Oculus Integration 1.37

  • daniel.gorgen.9daniel.gorgen.9 Posts: 2
    edited October 2019
    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. 

    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-555Heaney-555 Posts: 132
    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?
Sign In or Register to comment.