Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Rendering in black on one eye on Oculus Quest

Discussion in 'Shaders' started by xtr33me, Jan 5, 2020.

  1. xtr33me

    xtr33me

    Joined:
    Nov 2, 2011
    Posts:
    90
    I haven't messed much with shaders, outside of modifying existing compute shaders in the past. I have recently picked up an Oculus Quest and I have been working on converting over a project I had working some time back to work with the Quest. When running in the editor, all works as expected, however when I run it on the Quest and trigger the data points to display, I get a black screen rendering in one eye with neon colors at my data points.

    From researching, I believe the issue has to do with the fact that the quest supports es3.1 and geometry shaders seem to not be supported until es3.2. Now I have found others that state they have gotten geometry shaders running on the Quest. So first-off I was hoping to get a definitive answer to whether I can run geometry shaders on a device (quest) which support es3.1. Secondly, if so, are there things that I can look for in a Geo Shader that will cause issues with the Quest? When I'm not using the shader, my points are inverted and not lining up correctly. When looking more into the shader, it seem the geometry shader portion is manipulating the positions while also manipulating the data points billboard images rendered. Also, does the new LWRP change any of the above? I need to still research more on that space, to see what benefits I get with that. Currently I am not using the LWRP.

    Finally, if geo shaders are not supported at all, is there some reading or examples on how to go about converting a geo shader over to a compute shader? I have gone about attaching the shader file rather than pasting the code should it add more context.

    Any light or direction would be extremely helpful! Thanks!
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,332
    The Oculus Quest uses the Adreno 540 GPU which supports GLES 3.2 (which is mostly equivalent to GLES 3.1+AEP). So geometry shaders should work. Indeed the fact you see anything at all when you use the shader means the geometry shader stage is working. Orientation being different is likely a platform difference. Most people writing geometry shaders are only testing on D3D since the most common OpenGL platforms (Android & Mac) often don't support them.

    Assuming you're running on Windows, you could try running your editor in forced OpenGL mode and see if the same visual errors show up for you.
    https://answers.unity.com/questions/447206/forcing-opengl-in-windows-editor.html
    (If you're using Unity Hub to launch the editor, you can add command line arguments by clicking on the vertical ... on the right side of the project line.)

    However, geometry shaders might not be particularly performant. So even if it works it might not be a good idea to use them.

    There the other issue that geometry shaders might not particularly well tested on the Quest, so all of the other rendering tricks being used for VR might cause problems with geometry shaders to make them not work, even though the hardware technically supports it.
     
    Last edited: Jan 5, 2020
    MaxEden and xtr33me like this.
  3. xtr33me

    xtr33me

    Joined:
    Nov 2, 2011
    Posts:
    90
    Thanks so much bgolus for the reply. The info was helpful and I am going to forcing in unity editor to see if I get the same results. I am going to do a bit more reading on shaders and their differences to see if I can gain a deeper understanding of making my own. The link regarding GLES3.1 was here: https://developer.oculus.com/blog/d...lus-quest-the-hardware-software/?locale=en_US However looking at the hardware makes way more sense so thank again! Perhaps the article was written before GLES 3.2.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,332
    Adreno GPUs have supported GLES 3.2 since 2015. However, I’m guessing Oculus themselves have chosen not to support it in combination with the other customizations they’ve made. So the GPU supports 3.2, and the Geometry shader itself “runs” with out any compilation errors, but the Quest software does not. I guess that’s why it doesn’t render correctly.

    You could try forcing on Vulkan and see if it works better there.
     
  5. xtr33me

    xtr33me

    Joined:
    Nov 2, 2011
    Posts:
    90
    Just wanted to post a followup to this should anyone else run into anything similar. A response from panayot.cankov here: https://forums.oculusvr.com/developer/discussion/68145/go-geometry-shader-substitue-unity stated that he was able to get his GS working by forcing an MSAA of 0. I set the option to 0 in Unity and then I'm using the OVRManager as well. So there is a checkmark next to "Use recommended MSAA level". I unchecked this option and now things are working correctly for me regarding Geometry Shaders. I have some other shaders I need to work on to see if it works across all of them now, but I was able to get things at least working to some degree with this approach.
     
    Last edited: Jan 15, 2020
  6. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,450
    I wonder when or if the Quest will support OpenGLES 3.2?