Webgl performance in google chrome

Hello!

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.

We tried to enablked/disable WEBGL 2.0 at chrome://flags but that didn’t worked. Also, we checked of any of our hardware is on the Blacklists (BlacklistsAndWhitelists - WebGL Public Wiki and https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers). This is not the case.

We implemented also the following points: Blogs recent news | Game Developer. But still we don’t tackle the problem.

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:

  1. 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…
  2. Is this FPS issue caused by Unity or is this a known issue of Chrome? Because on Firefox it works fabulous.
  3. 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?
  4. Does anybody have a tip to fix those performance issues especially on Chrome?
  5. 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:

Thank you very much for your time!

Greg

P.S. our profiler screenshots:

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.

1 Like

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.

Chrome does support asm.js

Here are two:

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.

Nothing is impossible ^^ Hard but not impossible check out : http://www.war-attack.com

But yeah dead trigger 2 is the perfect exemple

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.

Thank you for all information so far, really useful. We’re doing some tests currently and will let you know if it works or not.

The main difference is that Chrome does not compile asm.js Ahead-Of-Time.

Marco,

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?

Sorry, looks like it requires WebGL 2.0 graphics emulation for instancing to be enabled. Is that correct?

1 Like

It does require WebGL2.0. I’ll add a note to the docs. thanks.

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.

I used the latest unity version (2020.1.5)

I would recommend capturing hardware profiles of the affected devices. Maybe it is a Chrome bug that only surfaces on certain device configurations?

I had same issue,
this solution helped to me

  1. chrome://settings
  2. Scroll down to
    Show Advanced settings at the bottom of the page
  3. 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

4 Likes