Skip to main content
New Participant
May 31, 2019

OVROverlay hides controller models

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?
    This topic has been closed for replies.

    7 replies

    Up and Coming
    June 1, 2019
    You need to configure the OVROverlay as an underlay. See: https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovroverlay/
    New Participant
    June 3, 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. 
    Up and Coming
    June 14, 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 "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.




    --- Oculus GO / Unity 2018.4.1f1 / Oculus Integration 1.37
    New Participant
    October 11, 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!


    Up and Coming
    February 27, 2020
    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
    New Participant
    July 3, 2021

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

    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.

     

    Let me know if you need more details.

     



    Up and Coming
    November 18, 2022

     nothing worked for me i tried everything !