• 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
2
Question by RedVonix · Aug 05, 2011 at 02:19 AM · fpsperformanceunity 3.4

Massive performance decrease in 3.4 / Device.Present taking large amounts of time

We have been working on a game over the past few months in unity 3.3 Recently we updated to 3.4, and XCode4, to take advantage of the updates to Unity 3.4. Fortunately, the game runs the same as it did before in terms of functionality, so nothing appears to have broken there. Unfortunately, our performance on the iPhone 4 has gone from around 30fps to around 3fps.

When running the profilers, the best result we can come up with is that Device.Present looks a little odd. Here are its stats:

Device.Present Total: 82.1% Self: 82.1% Calls: 1 Memory: 0B Time ms: 37.94 Self ms: 37.94

Reading through other profilers and reviewing code, everything else looks good. Since we've made no code changes - outside of updating the Prime31 plugins we use, SocialNetworking and GameCenter, to their latest versions, we're rather stumped on what could have broken in the product. We have reviewed things like the Quality and made sure its settings were the same as before. We are willing to bet a property or setting somewhere is new or changed from what we had it set to in 3.3 which is now causing this huge performance drop, we're just a bit stumped now on where to look.

Any suggestions, recommendations or support we could get on this matter would be wonderful. Thank you in advance!

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
3
Best Answer

Answer by RedVonix · Aug 17, 2011 at 07:32 PM

As it turns out, we hade to modify our shader code. The same shaders that had very little performance impact in 3.3 had massive performance impact on iOS in 3.4. So if you are stuck, check there. Also, in AppController.mm, change this:

define USE_OPENGLES20_IF_AVAILABLE 1

To this:

define USE_OPENGLES20_IF_AVAILABLE 0

Which we found also gave us a significant FPS increase (nearly doubled our framerate on iOS).

Comment
Add comment · Show 4 · 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 RedVonix · Aug 17, 2011 at 07:30 PM 0
Share

It turns out our needed

avatar image Ben Throop · Oct 10, 2011 at 08:41 PM 0
Share

WOW! I just found this and flipping this flag got us like a 10x perf increase. THAN$$anonymous$$S for posting this.

I was dealing with the same DEVICE_PRESENT stuff.

avatar image roamcel · Oct 11, 2011 at 04:00 AM 0
Share

Thanks for sharing this. Please be kind and mark your answer as the accepted solution, so that the question can be found as solved!

avatar image shinja · Nov 28, 2011 at 11:30 PM 0
Share

Hi I got this problem and it is still there and its driving us crazy after setting that flag and replacing it with custom shaders. I was wondering as well what type of shader are you using ? is it custom or the unity mobile ? Because apparently some places they say that shaders could be culprit. If you have any other suggestions any help would be great !

avatar image
1

Answer by mastermax001 · Apr 11, 2013 at 04:02 PM

big thanks to DCalabrese, you saved my work!

BTW, just a little note about Unity4: now AppController doesnt have anymore "define USE_OPENGLES20_IF_AVAILABLE 1" but for fixing the device.present problem you can just change the Graphics Level on Player Settings from OpenGLES 2.0 to OpenGLES 1.0.

Enjoy!

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
1

Answer by Leon700 · Oct 06, 2016 at 07:02 PM

In 5.4 uncheking the "Auto Graphics API " ( in player settings) and deleting GLES3 Gave me back a few FPS

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 Lightstream · Dec 19, 2016 at 03:42 PM 0
Share

Our lord and saviour.

But why? Can you explain that?

avatar image
0

Answer by roamcel · Aug 05, 2011 at 09:53 AM

I have noticed that 3.4 adds some pragmas to certain scripts when you upgrade a 3.3 or older project, to avoid unsafe code in javascript. The only thing I can think off is that you might have developed using 'unsafe' (by 3.4's new standard) variable declaring, and that maybe unity is just trying hard to avoid crashes and such, since your scripts might not be headed with the new required pragmas. I suggest you dig into the new pragma statemens introduced in 3.4, and deduce if they might be the cause. Hopefully you'd just need add those lines to fix the performance drop.

Another thing you can try: compare your scripts (pain in the ass, but could be worth it) from a backup of your 3.3 project version, and from a 3.4 fresh import version.

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 Xroft666 · Aug 17, 2011 at 08:37 AM 0
Share

We have a project which is scripted in C# only. But because of Device.Present we have only 5 fps on iPad. And it is and Unity 3.3 project, not 3.4

avatar image roamcel · Aug 17, 2011 at 09:34 AM 0
Share

Sorry but it seems I misunderstood the situation. Good luck in finding a solution.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

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

Related Questions

GPU usage and FPS have suddenly dropped significantly for my project and several others that I've tested 0 Answers

FPS decreases over time in editor (Potential memory leak?) 2 Answers

GPU at 15FPS, please help 0 Answers

Combine Objects/Meshes to reduce drawCalls 2 Answers

CPU usage always high on all types of iphone 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