Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Optimal Skybox for Mobile VR Oculus Quest/Go/GearVR

Discussion in 'VR' started by ROBYER1, Nov 6, 2019.

  1. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    866
    What's everyone else using for a mobile Skybox on Oculus Quest?

    In the developing for Android guidelines from Oculus it says

    "Avoid Unity’s Default-Skybox, which is computationally expensive for standalone. We recommend setting Skybox to None (Material), and Ambient Source to Color in Window > Lighting. You may also wish to set Camera.clearFlags to SolidColor (never Skybox)."

    https://developer.oculus.com/documentation/quest/latest/concepts/unity-mobile-performance-intro/
     
  2. kilogold

    kilogold

    Joined:
    May 28, 2013
    Posts:
    9
    Gonna necro this, because it's an obvious thing that turns out not to be so obvious.
    Going with a 6 Sided Shader means binding 6 different textures to the graphics pipeline. We can atlas the whole thing, but there doesn't seem to be an out-of-the-box shader for such a thing...

    I'm interested in hearing other people's suggestions.
     
    ROBYER1 and JoeStrout like this.
  3. kilogold

    kilogold

    Joined:
    May 28, 2013
    Posts:
    9
    FWIW, we opted for simply modeling our own inverted cube, and laying out our own UVs.
    We atlassed the texture and simply anchored it to the camera.

    What's left is to play with the render order to ensure it's last opaque element to draw (we are using Forward Renderer in VR).
     
    ROBYER1 and DanDan_VrMAN like this.
  4. DanDan_VrMAN

    DanDan_VrMAN

    Joined:
    Nov 1, 2016
    Posts:
    4
    Hi KiloGold, Your solution sounds amazing! I'm trying to do just that, but can't get a shader which I can put on my inverted cube which will be rendered first.. Render Queue won't work. Any ideas??
     
  5. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    866
    I wonder if messing with the render queue and everything else is just as unperformant as just using Unity skybox instead? For now I'm just using the Unity Skybox, it wasn't a huge problem for us.
     
  6. liam_unity628

    liam_unity628

    Joined:
    Mar 10, 2020
    Posts:
    7
    For Quest, I am using a small 100 vert sphere mesh (as opposed to the default 5k Unity one) with a slightly tweaked unity panoramic skybox shader and it's working well for me. I draw it in it's own call after opaques and before tranparents using a buffer.DrawMesh().
     
    gjf and JoeStrout like this.
  7. gjf

    gjf

    Joined:
    Feb 8, 2012
    Posts:
    36
    Can you share the shader? Thanks in advance.
     
  8. liam_unity628

    liam_unity628

    Joined:
    Mar 10, 2020
    Posts:
    7
    It's just the default Unity one with
    posWorld += _WorldSpaceCameraPos; 
    added so it moves with the camera. Think the SRP APIs .DrawSkybox() method does it CPU side so you have to alter the shader a bit to get it working with a .DrawMesh() call instead.
     
    ROBYER1 likes this.
  9. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    866
unityunity