Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Oniony · Dec 24, 2013 at 05:46 PM · androidrenderinggraphicsoptimization

Why does my game require so much rendering power?

Hey everyone. I made an android game in Unity over the past 3 months and for the past week I've been trying to optimize everything to get the game to run at a decent fps. I fixed up all of my scripts, but I still have bad fps. When I check the profiler Unity says my game is using 63% on Device.present under Graphics.PresentAndSync. 43ms!(http://puu.sh/5Xkoa.png this pic is of the profile analyzing the game running on my galaxy tab 10.1) I've searched and searched but nothing seems to help. I'm pretty much a beginner with Unity and game making in general so I'm left clueless.

Here's what I've tried doing:

  • Changing the opengl version (no effect)

  • I've changed all my shaders to mobile shaders

  • Changed all of my textures to their lowest settings while still being able to keep them looking nice.

  • I've put mostly everything into a texture atlas.

More pics: The title scene http://puu.sh/5XkPd.jpg

The title scene with stats displayed http://puu.sh/5XkKd.jpg

As you can see in this scene I have only 21 draw calls or lower. In-levels I never go over around 17-18. Can someone please help me figure out what the problem is?

Additional Info: Game runs at a constant 60fps on my HTC One, but that's because it's brand new. I can't just exclude any users who don't have a new device.

EDIT: I forgot to mention my game is a 2D game. For most things, I'm using a texture atlas and unity's built-in spriting system.

Comment
Add comment · Show 1
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 azmat786n · Dec 24, 2013 at 06:50 PM 0
Share

hmmm its not a big problem you can add me for help. http://www.facebook.com/azmatalimeer

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by iwaldrop · Dec 24, 2013 at 09:08 PM

Device.Present is called most often when Unity is waiting for VSync. In other words its simply waiting so that drawing can be in sync with the refresh rate of the device. What is probably happening is that it is taking slightly longer for you to draw a frame than the device can post them to the frame buffer which causes you to wait until the next frame to do anything.

Here are a couple things you can do to fix it:

  1. Checkout the answer to this question. In short, your shaders can prefer OGLESv1 over v2.

  2. Depending on your Unity Version there is either a checkbox or a dropdown to control VSync. Either uncheck it or select Don't Sync.

  3. Ensure that Application.targetFrameRate is set to your desired target frame rate. Because you state that your HTC One does 60 fps, you may have already done this, but perhaps you have some logic that sets this dynamically and is acting up.

  4. Evaluate your scene for overdraw (transparent textures that overlap); it can cause quite a lot of slow-down on older devices.

  5. Also, try some of Statement's troubleshooting suggestions / potential fixes.

And, at the end of the day, old devices are not new devices, and will not perform the same. You didn't mention what device was getting the 15fps, but, in reality, you can exclude some older devices. At my shop, whenever an Android user complains of something not working right, we just remove the device from the allowed devices list on Google Play. It's just not worth the engineering resources for us to try and support all of those 4k+ devices.

Comment
Add comment · Show 2 · 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 Oniony · Dec 26, 2013 at 01:19 AM 0
Share

After a ton of testing and building probably 30+ different builds with little things changed every time, I think I've come to the conclusion that the problem lies with just having too many transparent textures in the camera's view at any given time.

Actually, I tried building an empty game with a scene that had nothing in it, and the profiler still reported around 60% for Device.present. I didn't know what to make of that, though, which is why I assume it's transparencies.

But my game uses a lot of transparencies. I don't know how I can improve something like that aside from taking all my transparent textures and filling in the transparent parts and using a regular diffuse shader. But that'd look terrible.

I figured since I was using Unity's sprite system that it would be faster than using cubes or something.

avatar image Oniony · Dec 26, 2013 at 04:56 PM 0
Share

I'm marking this as the answer because I believe the problem is overdraw after all since my game uses so many transparent textures. In the end I decided to forget about trying to change my game by changing all of the textures. Ins$$anonymous$$d I give the users an option to change the resolution to something smaller, which does increase fps a bunch.

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

21 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

Related Questions

A node in a childnode? 1 Answer

Is it possible to use a different mesh for shadow casting than for normal rendering of an object? 2 Answers

Heavy Unity scene on Android (Samsung Galaxy) 2 Answers

Unity Blob shadow projector massive tris amount, why? 1 Answer

3d meshes not drawn on some platforms 1 Answer


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