Search Unity

Very poor performance on Android after upgrading to Unity 5

Discussion in 'Android' started by digitalMUTANT, Mar 3, 2015.

  1. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    134
    did anyone fixed this problem or i need to back to 4.6
     
  2. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    I would like to add that I am experiencing fine performance on a HTC One M8.

    BUT....

    If I run the exact same game on a HTC One M9 the performance is horrible.

    Any ideas why a more powerfull phone performs way worse? ;)

    I noticed that the M9 has OpenGL ES 3.1 where the M8 has 3.0, does that have anything to do with it perhaps?
     
  3. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Well what happens when you restrict it to only Opengl 2?
     
  4. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    It is already restricted to OpenGLES2 actually ;)
     
  5. WishesMachine

    WishesMachine

    Joined:
    Aug 3, 2014
    Posts:
    10
    Unchecking "Use 32 bit Display Buffer" at Player Settings increased performance on an 2d Game.
     
  6. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Note, this is certainly not a solution - without 32bit buffer you're going to get colour banding on gradients etc. Ok for some games but certainly not acceptable for others.

    It's only improving performance at the (imo severe) cost of image quality.
     
  7. Droidspirit

    Droidspirit

    Joined:
    Aug 16, 2014
    Posts:
    43
    Dantus likes this.
  8. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Anyone test any of there issues with 5.2.1 to see if performance has improved or made worse?
     
  9. anthonov

    anthonov

    Joined:
    Sep 24, 2015
    Posts:
    160
    me,
    without change setting i get 30/40fps with 5.2, 60fps in 5.1.1
    i didnt read all this tread, can i solve this?
     

    Attached Files:

    TadeuszSynZygmunta and MrEsquire like this.
  10. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    You might want to be more specific about the version. What version are you using? 5.2.0f1? 5.2.0p1? 5.2.1f1? 5.2.1p1?
     
  11. anthonov

    anthonov

    Joined:
    Sep 24, 2015
    Posts:
    160
    its 5.2.1f1
     
    larku likes this.
  12. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
  13. Deepscorn

    Deepscorn

    Joined:
    Aug 13, 2015
    Posts:
    25
    For me it was Water4Advanced
     
  14. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    Have no water in my scene so thats not it for me at least! ;(
     
  15. Thiemo

    Thiemo

    Joined:
    Jan 15, 2013
    Posts:
    5
    Just to let you guys know. I have the same problem here. 5.2.1 running extremly slow on Android. Tested on 5 devices!
     
  16. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    If you are interested to find people who have the same problem in order to resolve it, or maybe to help Unity resolve it by submitting a valuable bug report, you should create a new thread stating the actual problem instead of posting in this thread.
    No one is able to follow this thread, because I have seen at least 4-5 different issues, yet everyone just agrees that the performance is not good and no one is actually interested to somehow do something about it.
     
    Jonny-Roy likes this.
  17. Thiemo

    Thiemo

    Joined:
    Jan 15, 2013
    Posts:
    5
    Of course you are right. I will work on this issue and if I can't find a solution I will start a new thread with a detailed report.
     
  18. CesarNascimento

    CesarNascimento

    Joined:
    Mar 26, 2013
    Posts:
    15
    Also got extreme performance issues on Android after upgrading to 5.2.1p1.
    Back to 5.1.2 I guess.
     
    MrEsquire likes this.
  19. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Wait for 5.1.4 final and see how things are?
     
    CesarNascimento likes this.
  20. Deleted User

    Deleted User

    Guest

    Also problem with upgrading from 5.1 -> 5.2:
    In my 2D game, the sprites on the scene seems to have big performance issues. When I put a background of few big sprites streched on the screen, fps drops by 15-20. When I played around with different shaders, some gave a bit better fps, but still way worse than in 5.1
     
  21. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    If you have the game in Unity 5.1 with known performance and then you try exactly the same in Unity 5.2 and the performance becomes significantly worse, it is a regression. If you submit a bug report with that project and if you mention there is a performance regression between Unity 5.1.x (pick the right version) and Unity 5.2.y (pick the right version), chances are high that Unity will investigate the issue.
    If you submit it, make sure to post the case number here, such that people can vote for it who experience the same performance drop.
     
    milox777 likes this.
  22. CesarNascimento

    CesarNascimento

    Joined:
    Mar 26, 2013
    Posts:
    15
    Eh, we wanted to upgrade to 5.2 because it fixed that WWW problem about it not showing the error status.
    If 5.1.4 final solves it then it'd be great.
     
  23. Deleted User

    Deleted User

    Guest

    Might have found a fix, check all your UI Sprites or Images, and if they don't have a material:

    - Add material with shader: Sprites/Default
    (if image doesn't need transparency, use Mobile/Unlit)

    I have a background scene compiled with several UI sprites, none had a material. After adding a default material to every sprite, performance was back to 60 fps.
     
  24. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    On which phone model did you experience this drop and solution on?
     
  25. nikkouskouk

    nikkouskouk

    Joined:
    Jan 23, 2015
    Posts:
    29
    In the same 2d project my lg g3 runs at 20 fps while my old Galaxy s3 runs at 50 fixed fps.I use Google play games plugin and UI with a text displaying the score that increases every 2 seconds.Any idea?
     
  26. DaDonik

    DaDonik

    Joined:
    Jun 17, 2013
    Posts:
    258
    I also have a very critical performance problem.
    The project i'm working on is only consisting of a few elements of the new UI (UGUI). 4 buttons and a scrollview with a few more buttons in it.
    The devices i test on:
    - Samsung Galaxy S3: Runs silky smooth. Scrolling the scrollview is just as it should be.
    - LG L40 (very cheap smartphone): Performance is the same as on the S3.
    - Nexus 7 (2013): Performance is abysmal, at max 10fps
    - Samsung Note 10.1 (2014): Performance is as abysmal as on the Nexus 7.

    Now the fun thing is that i started using the new UI with Unity 4.6. Back then everything i did ran the same on my Nexus 7, as it did on my S3. With Unity 5 that changed....drastically. I've done all the optimizations i read about. Solid camera clear color, non pixel perfect Canvas...hell there is not even much on the screen that could cause lags.

    EDIT
    All of the above is suddenly not true anymore, all i did was disabling deferred rendering and choosing forward instead. Dunno why i haven't tried that earlier, but now i feel stupid...
    Now my UI is as smooth as it could be on all of the 4 devices listed above.
     
    Last edited: Oct 20, 2015
    larku and elias_t like this.
  27. anthonov

    anthonov

    Joined:
    Sep 24, 2015
    Posts:
    160
  28. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    666
    That would be expected, deferred rendering relies on MRT which means essentially it's rendering to the screen 4 times over pretty much, so devices that don't have great bandwidth for textures would be a huge issue.
     
    larku likes this.
  29. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
    Tested my sample project today with Unity 5.2.2p1 and my scene is finally working with 60fps!
     
    larku likes this.
  30. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Does that mean you did nothing but change Unity version and that fixed your performance issues?

    Sounds promising if that's the case!
     
  31. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
    Well I have been changing that test sample project last few months with every optimization suggestion that has been mentioned inside this forum thread. Actually I can't even remember how many things I have changed.
    Last Unity version I've tried was 5.1.2p1 and with that version my project didn't work correctly.
    Today I've tried it with 5.2.2p1 without any additional tweaking and it finally works. Here and there, there is sometimes drop in FPS but for me there is significant increase in performance.
     
    larku likes this.
  32. dhkd1157-dalcom

    dhkd1157-dalcom

    Joined:
    Apr 16, 2014
    Posts:
    12
    UI-Default.shader for Unity 5.1 version and Unity 5.2 version seems to be different.
    As they added 2D Rect Mask in Unity 5.2, they changed the code for the frag shader part of UI-Default.shader

    so this is the code after they made a change (5.2):
    Code (CSharp):
    1. fixed4 frag(v2f IN) : SV_Target
    2. {
    3.     half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
    4.  
    5.     if (_UseClipRect)
    6.         color *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
    7.  
    8.     if (_UseAlphaClip)
    9.         clip (color.a - 0.001);
    10.  
    11.     return color;
    12. }
    and the code below is the code before the change (5.1):
    Code (CSharp):
    1. fixed4 frag(v2f IN) : SV_Target
    2. {
    3.     half4 color = tex2D(_MainTex, IN.texcoord) * IN.color;
    4.     clip (color.a - 0.01);
    5.     return color;
    6. }
    I wonder if this could affect the overall performance.

    I've posted an inquiry regarding this:
    http://forum.unity3d.com/threads/wh...p-work-in-ui-default-shader-of-newgui.364134/
     
  33. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Does anyone else seen improvements in 5.2.2p1?
     
  34. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I think you will need to install it, go through your pain again :)
     
  35. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Not again! 5th time....
     
  36. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I have installed 5.2.2p2 and tried my project. Still the same crappy performance. :( I have sent a new bug report to Unity (Case 741437) with all my project in it, I hope this helps because their Pro version says: 'Prioritized bug handling' and I have paid for 3 licenses (Pro, Android, iOS) and still I cannot update to the latest Unity. I am downgrading again!
     
    Last edited: Nov 2, 2015
    larku likes this.
  37. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    My issue was solved, or at least improved in 5.2.2 f1, so that just goes to show that this thread is full of different problems ;)
     
  38. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I have also tried 5.3B4 and the performance is exactly the same as 5.2.2. Bad.
     
  39. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    How? Did you do something?
     
  40. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    No, but my problem was bad performance when I ran my project on HTC One M9, but good performance on a HTC One M8. Have changet som stuff here and there, but nothing that should have an impact as far as I can see. So it is a mystery, I do not see any obvious reason for the sudden improvement in the release notes either ;)
     
  41. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I'm still waiting for a reply for my performance bug report. Case 741437
     
  42. Rusfighter

    Rusfighter

    Joined:
    Jan 18, 2014
    Posts:
    60
    MrEsquire likes this.
  43. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    127
    Guys the 5.2.2f1 does not improved any peformance for me.

    On game it self i get solid 60 fps with 3d objects and lots of canvas (in world space), but in main menu i get only 30 and after a lot of optimizations.

    So i have the idea of simplify the unity UI/Default shader to my needs, removing about every thing i possible can.
    See the attached files for the shader

    After that my main menu scene get up to 60 fps.

    Since is a simpler shader some functionality may not work, like masks. you still can use RectMask2D to cut of elements too far away in lists.

    Then you cannot use this on every element in your scene, but try to use at least on the bigger images, the ones that take more screen space.
     

    Attached Files:

    larku likes this.
  44. Deleted User

    Deleted User

    Guest

    I too am getting horrible performance. In an empty scene, I get ~10 fps. I used the Profiler and noticed "Physics.Processing" consumed about 40% of resources which is strange because it's an empty scene.
     
  45. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    I've tried your shader and the performance boosted from 60 fps to 100 fps! Although my images weren't displayed correctly anymore, you can see that there lies a potential problem!
     
  46. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    127
  47. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    131
    I found this too..
    if some sprite || Text is moving! the performance killer come!
    no moving is good ...but game also need this....TAT
     
  48. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
  49. PabloUnityArgentina

    PabloUnityArgentina

    Joined:
    Oct 13, 2014
    Posts:
    7
    Hi! I just want to help a little bit the people who has not read all this thread. I readed almost all this thread (I reached page 8 so far), and i make a simple list with some of the suggestions to increase the performance in unity 5 android.

    Here's the list:

    Hope to be useful to you. Bye!
     
    nikkouskouk, henkjan, Alexpi8 and 2 others like this.
  50. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    New beta for 5.3 says: Android: Optimized Standard Shader performance for OpenGL ES 2.0 devices
    Did they fix any of our problems? Anyone tried it?