Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question URP Performance in VR (Quest 2)

Discussion in 'VR' started by Mohoruto, Mar 14, 2022.

  1. Mohoruto

    Mohoruto

    Joined:
    Feb 2, 2020
    Posts:
    5
    Hey guys - I'm pretty new to using URP with VR and would like some information/opinions on my settings to see if I can resolve the performance issues I am getting.

    Here's a few quick details:
    - Unity version 2020.3.10f1
    - Target platform is Quest 2
    - Prior to using URP the standard pipeline was in use and 60+ FPS was constant without issues
    - Using reflection probes (baked), global volume, mixed lighting (mostly baked), baked occlusion culling

    I have tried many solutions to try and increase performance, but nothing really seems to improve. I've disabled global volume altogether, disabled the reflection probe, reduced shadow quality, lightmap resolution and compression, and even still the best I get is around 28 FPS, with GPU utilization at a continuous 100%. Clearly there's something in my settings that is having a huge impact, but I can't seem to pinpoint it out.

    Please check out my settings below, and a screenshot of the profiler at the end. Any help is much appreciated!

    Here are my URP settings:
    upload_2022-3-14_10-55-27.png

    Global volume settings:
    upload_2022-3-14_10-59-54.png

    Here are my lighting settings:
    upload_2022-3-14_10-53-44.png

    Profiler when running in editor (Obviously performance is good because my PC is doing all the work)
    upload_2022-3-14_12-49-55.png

    Performance Analyzer in Oculus Developer Hub:
    upload_2022-3-14_12-43-49.png
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    Profile on Android so you can see what is causing it. On PC it's a CPU bottleneck rn
     
  3. Mohoruto

    Mohoruto

    Joined:
    Feb 2, 2020
    Posts:
    5
    I would love to but every time I attempt to profile using my Quest 2, Unity keeps telling me the device is disconnected, despite the fact that it's running fine through the headset.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    Restart both pc and quest 2 and make sure both are on the same router.
    Make sure sidequest is not running as well

    Edit: for some reason sometimes if I open the profiler in another unity project in 2021 or 2022 it does show up there somehow
     
  5. TomGoethals

    TomGoethals

    Joined:
    Jan 29, 2022
    Posts:
    45
    Turn off all post processing on the camera and delete the volume, I can't imagine your Standard rendering tests would get 60 fps with a post processing stack with all those effects. PP and VR on Quest2 is almost impossible to get to 72 fps when rendering more than a few cubes.
     
    AldeRoberge, fuzzy3d and DevDunk like this.
  6. IrtezaRmasud

    IrtezaRmasud

    Joined:
    May 19, 2020
    Posts:
    15
    I can see you are using post processing in vr which will suck up your performance. Every of the post processing override will consume a high render time. Remove your post processing and try to build one more time.

    **If you are getting urp 30fps frame capped issue.
    Then add this thing on start.

    -Application.targetframerate = 90
    -set the vsync count to 0.


    Special note: getting good graphics and good frame rate in VR is a very tricky part. If you use post processing even in built in pipeline your frame rate will also suffer.
     
  7. aVaKus

    aVaKus

    Joined:
    Oct 12, 2012
    Posts:
    9
    I think the issue is URP itself. It just doesn't seem to work as well as it should for VR/AR.

    I've been fighting with performance on the Quest 2 with URP for the past few weeks. Even with a simple scene (1500 duplicate objects each with 12 vertices), with no post processing, and no scripts running (other than the xr rig) and I couldn't get above 55fps and the GPU Voltage was constantly spiked at 99%. I tried dynamic batching, gpu instancing, the SRP batcher, static batching (switched the 1500 objects to static and this somehow performed the worst of all of them), and the targetframerate/vsync settings mentioned above with no luck. I then tried mesh combining. While it did drop my draw calls from 21 to 7, the framerate still hovered in the 50s.

    This past weekend I tried something a little more drastic and ripped URP out of the project going back to Built-In. I switched my 1 shared material back to the standard shader and enabled gpu instancing. Then I set up the quality settings to enable realtime shadows and 4x MSAA. (no post processing though)

    Created a new build with the same scene and got a rock solid 72fps. Not even a flicker of less than 72 in the OVR Metrics overlay.

    This is just my experience with URP, but I'm going to stick with the built-in RP for now and maybe give URP another shot in a year or so.
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    Seems like there are some settings wrong.
    You could check out this project (there is a 2021 lts branch) to check them: https://github.com/smitdylan2001/ApplicationSpaceWarp
    It does use a custom oculus URP version, so keep that in mind
     
  9. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    141
    @aVaKus No luck with this? I'm also having a crazy CPU bottleneck on the main thread in URP in a super tiny scene. Profiler tells me I'm having 80 ms of scripts which are just URP scripts.
     
    Last edited: Oct 16, 2022
    AldeRoberge likes this.
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    1. What unity version
    2. Show the profiler
    3. What is the fps? If it's at the set fps then it will just say it's waiting for a while, which is normal
     
  11. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    141
    1.png

    Sorry "only" 14 ms for a render pipeline loop with 60 batches which are all default urp shader. I assume it's not related to GPU at all because 2 million tris or 22k tris don't change timing at all, there's no wait for present at all and render thread is just waiting for main thread all the time.

    It's not reaching any target fps or vsync. Unity 2021.3.10 OpenGLES3, Quest 2. Vulkan is even slower than that.
    It does seem very strange that controller update script is also taking so long

    Edit: updated the data for multiview mode
     
    Last edited: Oct 16, 2022
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    That's weird.
    Maybe try my base project (feel free to remove the oculus urp) https://github.com/smitdylan2001/ApplicationSpaceWarp/tree/2021.3
     
    Genebris likes this.
  13. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    141
    We just switched to built in and got 70 fps instead of 24. Pipelines strike again ¯\_(ツ)_/¯
     
  14. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    That's up to you, do whatever fits your project
     
  15. aVaKus

    aVaKus

    Joined:
    Oct 12, 2012
    Posts:
    9
    @Genebris I actually did have some luck with URP. After a few weeks with the built-in pipeline I was reminded what a pain render queues can be so I decided to give URP another try.

    I reinstalled URP in my project and created a default URP pipeline asset and URP renderer asset and when running the project I still had the same performance issues.

    So I started digging and I found a random post from August (I think it was on Reddit) where someone mentioned how URPs depth texture mode setting was changed from force prepass to something else (can't remember off the top of my head) but that it was supposed to switched back in a future release. I looked at the URP renderer asset and there is now an option to set the default texture mode manually, so I set it to 'force prepass'.

    This helped somewhat, but performance still wasn't the same as built-in. I continued messing with settings and I disabled the SRP batcher, enabled dynamic batching, and enabled gpu instancing on my materials and mesh particle systems. This seemed to do the trick for me. My builds now run at a constant 72fps on the Quest 2. I tried some stress tests and things held strong at what I'd consider a heavy load.

    I also tried using the 120hz mode, but this was too much for it. I'll try 90hz in the future, but for now 72 meets my needs.

    Hope this helps you out.
     
  16. jeffries7

    jeffries7

    Joined:
    Jun 25, 2014
    Posts:
    59
    We're using 2019.4 with URP and tried upgrading to 2020, 2021 and 2022 and never got the same performance as what we get in 2019. Maybe there are specific versions of these that work better than others (I think Oculus recommends 2020.3, I think) but we don't have time to test them all.

    On top of testing the different versions of Unity, you also have to test the different versions of URP.
     
    juan-jo likes this.
  17. jeffries7

    jeffries7

    Joined:
    Jun 25, 2014
    Posts:
    59
    I'm not sure which versions you're using but if you have access to "Mixed Lighting" and "Light Layers" in the URP asset try disabling those, I found a big performance gain when I disabled them.
     
  18. aVaKus

    aVaKus

    Joined:
    Oct 12, 2012
    Posts:
    9
    Thanks for the suggestion! I'll try that out later today.
     
    DevDunk likes this.
  19. aVaKus

    aVaKus

    Joined:
    Oct 12, 2012
    Posts:
    9
    aducceschi and DevDunk like this.
  20. aVaKus

    aVaKus

    Joined:
    Oct 12, 2012
    Posts:
    9
    Been watching this issue and the fix is now in review for Unity versions 2021.3.X, 2022.1.23f1, 2022.2.0b15, and 2023.1.X. Before it was just for 2023.1. I hope we have the fix soon.
     
  21. pixeleif

    pixeleif

    Joined:
    Feb 9, 2016
    Posts:
    17
    After wasting most of my day trying to get my project perform ok in 2021, URP 12.1.7, I came across this thread and tried your base project. That worked like a charm. You are using 12.1.6 Custom. Is there any way of getting that exported to my other project?
     
  22. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    Yep, copy over the packages from my project to your packages folder. Also 2021.3.14 has some more performance fixes
     
  23. pixeleif

    pixeleif

    Joined:
    Feb 9, 2016
    Posts:
    17
    Big thanks for this!
    A bloody lifesaver!

    I assume it is safe to upgrade your base to 2021.3.14 then?
     
  24. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    Yep!
     
  25. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    181
    How have everyone's experiences been lately? Any improvements found with 2022.2?
     
  26. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    Not really as far as i know, here are the active reports

    There is a new big performance issue on the issue tracker. URP team is already made aware and reproduced it themselves (not just QA)
    https://issuetracker.unity3d.com/is...est-2-builds-across-2020-dot-3-and-2023-dot-x

    Here are some other smaller issues that are relevant to VR performance as well:
    Input system optimizations performing worse in VR: https://issuetracker.unity3d.com/is...t-system-reduces-performance-in-built-players
    OculusXR performing worse than OpenXR: https://issuetracker.unity3d.com/is...-has-worse-performance-than-openxr-when-built
    Graphics Jobs not working on standalone VR: https://issuetracker.unity3d.com/is...hes-on-quest-2-when-graphics-jobs-are-enabled
     
    gotiobg likes this.
  27. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    181
    Thank you, I saw those. Your staying with this issue has been much appeciated, thank you @DevDunk !
     
    DevDunk likes this.
  28. hanan1games

    hanan1games

    Joined:
    Nov 24, 2021
    Posts:
    1
    Go to the setting folder ==> find URP-Balanced ==> delete SSAO component..

    i am not 100 % sure if it is inside URP-Balanced.. but u will find it in the setting folder.

    make sure there is no null reference error.

    these two things fixed the problem for me.
     
    DevDunk likes this.
  29. mrphilipjoel

    mrphilipjoel

    Joined:
    Jul 6, 2019
    Posts:
    49
    What exactly is the Oculus URP. I can't seem to find an official page from oculus saying "Here's our version of URP, please use it!"

    I found this repo, but the readme seems like its just Unity's regular URP. It doesn't say anything about it being specific to oculus.

    https://github.com/Oculus-VR/Unity-Graphics/

    Thanks for any guidance you can give me. We are trying to get our app at stable 90 FPS with 8 players. And currently it fluctuates from 50-90.
     
  30. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    The oculus branch is for application Spacewarp
     
  31. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    181
    Rather than start a new thread - what's the latest word? I am considering jumping back in with a newer Unity version. Any recommendations on which Unity version has the best performance for Quest 2?

    It appears that most issues have been fixed on the Issue tracker posts.
     
  32. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,865
    2022lts is great if you app SW, 2023 also performed well for me :p