• 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 SoshJam · May 19 at 09:38 PM · buildwebglprofilerperformance optimizationvsync

WaitForTargetFPS slowing WebGL to unacceptable levels

I'm trying to build my project for WebGL and I'm having a lot of issues. It currently runs at less than 10 FPS in the build. I click Build and Run and open the profiler for the project to see what's going on, and 98% of the CPU is being dedicated to "WaitForTargetFPS."

alt text

There's a ton of empty space below it because the actual code only takes about 5ms per frame. I don't know why WaitForTargetFPS could be eating up so much.

VSync is disabled in Quality settings for every quality level, and there are no references to Application.targetFrameRate in any of my scripts, so I have no idea why processing power still seems to be spent on VSync.

Some have said it's because my game takes too long to render frames, but I don't think that's the case. I get hundreds of FPS in the editor and no WaitForTargetFPS but only up to 10 in the WebGL build. It also works fine when I build to other platforms.

It's a really simple platformer game with just some sprites, and even changing the max texture size to 64 doesn't affect performance, so I think that's not the issue.

a.png (112.1 kB)
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 Nurallaerel · May 23 at 05:03 PM 0
Share

Have you found the solution? I am struggling with the same problem. Tried every possible VSync setting with the same outcome

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by LOSTSOUL86 · May 24 at 05:59 PM

I dont have exact answer...

Thats strange are you sure VSYNC is off? Mybe there is vSync anyway on tryind to pull the frame rate up? Also try change quality for all platforms to Very low and try again, maybe there are things heavy for webGL. Or try just to cut out some bits and pieces. Like disable everything apart from main character and run it.

And also what you should try is a deep profiler. There is a button in the middle of the profiler window. It will show exactly which process is taking long time.

I had the issue with low framerate and deep profiler show exactly whats the problem.

I am sorry but only this advise I have.

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

161 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Why does Unity Windows build use up more memory than WebGL? 0 Answers

Distribute terrain in zones 3 Answers

How to profile a WebGL app using the unity profiler tool? 0 Answers

Unity WebGL build error on browser 0 Answers

Lighting doesn't work properly in WebGL build 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