• 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 unitylove · Mar 11, 2011 at 02:51 PM · webplayerframeratestandalonevs

Webplayer deliberately caping the framerate?

As a standalone, my game runs at approx. 180fps in fullscreen mode as well as windowed mode. In the webplayer (tested using Firefox 3.6.1 and IE8) it runs with a constant 32fps. When I switch to fullscreen in the Webplayer (resizing to actual fullscreen resolution, no upscaling) it runs with exactly 64fps. Is the Webplayer deliberately caping the framerate? Any thoughts on why this is happening?

P.S.: I measured this using a Core i5 running winXP + NVidia 9600 GT. I also tested this on an Intel dual core running Win7 + onboard gfx and fps were fluctating between 40 and 60 fps, which seemed reasonble because of the onboard gfx and standalone behaviour on that machine.

I am measuring the frames per second using an in-game script as well as using Fraps. Both show identical results.

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

3 Replies

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

Answer by Eric5h5 · Mar 11, 2011 at 06:36 PM

Yes, the framerate is capped in the webplayer. Which numbers you get depends on the browser and the OS. (e.g., Safari on OS X is actually not capped in non-fullscreen mode.)

Comment
Add comment · Show 7 · 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 unitylove · Mar 14, 2011 at 09:01 AM 0
Share

Can this behaviour be disabled? I am measuring frames per second at runtime and choose level of detail and render settings on the fly accordingly. Now with a fixed 32fps, my game always chooses the lowest level of graphics detail altough it could easily render it at the highest level in the webplayer (remember my standalone runs at 180 fps!!).

What are the capping numbers that depend on Browser and OS? What's the idea behind capping the frame rate depending on Browser on OS in the first place?

avatar image Eric5h5 · Mar 14, 2011 at 09:33 AM 0
Share

It can't be disabled. The way plugins work depends on the browser and OS so it's not entirely under Unity's control anyway.

avatar image unitylove · Mar 14, 2011 at 09:42 AM 0
Share

So if frames per seconds do not represent actual workload, how can I adjust graphics settings at runtime dynamically? After all it is an extreme difference if someone's using a dedicated graphics card or just an onboard card a'la Intel G$$anonymous$$A945 (extremely slow, yet the most widespread setup accordings to Unity Webplayer statistics).

Regarding "not under Unity's control": This must be a limitation of Unity. I can get the browser's window handle and render into the window using DirectX as fast as I want/the machine can. I don't understand the idea behind Unity's way of capping the frame-rate.

avatar image Eric5h5 · Mar 14, 2011 at 11:00 AM 0
Share

As I illustrated with Safari on OS X, different browsers on different OSs have different behavior. Firefox is clamped to 50fps, Safari isn't.

avatar image unitylove · Mar 14, 2011 at 12:19 PM 0
Share

Again, is there concrete information what the capping values are for existing OS/Browser combinations? (e.g. Firefox 3.6.1 on my XP machine is capped to 32 fps in windowed mode and 64fps in fullscreen mode, not 50!)

Since I know neither Firefox nor IE pose any limitation on framerates, it's Unity's "fault".

This renders any automatic FPS based behaviour (like adjusting details on the fly) useless. So why does Unity do it? And why don't they cap it to the same value (at least on Windows)?

Show more comments
avatar image
0

Answer by Bunny83 · Jun 21, 2013 at 02:05 PM

Well you can kind of "disable" the cap in the webplayer, however browser games live in a different environment. Running as fast as possible can massively lower the browsers performance. Keep in mind that your webpage is probably not the only one loaded. If your game expects to have full power, create a standalone build.

Anyways take a look at Application.targetFrameRate and the example in the code section.

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 Marrt · Jun 21, 2013 at 02:31 PM 0
Share

Application.targetFrameRate is not a valid solution since you need vsync for smoothness or some frames are skipped/doubled (hiccups) regardless of how you set the targetFrameRate (except it is way above 2 times the screen refresh rate).

When Vsync is enabled, i get inconsistent results on different machines, results that cap the frame rate at 50 despite the screen refresh rate is 60. Setting the Screen refresh rate to 50 works and even hiccups dissapear (that means that vsync is working). On other machines 60fps vsync works right away.

I wrote this to detect hiccups: http://marrt.elementfx.com/Smooth$$anonymous$$ovementTest.html Just watch the upper row for smoothness

avatar image
0

Answer by rodriguez80alvaro · Oct 25, 2017 at 02:05 PM

Well you can kind of "disable" the cap in the webplayer, however browser games live in a different environment. Running as fast as possible can massively lower the browsers performance. Keep in mind that your webpage is probably not the only one loaded. If your game expects to have full power, create a standalone build. Anyways take a look at https://www.zz.com.ve and the example in the code section.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

How to achieve web player like compression in standalone? 2 Answers

Weird game-output! 1 Answer

Build unity application using a unity application. 1 Answer

[PlayerPrefs] Shared saves between WebPlayer and Standalone? 0 Answers

Standalone networking system? 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