Search Unity

Question Reaching Oculus Quest FPS target - Optimization help needed

Discussion in 'VR' started by eusebium, May 30, 2022.

  1. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    Hi,
    I am trying to get to the 72 FPS on Oculus Quest 1 and my environment is fairly simple - just a room with some windows (marked as static). Using Unity 2022.1.f1 and MRTK 2.7.
    I am using URP (no HDR, MSAA 4x, no PP), Graphics Medium (No v-sync), backed lights (basically, 1 directional, and 4 point lights).
    Followed most of these recommendations: https://www.linkedin.com/pulse/how-optimize-your-unity-applications-mobile-vr-oculus-arowosegbe/
    upload_2022-5-30_21-0-38.png

    In Editor with XR enabled (Oculus Link/Standalone) runs at ~72FPS. But on device it runs with 35-40 FPS.
    Even if I disable the room entirely, still no 72 FPS (~50 FPS).
    How can I reach that 72 FPS?
     
    AldeRoberge likes this.
  2. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    Apparently, it is an Unity 2022.1/URP 13 issue as in Unity 2021.1.27 the VR template (with and without URP) runs smoothly at 72 FPS.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Remove vulkan in player settings, and try it for your setup. OpenGL ES is probably going to remain the best choice for this little headset.

    That guide on linked-in is pretty bad to be honest. It's just a random jumble of things that worked for that one person, for their specific use-case and will just result in your game looking bad, I think.

    Optimisation is about bandwidth, no post effects, no HDR (again all bandwidth issues) and keeping polycount down *in the distance / small triangles* due to micro triangle rendering overdraw issues.

    It's not so much about your draw calls or number of triangles, though you'd want to minimise them where possible.

    Shader cost is not as much a problem, but you still need to understand all this stuff, rather than blindly follow a guide then wonder why it's not helping much.

    Profiler is the best thing, plus reading something on an actual technical site, that's not linked-in.
     
  4. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    I agree that LinkedIn is not the best technical website but most of the VR documentation is obsolete already. Also, latest Unity & URP is not working properly even in the simple default projects.
    So, the question was not why the guide is not helping, but more why isn't Unity... (tried reporting a bug but the bug reporter crashed). So, again, the scene is quite simple (with minor scripts) and the best FPS I got so far is ~45 FPS (even if I disable the room, I barely get to 68 and there is only a skybox and a canvas with two textboxes and one button on it). I don't need LOD, mipmaps, complex shaders, etc. The 3D object itself or the textures might be wrong but then again... not complicated and why I am asking for help :)
    According to Oculus docs, I am well below the 500k tris and other guidelines they say the device is supporting.

    I am using OpenGL ES already.
    Also, I am using Multi-pass as Multiview spams with GL_INVALID_OPERATION...
    Profiler wise, I get Gfx.WaitForRenderThread to "consume" the most. What I don't understand from Profiler are the spikes (given that the number of tris/verts are the same, pipeline is the same).
    upload_2022-5-31_14-59-54.png
    vs
    upload_2022-5-31_15-0-19.png
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    So basically, please investigate why you can't use Multiview, which is much more likely to improve your framerate.

    I suspect it's some kind of web of packages and mismatched stuff. Are there any GC allocations?

    What are your URP settings in detail? You're using only Unity XR, right? With XR management? Not Oculus runtimes?

    You are probably using some bad shaders / or incorrect URP version mixed with editor version which could happen prior to 2021.x

    So I think the problem will lie in your packages or the shaders you're using. If you're not using URP shaders or shaders made with shadergraph, you're probably headed for trouble.
     
    JoeStrout likes this.
  6. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    Thanks for the answers!
    Switching to standard rendering pipeline made the FPS reach 72 easily on my room (as I was expecting). In other scenes with more complex objects, it's still bellow 72 (with or without Multiview) but at least I know that those objects need to be optimized.

    I was using URP shaders. Also, XR Management is used (and with MRTK 2.7.3 which is using Oculus SDK for avatar). I tried with both Unity 2021.1.27 + URP 11 and Unity 2022.1.1 + URP 13.
    The URP profile was a standard one with the HDR disabled and MSAA at 4x.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Probably something there then.
     
  8. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    well, not really since it's still there now... so, clearly it is an URP issue.
     
  9. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    60
    I'm having the exact same problem. Did you ever find out the answer?