Exact meaning of WebGL 2.0 error

Hi all,
What does this error mean exactly?

"Warning: unsupported graphics API WebGL 2.0".

Does this mean WebGL is not available as such, or is only WebGL 2.0 not available?
We have “Auto Graphics API” enabled in the Player Settings.

This seems to happen with a significant amount of Chrome users (>15%). They all have the most recent version of Chrome. I’m not able to reproduce it myself unfortunately.

When it happens, all canvas elements are visible (like loading screen, text, HUD, …), but next to that everything is black: there’s no ‘game view’ whatsoever. Sounds do work.

Is it because of a graphics setting we used? Is it because of the GPU of the users? Where to start debugging this?

Thanks a lot in advance!

The error message and your actual error are unrelated (but perhaps correlated). That warning just means you selected Auto Graphics API and it attempted to initialize a WebGL 2.0 context, but couldn’t and fell back to WebGL 1.0. You’ll see this message 100% of the time in Safari. I agree the error message is poorly worded. If this is happening in Chrome it means those users are using a really old graphics card that can’t support WebGL 2.0 (which is why I say perhaps correlated).

Your actual error is what happens when the webgl context dies for [various reasons]. For us that happens mostly on mobile when the underlining graphics driver crashes/fails (often from too much memory for us). When that happens WebAssembly is still “active” and you’ll have things like audio continue to play.

We had this problem as well in the past, but differently from kognito1 experience, the devices running were really good (and modern) Notebooks with updated Chrome, updated IntelHD graphics drivers and everything. For some reason some of them were just rendering everything black.
Using AutoGraphics API didn’t appear to work, so we just forced to used WebGL1.0 instead.

When a project built with Auto Graphics API needs to fall back to WebGL 1.0 when WebGL 2.0 is not available, the fallback should still work quite well - there are limitations to WebGL 1.0 compared to WebGL 2.0, but all basic rendering features should work. If there are other error messages in the console coming from WebGL or Unity, that might help pin down that the rendering issue might be. Otherwise if there are no errors reported, it may be worth to try to reduce the issue down to the smallest test case that reproduces the black rendering. (It could be a Chrome bug, or an Unity bug, or a limitation of WebGL 1.0, but unable to know for sure without looking in detail)

@jukka_j @kognito1 we managed to get some additional insights from a user who experiences the bug.
First of all, this is what his console.log says:

And here’s some information regarding his WebGL support. Got this info via WebGL Browser Report - WebGL Fingerprinting - BrowserLeaks.

We also asked him to try a build made with Unity 5. Same black screen bug.
We also asked him to try other WebGL stuff, not Unity based: no black screen bug.

This bug is getting reported a lot lately, much more than it used to… maybe it stopped working after a Chrome update or something? Just thinking out loud.

Any tips?

Either a driver bug or a bug in Chrome’s Angle implementation. My bet is a driver bug. Ask him to update drivers (although probably not possible since he seems to be using a quite old GPU). It couldn’t hurt to file a bug report with Google though and perhaps they can introduce some workaround for that device.

OK, but still, I believe this bug is now much more present than it was. We used to have like 1% of our users reporting it, now it’s >15%. Not sure what changed, but if they try older builds from when it was 1%, it doesn’t work either… So I think something has changed, Chrome, Windows, Unity, … I don’t know.

Maybe the driver was updated with Windows update or maybe a change in Angle exposed this bug, but the error is occurring when the browser is trying to translate WebGL → DirectX 9 (WebGL 1.0 on Angle uses DirectX 9). There’s not much Unity can do about it. All they can do is ensure that they confirm to the WebGL standard.

But like I said if you’re seeing a large increase of bug reports from this you should report it to Google. Perhaps they can devise a workaround for this situation.