Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Luonic · Dec 01, 2015 at 02:37 PM · buglagperformance optimizationvsynclimitations

Gfx.WaitForPresent is limiting fps to 30-45 with Application.targetFrameRate = 60;

Unity 5.2.3f1 (Personal)

I have searched for fix enough but nothing worked. I'm building 2d arcade, VSync is off, correct usage of physics, not too much game objects, optimized sprites, sprites packed in atlases, i'm not using GetComponent<>() of GO.Find() in Update/FixedUpdate, etc.

Gfx.WaitForPresent just cuts performance.

I found that it's just time when everything is counted and rendered and system just waits, but I want it to render 60 fps, I don't want it to rest!

On different Nexus 5 2013 Android 6.0 runs smooth and fast but on Nexus 7 2013 Android 5.1.1, THL W810, Samsung Tab 8 (around 2013 year, dual core) and Samsung Galaxy S4 Mini runs with lags. This is very strange.

Please, help.

P.S. Selected in profiler frame - from gameplay, spikes after - pause and etc. alt text

profiler.jpg (236.6 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by alebasco · Dec 01, 2015 at 09:50 PM

In your case, it appears Gfx.WaitForPresent means that the CPU is waiting on the GPU to catch up. This means that all of your CPU work (physics, gameplay) is done, but the GPU is still trying to draw the frame, and is taking longer than the CPU took to do it's work. One is always going to be faster than the other, so if you're trying to figure out why your game is running slow, its important to figure out which is taking longer.

In the profile, I see you're looking at the CPU, and it seems to be running at a decent speed, so that would lead me to believe that the CPU is waiting for your GPU to catch up. To get some more data try enabling the GPU profiler. To do so, in the top left corner of the profiler, click "Add Profiler," and it should be present as an option there.

The GPU profiler should show you some handy things, but if the GPU is lagging, than that means you're trying to draw too much. Either you have too many objects, the objects are too high detail, or you have too many effects which force the objects to be drawn more than once. For instance, real-time shadows will draw your object extra times, in order to draw the shadow it casts. Some post processes will also take a lot of GPU space, and may result in drawing your objects extra times. In the newer versions, there is a Frame Debugger as well, which will allow you to look at everything that was drawn that frame.

If this information isn't enough, post the profiler with the GPU sections showing and we may be able to help more.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How To Reduce Physics Lag? 1 Answer

4.6.0 to 4.6.1 makes player lag, bug? 1 Answer

How can I make a convincing forest without lag? 0 Answers

Frame Rate acting weird. Performance issue? Mobile 2d game 0 Answers

Jump Force (rigid body velocity) is not equal in different mobile phones 0 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