• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by slek120 · Mar 16, 2014 at 04:24 PM · androidguifpsframerateefficiency

Low FPS on empty scene

I made an empty scene with just one game object to display FPS. When I run on my android phone, I get pretty bad stats.

 Android Unity internal profiler stats:
 cpu-player>    min:  6.3   max: 25.7   avg: 20.3
 cpu-ogles-drv> min:  0.2   max:  5.1   avg:  0.3
 cpu-present>   min:  0.3   max: 17.0   avg:  0.8
 frametime>     min: 15.2   max: 26.2   avg: 21.5
 draw-call #>   min:   2    max:   2    avg:   2     | batched:     0
 tris #>        min:    18  max:    18  avg:    18   | batched:     0
 verts #>       min:    40  max:    40  avg:    40   | batched:     0

Here is the script attached to my one game object to display FPS.

 using UnityEngine;
 using System.Collections;
 
 public class DebugHUD : MonoBehaviour
 {
     public static DebugHUD debugHUD;
     public bool debugOn = true;
     public float updateInterval = 0.5f;
     private int frames = 0;
     private float duration = 0;
     
     // Singleton
     void Awake ()
     {
         if (debugHUD == null) {
             DontDestroyOnLoad (gameObject);
             debugHUD = this;
         } else if (debugHUD != this) {
             Destroy (gameObject);
         }
         
         if (!Debug.isDebugBuild)
             debugOn = false;
         
         if (guiText) {
             guiText.fontSize = (int)(Screen.width * 0.05f);
             if (debugOn)
                 StartCoroutine (UpdateFPS ());
             else
                 guiText.enabled = false;
         } else {
             Debug.LogWarning ("Please attach GUIText component to game object");
         }
     }
     
     void Update ()
     {
         ++frames;
         duration += Time.deltaTime;
     }
     
     // Display FPS data
     IEnumerator UpdateFPS ()
     {
         float fps = 0;
         string format;
         // Cache reference to components
         GUIText FPStext = guiText;
         Material material = FPStext.material;
         
         while (true) {
             duration = 0;
             frames = 0;
             yield return new WaitForSeconds (updateInterval);
             
             // Only do division once
             duration = 1 / duration;
             
             // Only update if FPS changes
             if (fps - (frames * duration) < 0.01 && fps - (frames * duration) > -0.01) {
                 continue;
             }
             
             fps = frames * duration;
             format = System.String.Format ("{0:F2} FPS", fps);
             FPStext.text = format;
             if (fps < 30)
                 material.color = Color.yellow;
             else if (fps < 10)
                 material.color = Color.red;
             else
                 material.color = Color.green;
         }
     }
 }

The internal profiler says around 45fps and that's what my script displays. Does this mean that I won't be able to get my fps any higher than this on this device? It's kind of disheartening that I have made probably the most efficient possible app and it only gets 45 fps.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Jlu · Mar 16, 2014 at 04:51 PM

Try adjusting the target framerate:

 Application.targetFrameRate = 60;

Remember, that you probably shouldn't exceed 60 fps in production, so you don't waste precious resources (and battery on mobile, of course).

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image slek120 · Mar 17, 2014 at 09:21 AM 0
Share

The default is -1 which means that it is using the highest framerate possible. $$anonymous$$y framerate is 45 which is below 60.

avatar image
2

Answer by Raimi · Oct 09, 2014 at 07:25 PM

Go to...

Edit > project settings > quality

and deselect Beautiful and Fantastic under the android quality settings. you will see a huge increase in fps. Also tweak some of the other settings to get what you want.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by leohotluz · Jan 14, 2019 at 11:42 PM

Same problem, in unity 2017 and 2018. Empty scene, empty project, quality on lowest, 50fps in maximized game view.

The weight should be zero, and the fps go to 2000 as it did in unity 5.6 ... it seems that the performance of unity has gotten much worse.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by KenSteelyHunter · Mar 12 at 02:06 PM

same problem, ; unity given me 50 fps on my redmi note 5 in empty scene without dyn lights (baked); and 29 fps with ONE mesh in space; when I ran first my try (with player, 2poly floor and static light and few materials w\o textures) I get 15 fps.; in this time, I copyed my project into Unreal, with dynamic lights, with dynamic materials, with textures, ;with many meshes and I was get 40-50fps on the SAME my redmi note 5!; . rly idn HOW making games on unity now... idn...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[Android] Why does my enemy die no matter where I am in the 3D environment? 1 Answer

Android/IOS First Person Shooter 2 Answers

Is it possible to get above 30 FPS on an Android device? 2 Answers

Fixing timestep to lower value showing wrong FPS 0 Answers

Why is the Motorola Xoom (Dual Core) slower than the Samsung Galaxy S (Single Core)? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges