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
7
Question by Cyclops · Mar 08, 2010 at 09:31 PM · performancewebplayerstandalone

Performance Differences in Standalone player versus Web Browser?

Summary - I'm seeing performance differences in the Web Browser versus a standalone executable version of a Unity build. And I don't know why. :)

Situation: I've created the simplest scene I can - a 50-yard terrain, and a FPS controller at one end, plus a Frames-per-second guiText. I create both a standalone executable, and HTML file for testing. I have not changed any of the default Unity parameters.

In the standalone file, I run (via the FPS controller) from one end of the ramp to the other end - it takes 7-8 seconds to reach. Frames-per-second is showing in the thousands.

In a Web Browser (both Opera and IE) I do the same run down the ramp, and it takes 14-15 seconds to complete. The Frames-per-second generally shows 100+.

Why is there a time difference between these two?

At first, I was thinking that the difference in framerate would affect the run speed. But I looked over the FPSWalker script, and it uses FixedUpdate(), as well as Time.deltaTime applied to speed. So I would have thought that this compensated for the framerate difference.

I previously asked a question about Animation clips playing for different times, and it was suggested it might be a bug. But just moving the FPS controller around, in standalone versus a browser - it's too basic. I can't see how something that fundamental would be a bug. :)

Which means it's something in the configuration, in the scripts - or possibly in my assumptions. :) My first assumption is that they should perform the same - but I don't really know that. How should it work, given identical scenes, and no Unity configuration changes? And if they should work the same - what could cause it to not do so?

Update: mea culpa... I thought the code for reporting my Framerate was working, but maybe not. In any case, I tried setting the framerate to 30 frames-per-second, and both the standalone executable and Web browser then performed at the same speed. Sigh...

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

2 Replies

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

Answer by duck · Mar 08, 2010 at 10:00 PM

The frame rate is capped to a maximum when running in windowed mode in a web browser (i.e. not fullscreen).

This was implemented by UT so that the web browser doesn't end up eating up all the cpu power just because Unity is running (which, in turn, helps the Unity plug-in to not become known as a CPU hog). If you switch to full-screen mode you should see the frame rate cap lifted.

The difference in physics behaviour is a little strange though. (I thought I had spotted the reason for it, but my theory turned out incorrect so I have deleted that portion of the answer!)

Comment
Add comment · Show 6 · 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 Cyclops · Mar 08, 2010 at 10:14 PM 0
Share

I'm not sure why that's an error. The reference page for fixedDeltaTime actually says, "For reading the delta time it is recommended to use Time.deltaTime ins$$anonymous$$d because it automatically returns the right delta time if you are inside a FixedUpdate function or Update function."

avatar image duck ♦♦ · Mar 08, 2010 at 10:16 PM 0
Share

Hehe yes I was just discussing this in IRC and discovered that it's not an error. I wasn't aware that deltaTime had this extra functionality!

avatar image duck ♦♦ · Mar 08, 2010 at 10:19 PM 0
Share

Deleted incorrect portion. The reason behind the frame rate difference remains correct as far as I'm aware, though :)

avatar image Cyclops · Mar 08, 2010 at 10:19 PM 0
Share

Hm, I probably should get an IRC client... :) I forgot to add to my first comment, I did switch to full-screen, and didn't see a major frame-rate increase of the browser. Still roughly in the 120+ range.

avatar image duck ♦♦ · Mar 08, 2010 at 10:22 PM 0
Share

I was under the impression that the frame rate cap was actually 50fps for webplayer builds, so I'm wondering how you're seeing measurements that high - perhaps post your fps measurement code? (and click the "irc" link in my unityanswers profile for information about the unity irc channel, including a link to a browser based client)

Show more comments
avatar image
0

Answer by Ashkan_gc · Jun 01, 2010 at 09:16 AM

the web player has other small diferences. the input code and some others are removed from the engine of web player and it uses javascript on the web to detect them.

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

No one has followed this question yet.

Related Questions

Stuttering web player 1 Answer

Standalone builds run very fast on some computers? 3 Answers

Play 2 Stand Alone Players At Same Time 1 Answer

Can compile and run in Standalone, but can't run in Web Player 0 Answers

Does a large number of components will affect performance ? 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