We are busy developing a new game for both mobile and desktop (webgl). We are almost finished with but we have some questions and issues.
We have a big issue with the performance of our WEBGL build in Google Chrome. In Chrome our game gets a horrible 15 FPS. However, this is not the case on every PC. We have tested it on OS X, Windows 10 and Windows 8 on 7 different pcs. On 2 of those PC’s we reach a 15 FPS on Chrome, while on Firefox those PC’s and other PC’s reach a steady FPS of 40~60.
Also we optimized our game in the best way as we can (we have stable 60 fps on other browsers/pcs and editor).
We have used the following technologies:
ugui
websockets
3d renderers
3d physic
3d light
Unity version is 5.4.1p2
We have no idea what we should do to fix those FPS problems. I hope somebody can help us out with this. We have the following questions:
Does somebody have a Unity game with a stable FPS of atleast 30+ on both Chrome and Firefox and tested on different PC’s (high performance but also average PC’s)? Are you able to share an url where we can test it? This proofs us that it should be possible to fix…
Is this FPS issue caused by Unity or is this a known issue of Chrome? Because on Firefox it works fabulous.
Chrome implemented webgl 2.0 on releaseversion 56, and it is stable already. It will help if we shift to webgl 2.0? Could we expect improving performance soon or in some estimated time frame?
Does anybody have a tip to fix those performance issues especially on Chrome?
Is there anything else that we can do in order to tackle the issue? Do you need something from us in order to find the issue? Some best practices maybe?
I created some screenshots of the profiler which can be found here:
I suspect it’s the lack of asm.js on chrome that is hurting you (webassembly will “fix” this). Obviously it’s hard to say for sure from just a forum post. In situations where we are heavily cpu bound (skinned mesh rendering), chrome can be half the frame rate for us. Unfortunately outside of waiting, not much you can do other than try to reduce the load on the cpu.
From the profiler, it looks like you have a lot of allocations going on. You’ll want the GC allocations to be as close to 0 as possible. Be sure to profile the actual build, not in editor.
Also, whatever is happening to that scrollrect is taking up quite a bit of time.
As you can see here, Unity WebGL performance varies depending on the browser. Are both Chrome and Firefox 64 bit?
We haven’t measured performance of webgl1.0 vs. webgl2.0 but I would not expect much difference. Having said that, WebGL2.0 specs include new garbage free entry-points so basically there will be less CPU usage spikes due to the browser vm garbage collection. This will be available at some point after Unity 5.6.
Another feature that will improve performance if you are CPU-bound, is GPU instancing which should be in 5.6 by the time it ships.
Is this recent? I’ve only seen the “Successfully compiled asm.js code” message in the browser console for Edge and Firefox. Obviously every browser “supports” asm.js as it’s just javascript, but I was under the impression that Chrome doesn’t enable any extra optimizations for asm.js like Edge and Firefox do.
I will say I noticed in the console for a few Chrome revisions (I’m on the dev 64-bit branch) it would try to compile asm.js but seemed to always fail. At the moment, Chrome (58.0.3013.3) no longer appears to even try.
Is GPU instancing fully available in 5.6.0f3 for WebGL? SystemInfo.supportsInstancing says yes, but when I use the Profiler the Rendering Window doesn’t include (Instancing) details (whereas it does when the platform is switched to Android).
Is this just an oversight in the Profiler or does instancing not work the same way in WebGL?
I have the same problem. Also only on a few computers - and only in Chrome.
Some users have older PC’s and a good framerate, and users with a modern PC just 2-10 frames. ONLY in Chrome. It also works on Mobile without problems.
I have no Idea where the problem could be.
There are no Antivir programs and no browser addons installed.
Scroll down to Show Advanced settings at the bottom of the page
Scroll to the System section. Ensure the Use hardware acceleration when available checkbox is checked (You’ll need to relaunch Chrome for any changes to take effect)
My low budget laptop has AMD E2 7110 APU (4 cores, max 1.8Ghz) with integrated GPU, 8GB RAM