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

Latest Unity Patch 5.2.1p2 is super slow on android tablet (Galaxy Tab)

Discussion in 'Android' started by giorgos_gs, Oct 1, 2015.

  1. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Unity 5.1.4 works very nicely. I got my 60FPS back and I even found a new way to get some more extra FPS!
    I use Sprite Packer and now there is a beta of version 4 which has an amazing new feature for Unity:
    * Optimized polygon mesh sprites — to increase performance
    This reduced my triangles from 2100 to 450 and gave me some extra FPS!
    https://www.codeandweb.com/blog/2015/09/21/optimizing-unity-sprite-meshes
     
  2. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    In the Texture Inspector select Texture Type "Advanced" and then Format "RGBA 16 bit".
     
  3. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Do you think this will restore the original performance of 5.1.4?
     
  4. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Anyone to try this solution to 5.2.2 please? I am not wasting one more day to reinstall it.
     
  5. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    It seems this will not help with the performance issues.
    So the real question everybody wants to ask is:
    When should we wait for a fix?
     
  6. nikkouskouk

    nikkouskouk

    Joined:
    Jan 23, 2015
    Posts:
    29
    I ve been working on my android game performance for a week now.I have tried almost everything.Yes,texture packer is an awesome tool.It helped me to drop my tris to 300,but for some reason my game works perfect in some devices and it lags in my Lg g3 all the pc android emulators and i dont know if it lags in other devices too.I dont know what the problem is.I am really confused with all those compression numbers and what works for every device.The only think that worries me is that my lg g3 has spikes whatever i try and if my g3 lags maybe more high end devices lag too...

    Edit:seems like texture packer works no more at unity 5+ versions.I tested it and i have ~300 tris with or without it.Maybe unity changed the mesh algorithm?
     
    Last edited: Oct 26, 2015
    MrEsquire likes this.
  7. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    5.2.2patch1 would be better to try out on
     
  8. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    @nikkouskouk, are you rendering at native resolution on the LG G3? I don't have that device here, but afaik it's a 1440p phone with an Adreno 330 GPU, which at least sounds like it's kind of underpowered.
     
  9. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I noticed that if you apply some changes to the sprites atlas in Unity after you have saved the texture packer atlas the tris go back to Unity standard and you have to save with texture packer again. Do you have the latest Texture packer beta version and set the Trim mode to Polygon?
     
  10. nikkouskouk

    nikkouskouk

    Joined:
    Jan 23, 2015
    Posts:
    29
    Yes and yes.What i did was import all sprites to texture packer set trim to polygon and then publish to unity.In unity the only thing i did was just to slice the spritesheet. I ended up with exactly the same polygon counts. Anyway my game isnt cpu bound so i think tris dont have to go down. Actualy gamebench scores 5-7% cpu usage and 70% gpu usage in my game.
     
  11. nikkouskouk

    nikkouskouk

    Joined:
    Jan 23, 2015
    Posts:
    29
    YES.This sounds like a good fix. I thought that i cannot change android resolution if the phone is not rooted..So i can simply set screen.resolution(720,1080,true) and android phone will be forced to render the game to the closest matching resolution?Actually the phone will still render at 1440p with upscalling?

    PS. I wouldnt say that lg g3 is an underpowered device at all. I have tried many heavy graphics games from the play store and they dont lag at all. And believe me the lag is still present in the simple scenes .I can create a sprite move it from the bottom to the top of the screen and still notice the spikes every 0.5 seconds .
     
    Last edited: Oct 27, 2015
  12. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    One guy reported that 5.2.2p1 fixed his framerate. Does anyone else experience this?
     
  13. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    No, I have installed 5.2.2p2 and tried my project. Still the same crappy performance. I am downgrading again! (filed a bug with all my project in it: Case 741437)
     
    Last edited: Nov 2, 2015
  14. 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.
     
    MrEsquire likes this.
  15. noethis

    noethis

    Joined:
    Nov 11, 2013
    Posts:
    129
    I'm running 5.2.2p1 and my users are also experiencing performance issues (to the point of being unplayable) on a handful of devices:

    -nexus 6p (angler) - adreno 430
    -LG V10 (pplus) / os5.1 - adreno 418
    -galaxy s4 - powervr sgx 544
    -nexus 9 (flounder) / os5.1 - Kepler DX1
    -oneplus one - adreno 330

    Could be multiple issues, but wondering if there is a specific issue with Adreno GPUs on U5.2?
     
  16. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I'm still waiting for a reply for my performance bug report. Case 741437
     
    MrEsquire likes this.
  17. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    If its an Andreno GPU issue, there are tons of andreno devices out there...
     
  18. noethis

    noethis

    Joined:
    Nov 11, 2013
    Posts:
    129
    @florianpenzkofer Went back and read your posts in this thread about texture compression. I'm wondering if that might be my problem is that 5.2 switched to compressing alpha textures with ETC2 by default. I currently have my Build Settings set to ETC (default) and am not currently doing any overrides on a per-texture basis. So perhaps on the devices listed above it's just decompressing all the alpha sprites I have at runtime.

    I'm a little confused on what steps I should take to address this, however. Should I be building multiple APKs with different build-level texture compression settings (Adreno, PowerVR, Tegra) or should I just stick to one build and set alpha textures to not be compressed?

    Let's say I go with the latter approach--then for anything that is atlased it sounds like I can do an override and check the box for "Compress using ETC". Do I do this for every single texture that is atlased or is there a way to edit the atlas texture itself? And then for any alpha texture that is not atlased I just need to set it to RGBA 16 bit, correct?
     
  19. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I tried not to compress the textures to see what happens and I get exectly the same performance. Its like compression does nothing to performance. I tried every option and the performance is always the same.
     
  20. nikkouskouk

    nikkouskouk

    Joined:
    Jan 23, 2015
    Posts:
    29
    My game is published at play store.
    https://play.google.com/store/apps/details?id=com.Pegi3.Catvengers
    Can someone here test it and see if their game lags like mine?
    I have all my sprites compressed using the default compression for android and i have selected Etc default texture compression.
     
  21. Ges

    Ges

    Joined:
    Apr 23, 2014
    Posts:
    31
    I have same problem too. This case caused by standard UI shader. That use if statement in fragment shader to support rect mask. Using if statements in fragment shader is impermissible.
    To Unity: better split shaders with "#ifdef" and use it separate in or out rect mask.
     
    ziwert likes this.
  22. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    This is a very good idea.
     
  23. knickerbocker

    knickerbocker

    Joined:
    May 8, 2014
    Posts:
    29
    Im having the same issues. Really frustrating to see my 3D scene which has less than 1 million polygons slow down so much on the android but work fine on ios and PC. At first i thought it was the 3d meshes and optimised the hell out of everything by combining and lowering count, etc but to no avail, still very very bad performance. I'm going to downgrade to 5.1.4 because i suspect its to do with my UI which is heavily used throughout my project.

    Its not like i can keep telling my client " oh sorry this version of unity has broken your paid project, just gonna have to wait till they fix it, maybe by december". I truly don't believe its useful to upgrading versions any more because with every release and new services pushed by Unity team, i've had my development pushed back by so much.

    Like giorgos_gs has mentioned, can't keep wasting time by downgrading upgrading downgrading till i find that sweet spot.

    EDIT:
    Tried downgrading to 5.1.4 but seems like all of my UI components like text, image, etc is completely broken and comes up as "missing" so no can do. Gonna go to 5.3
     
    Last edited: Nov 13, 2015
  24. 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? I may try it today.
     
  25. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Good news everybody, 5.3f1 fixed all my performance issues.
    1) Scene loads like in 5.1.4
    2) FPS are now 60FPS like 5.1.4
    3) Graphics quality is now like 5.1.4 with normal compression!

    Everything is great! Well done Unity excepts the APK is now much larger! This is weird, it was 32mb and now is 52mb. How come? This has to be fixed. Also Unibill does not work, it has tons of error conflicting with Unity's own IAP and I had to erase it. That is bad since Unity IAP does not support Amazon and Samsung, at least not now!
     
  26. knickerbocker

    knickerbocker

    Joined:
    May 8, 2014
    Posts:
    29
    So 5.3.0F1 fixes your performance issues? This being beta has me weary but i'll try it now and report back .Thanks for posting it on here.
     
  27. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    5.2.2p4 fixes all my performance issues so it depends on the technique you use I think.
     
  28. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I havents tried 5.2.2p4, only p3.
     
  29. Ges

    Ges

    Joined:
    Apr 23, 2014
    Posts:
    31
    In 5.2.2p4 UI shader still bad. In 5.3f1 it rewrite - if statements was removed.
     
  30. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Maybe this is what it meant when they said: "Android: Optimized Standard Shader performance for OpenGL ES 2.0 devices"
     
  31. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    I use 2 ui shaders from this post: http://forum.unity3d.com/threads/wh...p-work-in-ui-default-shader-of-newgui.364134/
    It did it for me!

    @giorgos_gs: what I understand is that the standard shader is optimized. I've tried those and they are faster but not as fast as a mobile/diffuse shader. In my project the fps dropped +/- 10 frames after replacing al mobile/diffuse shaders with the standard shader on a Galaxy Tab 2
     
  32. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Anybody else tried 5.3f1?
     
  33. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Unity just released 5.2.3. I have seen that they put in some of the changes of 5.3f1 but I didnt see: "Optimized Standard Shader". Does it work like 5.3f1? Anyone tried it?
     
  34. Ges

    Ges

    Joined:
    Apr 23, 2014
    Posts:
    31
    1. Download "Built in shaders"
    2. Open DefaultResourcesExtra/UI/UI-Default.shader
    3. See frag function. If statements is exists in 5.2.3.
     
  35. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Havent installed 5.2.3 yet
     
  36. Ges

    Ges

    Joined:
    Apr 23, 2014
    Posts:
    31
    Built in shaders download separately
     
  37. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    @noethis your problem shouldn't be caused by the switch to ETC2 as default compressed format for RGBA. Most of the devices you listed (except for the PVR SGX) support ETC2 even when forcing Graphics Level to use OpenGL ES 2.
     
  38. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I just tried 5.2.3p1. Its even worse than the previous 5.2. I had 60FPS in 5.14, 15FPS in 5.2.2 and now 8FPS in 5.2.3! I attach the profiler. Thanks god 5.3f2 restores my speed to 60FPS. I think 5.2 versions are the worst version I have seen Unity make the last 2 years by far. I hope 5.3 fixes this and open a new chapter.I am downgrading again to 5.1.4. Unity devs, please pay attention to 2D developers as well and try to make your engine faster in mobiles.
     

    Attached Files:

    phuijse and leni8ec like this.
  39. EdPS

    EdPS

    Joined:
    Sep 15, 2015
    Posts:
    3
    Hello guys,

    I just came across the same problem discussed here, so I wanted to share the tests I ran and their results.

    My setup:
    - Unity 5.3.1f Personal (the only version tested as I am fairly new to Unity)
    - Test devices: Galaxy Tab 4 7.0, Galaxy S3 mini, Huawei Y550
    - App: The app I am testing is a 2D game completely developed using UI elements (i.e. all the elements , as images, texts, etc, live inside the canvas). All textures used come from a single sprite atlas of 1024x1024.

    The problem: Running my firsts tests on devices after expending a few months developing in the editor, I noticed good performance on both the S3 mini and the Huawei, but slow performance on the Galaxy Tab (quite unexpected because it has a more powerful hardware than the S3 mini).

    I found this thread looking for answers and ran some of the solutions proposed here. This is what I found.

    1) Changing texture compression (in the atlas) made no difference in performance. For all applicable cases, normal compression quality was used.

    Test1.jpg

    2) Applying ggunni's suggested fix of not leaving materials empty, there was significant improvement:

    Test2.jpg

    In conclusion, it seems that the problem lies in the optimizations done by Unity for rendering that may not work in some hardware in cases where materials are left blank. Maybe there are some other issues besides material selection that could boost performance even further, but those probably can't be controlled by us.

    I hope Unity's development team can find a permanent fix for this issue.
     
    theANMATOR2b likes this.