Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question URP on Mobile incredibly slow?

Discussion in 'Universal Render Pipeline' started by ShadyMike, Jan 2, 2022.

  1. ShadyMike

    ShadyMike

    Joined:
    Apr 14, 2013
    Posts:
    60
    Hi,

    I've never tried making a mobile game before. However, I noticed that I get really bad FPS even with just simple scenes. I have 3 animated skinned meshes, and 2 point lights (no shadow casting) on screen, and the FPS caps at 26. Profiler says that the CPU is waiting for GPU gfx to finish.

    So I wonder, why is the performance so bad? I can think of a few possibilities, but I don't know:
    1. URP is not ready for mobile, maybe Standard is faster?
    2. Maybe a Development Build is slower than a non-Development Build?
    I'd appreciate any help as this is quite frustrating, I can't imagine mobile devices to be that slow.

    Thanks in advance!
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Check the profiler.
     
  3. bart_the_13th

    bart_the_13th

    Joined:
    Jan 16, 2012
    Posts:
    485
    He already did I think

    The problem with URP if you make it from template is that it turns all effects ON in the first place. This could be problem if you are targeting mobile platform since not all device has the power required to run those post processing

    Try turning PostProcessing off would be a good start to bump the framerate

    And yes, from what I've tested on my mobile device, standard/built in pipeline is faster than URP
     
    AshwinTheGammer likes this.
  4. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    URP does some things by default which you would otherwise need to enable or implement via a package/asset, which can hit mobile GPUs much harder:

    - HDR rendering (built-in defaults to LDR) is really intensive on low end mobile GPUs.
    - Post processing (built-in has none, you need a package/plugin) needs the framebuffer to be copied out from tile memory to device memory, which is the death sentence for low end mobile GPUs which barely have bandwidth to fill every pixel on the screen.
    - Linear space rendering (built-in defaults to gamma space) can cause some mobile GPUs to need to copy the framebuffer to device memory.
    - Single pass forward lighting (built-in uses multiple passes). While this reduces the number of draw calls (good on the CPU), it makes the shaders more complex. On low end mobile GPUs drawing a simpler shader multiple times can be faster than drawing a more complex shader once due to the limited number of shader execution units and the fast tile memory.
     
    ElliotB, TestUser001, Aligdev and 2 others like this.
  5. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    286
    Turn off the shadows.
    Unity really needs to make a second example scene for URP with everything turned off for mobile and oculus quest 1.
     
  6. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    When you create using template, you can find 3 settings for URP inside Settings folder. Use Low preset for mobile

    as @Neto_Kokku said, some settings are for newer devices by default when your using URP:
    Linear color space
    HDR
    Post Processing
    Lit standard shader

    So you can optimize:
    Gamma color space
    LDR
    No post processing (use only ACES and Color Grading)
    Use the simple lit or baked shaders

    Don't forget that the new devices (even 100$ android devices) has no problem with the above settings. You can use Linear+HDR+Lit shaders+Post Processing on the xiami poco x3 at the 60fps on native resolution a real 3d game
     
    Last edited: Jan 3, 2022
    DungDajHjep and TestUser001 like this.
  7. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    286
    I'm trying to make a game for the Oculus Quest 1 and the requirements to reach 72 fps are even more brutal than for a standard mobile game. Here are some of the things I've done:

    - Turn off HDR in URP settings
    - Forget about post processing especially bloom. Turn it all off. Consider switching it back on after all other optimizations have been implemented
    - Turn off shadows. Just forget about realtime shadows
    - Use as few materials as possible for the entire game. I use one material for the entire game!
    - Make sure materials use batching and gpu instancing
    - Turn off vsync in the quality settings
    - Use the BAKED lit URP shader whenever possible for anything that is static and does not need relighting.
    - Use the SIMPLE LIT URP shader whenever possible for anything that needs lighting
    - Set quality setting to as low as possible (reduce texture quality)
    - Use lods for all meshes
    - For terrain rendering, set the draw distance to as small as possible. Hide with ample amounts of fog if necessary.
    - When using terrain, set the pixel error as high as possible and the mesh resolution as low as possible
    - Remember to turn off tree colliders for terrain
    - Only use one light for the entire game


    The built in Terrain Lit shader for URP is still a bit too expensive to use for mobile applications. You may need to find a 3rd party shader here. I use microsplat with all normals turned off for performance
     
    AljoshaD, Jimaniki, Aligdev and 4 others like this.
  8. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
  9. ShadyMike

    ShadyMike

    Joined:
    Apr 14, 2013
    Posts:
    60
    My phone has a resolution of 2400x1080. When I render at a lower resolution (which is barely noticeable btw.), I get smooth 60 FPS.

    I heard it's even common practise to render mobile games at a lower resolution, I didn't expect that.

    Thanks for all the tips though, they are just as useful and interesting.
     
    Aligdev and UnityLighting like this.
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's been common and established since 2009, when Plants vs. Zombies devs wrote about it. I made a post about that too a few times on these forums. The technique is older of course. Since the PC era from the late 80s, there's been variable resolutions.

    All desktop games I know of also support variable resolutions. Even when they don't, desktop and console games have dynamic resolution, which scales the rendered target depending on how under load it is.

    Put simply, it's just something new developers don't think about. Especially when phones often are asked to draw to a native display far bigger than a tv screen on a powered home console!

    In any case, building a scalable game is something Unity excels at, so you'll be fine.
     
    Aligdev likes this.
  11. ShadyMike

    ShadyMike

    Joined:
    Apr 14, 2013
    Posts:
    60
    I usually work on Desktop stuff where resolution is mostly not an issue.
     
  12. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    7 years ago, i have used the resolution solution to run post effects smoothly on Mali 400 gpu
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It is always an issue, just apparently not for your own project.

    Most games on desktop and console now render around 1080p and upscale to 4K / VR res / or DLSS / other to requested display resolution.

    Internally, most games (even some of your own) will still have mixed resolution rendering, at loads of different places - even for example: post effects.

    In short, the only time resolution isn't usually messed with is when indies make a game.
     
  14. Jimaniki

    Jimaniki

    Joined:
    Nov 9, 2017
    Posts:
    15
    What do you mean about "render at a lower resolution" ?
    In UniversalRenderPipelineAsset / Quality / "Render Scale" : you set it to less than 1 ?
    or in Project Settings / Player / Resolution Scaling / Resolution Scaling Mode : frome "Disabled" to "Fixed DPI" ?
    or you force "Screen.SetResolution (value1, value2, true);" in a script for your players ?
    or something else ?
     
    starfoxy likes this.
  15. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    173
    Well, since it seems this thread has surfaced again, I will jump in with my own question.

    I am testing the URP pre-canned project and have set the Project Settings -> Graphics -> SRP Settings to use the URP - Performant pipeline asset.

    Oddly, this either doesn't seem to 'take' as a setting or something because I cannot set my camera to use:

    Rendering -> Renderer -> URP-Performant-Renderer.

    It is stuck at HighFidelity.

    Anyone have any idea what I should be doing to properly change to performant across the board?
     
  16. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    637
    Hi, you can add other renderers to the active URP asset by clicking the "+" button.
    URP_AddRenderers.jpg
     
    starfoxy likes this.
  17. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    173
    wwWwwwW1 likes this.
  18. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    173
    This is a great question and I would like any insights available around how to approach this. @hippocoder ?
     
  19. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    637
    I suggest changing the "Render Scale" because you can choose different upscale method and "Render Scale" should work with dynamic resolution in the future.

    My understanding of dynamic resolution:
    • Assume screen resolution is 100x100
    • Render 100x100 pixels when Render Scale is 1.0
    • Render 75x75 pixels to the same render texture (100x100) when Render Scale is 0.75
    • No need to allocate another 75x75 render texture and dispose the 100x100 one.
     
  20. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,890
    After recently using URP for an Android build I can confirm it is not viable. That means 30fps or less regardless of settings.

    Built-in was 60+ fps faultless with Linear lighting/shadows/color grading/etc.
     
  21. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    637
    If you're targeting at wide ranges of mobile devices (including very low ends like GL ES 2.0), then built-in is always a good choice.

    But built-in projects are more likely to have a CPU bottleneck (on desktop).

    Another option is to use LWRP (desktop + mobile, inverse-square light attenuation, ...), but it lacks most of the modern rendering features and won't receive any bug fix.
     
  22. OnoSaburo

    OnoSaburo

    Joined:
    Mar 25, 2023
    Posts:
    18
    Hello @Community
    Is URP(2D or 3D) mobile friendly?
    Even on low performance devices?
     
  23. bart_the_13th

    bart_the_13th

    Joined:
    Jan 16, 2012
    Posts:
    485
    No, at least, until someone can prove it the otherwise by providing an apple to apple comparison (an apk in built-in vs urp)
     
    Unifikation likes this.
  24. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,184
    Asking if something is "mobile friendly" is meaningless when we can target everything from barely usable devices (eg iPhone 6) to incredibly powerful ones (eg iPad Pro). You need to specify the devices that you are interested in targeting, and even then you have to hope someone has tested on one.
     
    Last edited: Jun 23, 2023
  25. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    286
    I'm getting 72 fps on quest 2. Unity is mobile friendly with URP, but you need to go through every shader and asset to make sure your not wasting performance on useless crap like 512x512 smoke textures
     
  26. Rakun665

    Rakun665

    Joined:
    Dec 22, 2020
    Posts:
    1
    I had the same issue. I created a new 'New Universal Render Pipeline Asset' and made some changes now my game is runs smooth. You can check this Unity video:
     
  27. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    URP has been optimized in maximum state by default. The problem is the old devices with es 2.0 compatible hardware. You must forget them (older than 2019 devices)
    build in is not optimized by default. You need a lot of working on the settings. But in best state the final result is same as urp