Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Performance going downhill with latest versions of Unity, Post Processing and SRP

Discussion in 'Universal Render Pipeline' started by Devil_Inside, Dec 2, 2019.

  1. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    So I started a new mobile project in 2020.1 with Universal RP.
    While prototyping and setting up basic systems I did my first build and deployed to mobile. I was very disappointed when almost an empty scene with very basic post processing (just a color lookup) couldn't keep 60 fps on mobile.
    My previous project could run at 60fps with post processing so I decided to investigate.
    It turns out that the performance was going downhill since Post Processing Stack V2 was introduced.

    I've tested these scenarios:
    1. Unity 2018.4.3f1 built-in renderer:
    - Standard shader
    - Standard + Post Processing Stack V1
    - Standard + Post Processing Stack V2
    - Mobile Bumped Diffuse
    - Mobile Bumped Diffuse + Post Processing Stack V1
    - Mobile Bumped Diffuse + Post Processing Stack V2
    2. Unity 2020.1.0a13 built-in renderer:
    - Standard shader
    - Standard + Post Processing Stack V1
    - Standard + Post Processing Stack V2
    - Mobile Bumped Diffuse
    - Mobile Bumped Diffuse + Post Processing Stack V1
    - Mobile Bumped Diffuse + Post Processing Stack V2
    3. Unity 2020.1.0a13 Universal Render Pipeline with built-in Post Processing
    - Lit
    - Lit + Post Processing enabled
    - Simple Lit
    - Simple Lit + Post Processing enabled

    Test scene looks like this:


    I tried to keep the quality and player settings as close as possible between projects. All materials use Diffuse + Normal maps. All PostProcessing profiles are only using a 16 LUT for color grading (StackV2 and URP versions set to Low Definition Range).

    I've run the tests on Xiaomi Mi A1, and I've also checked on Nokia 6.1. The results were basically the same:


    Oldest Unity 2018 works best with oldest Post Processing Stack V1. Switching to Post Processing Stack V2 results in FPS dropping by 10-15 (below 60).
    Unity 2020.1 is visibly slower than 2018 using any Post Processing. I assume that a bit more complex scene, and it will be visibly slower without Post Processing as well.
    Unity 2020.1 with URP and built-in Post Processing is the worst.

    Wasn't URP supposed to have like better performance than everything else?
    How come that a 2-3 year old Unity runs better on mobile than anything currently does?
    What's up with PP Stack V2 being so much worse than PP Stack V1?
    How come I can't run the simplest scene with the simplest color grading at 60 fps on mobile?
    I have so many questions and so much frustration...
    What's going on?
     
    ViraGW, crandellbr, NotaNaN and 21 others like this.
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It is better performance but the settings in URP are not the same as the settings in other pipelines so it will run slower if you do the same settings. You should perceptually adjust them to look the same, then it will run faster. If it doesn't run faster, Unity considers it a bug.

    Pretty sure its a problem on your camera or post effects or setup.
     
    laurentlavigne likes this.
  3. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Here are the settings:

    Here's the camera:

    Here's the PP Volume:
     
    Vorrin likes this.
  4. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Which SRP options do you have to "perceptually adjust"? There are not that many options, I turned everything off or dropped as low as possible for the tests. Are there any other places I should check for options?
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Stop NaN can be unticked from camera. but I don't see any bad settings there. I can only assume somehow the resolution changed.

    This is bad news for such a simple example. Perhaps Unity can look into it? This is only with post effects on right?
     
    GoGoGadget likes this.
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Make sure only one volume is in scene for testing. It can be easy to layer them these days (for example a sneaky default Unity one might be present too).
     
  7. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Stop NaN have almost no effect. Tried with and without it.
    There's only one volume, yes. I've checked.
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Please report a bug :(
     
    R0man likes this.
  9. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    1 Disable Stop NaN
    2 In URP Unity force depth pre-pass when post processing is enabled, even if you don' using depth based effects.
     
    R0man likes this.
  10. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Sorry, I'm not exactly sure how to enable depth pre-pass? Is that the "Depth Texture" checkbox in the URP profile asset?
    I tried to enabled it just now - the FPS with post processing remained the same. The FPS without post processing dropped below 60, so it doesn't seem feasible to keep it 60+ with DepthTexture and PP enabled.

    And by the way when the Depth Texture checkbox was disabled in URP profile asset, the Depth Texture option on the camera said "On (Forced due to Post Processing)". So it seems it was being forced all along.
    Also, for some reason even if I disabled Post Processing on the camera, the "On (Forced due to Post Processing)" doesn't change.
     
  11. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Try to disable shadows. Shadows force depth pre-pass too.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Also, AFAIK, URP on Android does an extra blit if you use post atm (although it will be fixed sometime in the future).
     
    Last edited: Dec 2, 2019
    R0man likes this.
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yep although this isn't really a huge problem unless in VR, as it prevents certain other features like foveated rendering from working.
     
  14. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Shadows were disabled in all tests.

    I've reported a bug with all the test projects zipped.

    Not really sure what to do next...
     
    Ruslank100, phil_lira and hippocoder like this.
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Make sure to post a link here when/if the issue goes up on issue tracker.
     
    Devil_Inside likes this.
  16. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    thanks for sharing this
    Can you please include 2019.1 or 2019.2 in your tests?
     
  17. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Just finished testing 2019.2.14f1. It showed exactly the same results as 2020.1.
    I believe 2019.1 won't be much different.
     
  18. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,015
    There is a need for some serious improvements right now with mobile in general, but especially with mobile VR. It is very hard to get post processing working with mobile VR, and even harder to get it working at a high frame rate. Some people suggest not using any post processing, but post processing really helps certain visuals.

    Similarly, mobile VR has the option to use Multipass, Single Pass, or Single Pass Instanced. However, Single Pass Instanced in nearly completely broken, and Single Pass does not work with most post processing on mobile. So mobile VR developers are largely stuck with Multipass, which is the least performant option.

    And has anybody ever gotten Vulkan to work with any Android device? I have not. I would love to be able to use Vulkan with mobile VR like the Oculus Go and Quest.
     
    Ruslank100 likes this.
  19. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    To be honest I'm completely baffled. For several years SRP is one of the main buzzwords at any Unity event and there are tales of PC grade graphics available on mobile. Yet I create an empty scene with the cheapest post processing option and performance plummets through the floor. How come this wasn't discovered and fixed ten times over?!?

    How come Post Processing Stack v2 runs 10 fps lower than v1 out of the box on an empty scene, yet it becomes the standard for all Unity versions forward like everything is fine?

    What am I missing?
     
    Last edited: Aug 13, 2020
    ViraGW, crandellbr, NotaNaN and 15 others like this.
  20. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    I still wonder, why everyone are think that URP is a mobile optimized render pipe? Yes you can run boat demo on super phones at 30fps, but its' mean nothing.
     
  21. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Because that's how it is advertised. You get HDRP targeted at hi-end hardware, and URP, which is scalable down to mobile. Since it is a better structured and optimized pipeline than the built-in one, one would expect that it would run AT LEAST as good as the built-in pipeline, not worse.
     
    ViraGW, NotaNaN, Cynicat and 8 others like this.
  22. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Emphasis mine.

    If URP has less features and is slower what is it good for?
     
    ViraGW, NotaNaN, Cynicat and 6 others like this.
  23. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    I'm happy we have chosen to go back to 2018.4 all newer versions sucks
     
  24. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    https://forum.unity.com/threads/post-processing-v2-cpu-performance-concerns.542322/#post-5235431

    The above thread is probably what you're missing, and something I didn't realise as I haven't had a production project on new postprocessing yet. TL;DR - Unity's PPv2 volume code, which runs even without more than one volume, looping through enormous managed lists every frame :)

    Thanks for reporting the bug - unfortunately this effects anyone using Unity's new post-processing backbone, PPv2 or otherwise...
     
    ViraGW likes this.
  25. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    HDRP for high-end PC, URP for low-end PC and super phones. All true. Nowhere says URP is for potato-phones.
     
  26. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    JFC, this is ridiculous
    The initial post is dated Jul 2018... No one seems to care anymore
     
    Last edited: Dec 3, 2019
    Ruslank100 and GoGoGadget like this.
  27. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Can you read?
    When upgrading a project from the built-in render pipeline to the Universal Render Pipeline, you should expect similar or improved performance
     
    ViraGW, MaykeBr, R0man and 5 others like this.
  28. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    That's why we all moved to SRP because of the way they advertised it.
     
  29. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    165
    Glad it is not just me screwing something up. I've noticed worse performance in general after trying out our project in 2019.2, 2019.3, and 2020.1. Going back to 2018.4 but also considering trying out 2017 if it doesn't have anything that will break the project by going backwards.
     
  30. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    I would so use 2018.4 with PP Stack v1 for the new project, but considering that 2018.4 support ends in ~1 year, it would be safer to switch to a newer version.
    I'm really surprised that the overall performance degradation with the base Unity 2019, but also the PP Stack v2 and Lightweight/Universal RP on mobile didn't make much more noise in the community.
    I mean, at every Unity event you hear these crazy numbers of mobile games released each year using Unity. How come no-one's talking about the performance? How come these issues haven't been looked at?
     
    Last edited: Dec 3, 2019
    ViraGW, NotaNaN, Ruslank100 and 8 others like this.
  31. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    because they all use unity 5.6 lol
     
    NotaNaN, Ruslank100, camta005 and 5 others like this.
  32. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    Something really strange just happened to me as we decided to try 2018.4 before downgrading the whole project I decided to benchmark 2018.4.13 PPV2 built-in pipeline against 2019.2.5 PPV2 LWRP 6.9.1
    Surprisingly the later was faster and by alot
     
    laurentlavigne likes this.
  33. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    Phone used for benchmark Xiaomi mi 8 lite
    2019.2.5 LWRP 6.9.1
    Average : 37fps min : 7fps max : 53fps

    2018.4
    Average : 28fps min : 3fps max : 35fps
     
    laurentlavigne and phil_lira like this.
  34. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    Draw Call : 300 - 1350
    Tris : 200k - 800k
     
  35. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    I haven't tested LWRP, since it's not supported any more.
    I've tested 2019.3 today with URP and the results were identical to 2020.1 with URP.
    Can you please test your scene in 2019.3 with URP or 2020.1 with URP?
     
  36. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    Sure
    I'll try tomorrow
     
    Devil_Inside likes this.
  37. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    EDIT: cleaned up a very very long rant about the current state of SRPs and unity in general.

    TLDR version is that I am very very tired of fighting the engine for about a year now and the time spent on this vs our project is laughable. I am a unity fanboy at heart for a long time but that is being tested right now. I also get a general sense of the community as a whole being less defensive of unity based on current state of play.
     
    Last edited: Dec 4, 2019
  38. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    The weird thing is that HDRP feels much more solid these days, and it's the one that is still in preview.

    I know I often complain about most of Unity being perpetually in preview, but if actually releasing a feature doesn't mean anything, it stops us from having something to look forward to.

    I guess there was pressure to release LWRP/URP since they announced that they will stop improving/deprecate the built in renderer, but there is a solution to that. Don't drop support for stuff before the new solution is ready, then take your time and release rock solid features we are excited for.
     
  39. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    Strong agree on all points.
     
  40. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    @Devil_Inside didn't have time to test 2019.3 or 2020.1
    But after more test in 2019.2 I have come to conclusion that LWRP perform well and here is some tips
    Don't use static batching
    SRP Batcher help sooooo much for scenes with many draw calls, I've been able to run some scenes with more than 1M, more than 2000 draw calls and shadow(only directional light) at 15-20fps@720P
    Vulkan is buggy and unstable can't rely on it
     
  41. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    @buFFalo94
    The problem is that, as far as I understand, LWRP is deprecated and won't be updated/supported any more. URP is the way forward, so if you're going to change to 2019 LTS at some point, you'll also need to change to URP.

    In your case though, I think URP will work equally as well for you, since, it seems to me, with a heavy scene like yours, your bottleneck is somewhere else.

    The scene I've tested was super simple, so unless I missed something super obvious, there is some kind of problem with the newer Unity/PP Stack/URP.
     
    MadeFromPolygons likes this.
  42. Driven

    Driven

    Joined:
    May 31, 2013
    Posts:
    77
    I can only agree that everything gets worse with every new version. I regret switching Unity 5 where everything was fast, the runtime and the editor. Since 2017 its just regression by default and nobody cares. Switching to 2019 and urp decreased the performance by 50%, the app size grew, less devices were supported and it's often not even running on the supported devices anymore. It's Really sad :(.
     
  43. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    273
    Agreed
    But it's too early to switch to 2019.3 it's too buggy and as far as I know URP is in the same state
    So as for now we got almost everything working with LWRP except shadowmask but I saw an hack from someone who managed to make it work thus we won't wait for Unity to add it
     
    Last edited: Dec 4, 2019
  44. ahtur

    ahtur

    Joined:
    Sep 2, 2018
    Posts:
    3
    Which Unity version provides multipass for URP, please ?
     
  45. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,015
    I don't know. I am currently using 2018.4 with multipass.
     
  46. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    With URP?
     
  47. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,015
    No, not URP.
     
  48. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    Thats what everyone is talking about here though :)
     
    FabrizioSpadaro likes this.
  49. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,288
    It was expected when the development went so fragmented and non unified, now is just a race to fix bugs and handle problems, plus create multiple projects when we should not have to.

    Overall is a nightmare comparing to the old stable unified Unity and getting worse with every version. I really cant grasp why rename LWRP to URP only few weeks after it finally came out, all this is like a huge pre-pre Beta thing going on with us testing it.
     
    Starsmiao and Ruslank100 like this.
  50. quixotic

    quixotic

    Administrator

    Joined:
    Nov 7, 2013
    Posts:
    122
    Please file bugs when you run into cases where Universal RP is less performant then it previously was, or less performant than built-in. Example cases highlighting performance problems are super helpful to work against. We view Universal is not performing the same or better as regressions to solve.

    Also, if you report bugs feel free to drop the number here.
     
    AskCarol and phil_lira like this.