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 LWRP on Android makes game lag ?

Discussion in 'Universal Render Pipeline' started by Tenouji, May 27, 2020.

  1. Tenouji

    Tenouji

    Joined:
    Sep 2, 2018
    Posts:
    4
    Hello, I'm making a simple game and built it into android. But the game has ~30fps while it has ~60 fps on Editor build. At first I thought that was my scripts so I disabled most of my scripts (only Camera Controller left) and set targetFramerate to 60, but it didn't solve the problem. After spending hours messing, I noticed that "Post Processing Layer" component on my camera is the cause.
    Here are some things that I've tried:
    1. Enable Post Processing Layer with FXAA (Fast mode: false) - My game FPS is around 30

    2. FXAA (Fast mode: true) -FPS: ~40

    3. Disable Post Processing Layer. My game FPS jump straight to 60FPS
    My game doesn't has any volume ( because I don't know how to use it). I installed LWRP for my project because I wanted to create Force field Effect (
    ) for my game.
    My phone using for testing: Redmi Note 4 (4/64) - Chip: Qualcomm MSM8953 Snapdragon 625 - RAM: 4GB
    Is the problem from my phone or from Post Processing itself ?
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    Hi!
    This phone has a very weak GPU and a relatively high display resolution. I would not suggest turning post processing effects on there :)
     
  3. Tenouji

    Tenouji

    Joined:
    Sep 2, 2018
    Posts:
    4
    Thank you for your reply @aleksandrk. I'm new to Unity, so even my game doesn't has any special effect on graphic (Post-process volume component's effects), it still affect my game FPS ?
    The problem is, if I disable Post-Process Layer, my force field becomes a normal sphere

    [Post-Process Layer enabled]
    https://imgur.com/a/60VbZQ8

    [Post-Process Layer disabled]
    https://imgur.com/a/3RzHsYJ
     
  4. DiveshNaidoo

    DiveshNaidoo

    Joined:
    Apr 1, 2018
    Posts:
    23
    The problem is not to do with your gpu. There is an issue on Unity side when using LWRP or URP . Simply enabling post processing without any effects causes a huge performance hit. I’m using an iPhone 11 Pro Max and I notice the performance hit immediately. It is well detailed in this threadhttps://forum.unity.com/threads/per...ions-of-unity-post-processing-and-srp.786944/ however there is no time for when the issue is expected to be addressed and the tracker hasn’t showed any progress either. I wish Unity would address this as the old Unity 5 default renderer was faster and more stable.
     
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    I can understand you're frustrated by the issue you linked, but this statement is baseless. Adreno 506 is really weak.
     
  6. DiveshNaidoo

    DiveshNaidoo

    Joined:
    Apr 1, 2018
    Posts:
    23
    Tenouji said that he/she doesn't have any effects applied but just by merely enabling post processing he/she is seeing a performance drop. Is that normal? even on a weak gpu?
     
    Tenouji likes this.
  7. Tenouji

    Tenouji

    Joined:
    Sep 2, 2018
    Posts:
    4
    @DiveshNaidoo, thank you for clarifying my statement. Yes, I only enables Post-Processing (I turned off shadow, anti-aliasing,...), even it's just a scene with a normal camera, my game FPS drop to ~40.
    I attached my setting on Pipeline asset Object and Camera. Did I miss something or this is a common cases for everyone.
     

    Attached Files:

    DiveshNaidoo likes this.
  8. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,550
    Is using the built in render pipeline an option to test performance? I use it with many effects on android and iOS and the performance is good. The caveat is that the built in renderer may be removed at some point so be aware of that. Your project may also be too far in to test it with the built in render pipeline?
     
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    I suppose what's happening is it gets an additional blit if post processing is enabled.
    That would be worth a bug report :)
     
  10. Tenouji

    Tenouji

    Joined:
    Sep 2, 2018
    Posts:
    4
    I wish I had the same performance as you :(. My game really doesn't has many fancy effects or shaders (I only created 2 shader graph file: 1 Force field effect from brackeys, 1 laser effect with line renderer. I only installed LWRP because of those video's instruction). About "The caveat is that the built in renderer may be removed at some point so be aware of that" part, I just learned it yesterday since I'm quite new to Unity. Finally, my game runs smoothly if I disable Post-Process Layer on my camera.
    P/S:English isn’t my first language, so please excuse my mistakes
     
  11. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    Unity have to change their mind ...

    CALL OF DUTY Mobile was built with unity ...
    you can run it on Android 5.1+ phones ...
    for example you can run it on Samsung J6+ [Adreno 308 - 3GB of RAM] smoothly or similar phones ...

    so, we needs URP pipeline that render and handle massive crowds in dense jungles, more powerful, more performance and smoother than built-in pipeline on cheaper GPUS ...
    cheap Adreno and Mali gpus ...

    its huge disappointment for Unity for now :[

    P.S: some unity guys had mentioned that Adreno 500 series and below are very cheap gpus!! o_O
     
  12. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    What kind of post processing effects are active on J6+?

    Do you have any proof of this? :)
     
  13. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    272
    Adreno 508 is not really weak gpu I would rather consider it as a mid-range gpu
    If you can please, take a look at hardware data collected by Google play you will clearly see that there's is still weaker gpu than 508 still used by a lot of people
     
    Last edited: May 31, 2020
  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,065
    Don’t use FXAA, 2x MSAA just looks better and performs better in my experience. Also I’m under the impression the URP post effects are slow, so use as little as possible.
     
  15. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    The device from the original post is running a 506. Sure, there are even weaker GPUs out there, but that doesn't make it any faster.

    Keep in mind that not all mobile GPUs support MSAA 2x ;)
     
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,065
    I would argue that those devices shouldn't be running FXAA either then.

    My personal opinion is that MSAA 2x (if supported) performs and looks better, and if it isn't supported then FXAA cost will probably also be prohibiting, so you'd better give up on AA.
     
  17. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    This is not necessarily true.
    There are mobile GPUs that don't specifically offer an MSAA2x option, but do support 4x and higher.
    Of course, if a GPU doesn't support MSAA at all, it would likely mean FXAA wouldn't be an option either.
     
  18. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,065
    Didn't know that. I know some for some Mali GPUs that up to 4x MSAA is more or less the same performance as 2x, but I've never heard of 2x flat out not being supported.

    I've learnt something new today, thanks.

    (Although I still maintain that FXAA is not a great fit for mobile regardless, but maybe that's just me :p )
     
  19. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    Well, I was talking about Mali GPUs, yes :)
    It depends on the color format, and at least some formats declare 4x support but not 2x.
    I guess historically this was due to "4x is nearly free, why implement 2x if you can have 4x".
     
  20. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    81
    Hi
    Please clear my ambiguity
    I developing an android game that has not any realtime light and all of them was baked .
    Does it have any advantage that I bother myself to use LWRP and adapt my resources to it ?