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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Very bad performance in empty project!

Discussion in 'Android' started by michal_k, Nov 1, 2015.

  1. michal_k

    michal_k

    Joined:
    Jul 31, 2014
    Posts:
    33
    Hi,

    I'm using Unity 5.2.2f1. In my sample project there is only camera with FPS Script.
    On my android device I'm getting only 30fps!
    I am able to get 60fps but only when I force lower the resolution in the app.

    Here is the empty project:

    https://www.dropbox.com/s/m3r3ytwwokmfme0/AndroidFPSTest.zip?dl=0

    Am I doing something wrong? Is it bad to have full native resolution 1280 x 720 in Unity? Or do I have to use lower resolutions like 720x405 to get good performance?

    My phone is not the highest end, but I would expect to be able to draw empty scene with 60fps...

    Thanks.
     
  2. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    The procedural skybox can be quite expensive on lowend devices, especially if you fill the entire screen with it :) Normally large parts of the skybox would be covered by a less expensive fragment shader.

    Try clearing with a solid color, or add some geometry to not make the heavy skybox fill the screen.
     
    michal_k likes this.
  3. michal_k

    michal_k

    Joined:
    Jul 31, 2014
    Posts:
    33
    With solid color it's still fluctuating 30-45 fps..

    Is there any example Android project, which is set up properly and is expected to have good performance, so that I can check if it produces good performance on my device?
     
    Last edited: Nov 1, 2015
  4. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    An empty scene that only clears the screen using a solid color should definitely run at 60fps. What device are you using?
     
    michal_k likes this.
  5. michal_k

    michal_k

    Joined:
    Jul 31, 2014
    Posts:
    33
    Hi, it's this one. http://www.gsmchoice.com/en/catalogue/pentagram/monsterx5/Pentagram-Monster-X5.html
    I was hoping to find some example project with everything set up but with no success.

    However I'm not sure if this is the problem but:
    -after I disconnected usb, killed Unity Remote 4, killed the application in Android and started it again the performance improved. Now I'm getting about 60 fps with only cube added, but it still fluctuates at 40-60 fps for some reason.
     
  6. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Oh my! That device is _really_ slow. At native resolution it's actually slower than the 5 year old Nexus One.

    My recommendation would be to drop the resolution if you are serious about supporting devices like that. Even if you should be able to clear the screen and maintain 60fps I'm not sure you can afford anything else. You could also try running a 16bit display buffer to reduce the needed bandwidth.
     
    michal_k likes this.
  7. michal_k

    michal_k

    Joined:
    Jul 31, 2014
    Posts:
    33
    Hi, thanks for help.
    How do you know that it's slower at native resolution? Are there some stats to check the performance like that?
    I've bought it ~2 years ago and it was sufficient for me at that time... maybe it's time to move on :p
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    He can see the hardware it uses on the page you linked. And that GPU isn't really good for much when you raise the resolution... a common problem with cheap phones.

    And.. it's time to move on :D A modern android phone with beefy stats will beat out an xbox 360. Sort of, depending what you're doing!
     
    michal_k likes this.
  9. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    I have actually seen something similar - an "empty" project (e.g: the default empty scene with a camera + skybox) running at 30 FPS on a Samsung Galaxy Tab 2.

    I did not have proper time to keep investigating it, but it seems that an empty scene should be able to run at 60 FPS....
     
    michal_k likes this.
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    The default skybox is kinda expensive for mobile. So that's not an "empty" scene.
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah it's pixel shader math heavy, which is death on mobile. Just slap a classic skybox on and see it ramp up to 60fps. Just because Unity went PBR it doesn't mean mobiles became PBR capable.

    Good thing is you get to use any shaders you want. I'd recommend the mobile ones.
     
  12. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    I actually was able to get 30 fps with as little as a single sprite in the scene and a solid clear flags. Again, i'm talking about a pretty old device (Tab 2) but still this seems like pretty low performance for a single rendered object..
     
    michal_k likes this.
  13. michal_k

    michal_k

    Joined:
    Jul 31, 2014
    Posts:
    33
    Thanks for all answers.
    After testing with empty scene I managed to run my game in Genymotion - oddly (or coincidentally- which is better since deployment is faster in it), the performance is quite the same as on my phone (i'm getting 50-60 fps on phone and in genymotion - in editor 130-180fps) ! I've changed all shaders to mobile, removed Detonator Framework and I think I'll use simpler style to have better performance ("blocky" like Crossy Road).