fxlr8 Posted March 21, 2020 Share Posted March 21, 2020 Hi there, a big part of my users see a blank screen when they try to open my game webpage because of this error: Quote WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support. When I ask them to visit https://get.webgl.org/ they say that WebGL is supported and works fine. I use Pixi.js version 5.2.1. 95% of this errors occur in the latest Chrome 80 browser on Windows 10 How can WebGL not be supported on computers with decent graphics cards and latest browsers? Has anyone faced the similar issue? Quote Link to comment Share on other sites More sharing options...
fxlr8 Posted March 21, 2020 Author Share Posted March 21, 2020 Found this thread on github about the exact same problem https://github.com/pixijs/pixi.js/issues/5694 Looks like this is a Chrome specific problem. Some people have 'hardware acceleration' option turned off by default. What can we do as a developers? How can I detect that WebGL is disabled so I could show users some info on how to turn it on? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 21, 2020 Share Posted March 21, 2020 Place an instruction near the game somewhere. chrome://gpu and all that stuff. update videodrivers. No magic button there Quote Link to comment Share on other sites More sharing options...
fxlr8 Posted March 21, 2020 Author Share Posted March 21, 2020 Thanks for a fast reply @ivanpopelyshev Here you said that masks usage can cause this error. I am not using masks in my project at all, and the official example with masks works fine. Does the example page use automated canvas fallback? Quote Link to comment Share on other sites More sharing options...
fxlr8 Posted March 21, 2020 Author Share Posted March 21, 2020 I tried switching to pixi.js-legacy, but now I get this error. Quote this.material._renderCanvas is not a function This happens at Mesh.prototype._renderCanvas. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 21, 2020 Share Posted March 21, 2020 > you said that masks usage can cause this erro yep, because pixi passes "stencil:true" in context creation params. If you want it not pass it - hack the Renderer constructor, I dont remember how to do constructor hacking in JS. Here's the line: https://github.com/pixijs/pixi.js/blob/dev/packages/core/src/Renderer.ts#L282 Or you can clone pixijs repo and rebuild it. Probably editing "pixi.js" file and removing that line will help too. We just didnt make an option to switch off that behaviour. If you want you can try make that PR, but dont forget that all MaskSystem has to be guarded somehow, notify users that their mask wont be rendered, or try render it different way (with shader/spritemask). However, there's another trick: PIXI.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = false Track that variable name through pixijs sources if you want to see what it does, im too tired to explain. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 21, 2020 Share Posted March 21, 2020 7 minutes ago, fxlr8 said: I tried switching to pixi.js-legacy, but now I get this error. That's a real bug there, please make a minimal demo and an issue about it. Or tell me what kind of mesh did you use that it failed. We re-shuffled canvas renderer many times in last months, I really dont know which case could fail. Quote Link to comment Share on other sites More sharing options...
fxlr8 Posted March 23, 2020 Author Share Posted March 23, 2020 On 3/22/2020 at 2:51 AM, ivan.popelyshev said: PIXI.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = false Thanks, this helped. The app lags like hell, but at least it does not crash. Is there a way to detect which renderer is used right now? I could offer my users to turn on the hardware acceleration when they use canvas. By the way, I created an issue for that bug here https://github.com/pixijs/pixi.js/issues/6491 Quote Link to comment Share on other sites More sharing options...
fxlr8 Posted March 23, 2020 Author Share Posted March 23, 2020 I was thinking, how could it be, that a gaming PC would have the hardware acceleration turned off by default. Imagine that you have just built a new PC. You need to download GPU drivers. Of course you will download chrome first. When chrome is installed, the GPU has no driver yet, so it will decide to turn off hardware acceleration. And this option is never checked again. Even after the driver is installed. Looks plausible to me Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 23, 2020 Share Posted March 23, 2020 No, that's not how it goes. Chrome has some logic on startup that decides which videocard to use and which backend to use with it. Quote Link to comment Share on other sites More sharing options...
fxlr8 Posted March 25, 2020 Author Share Posted March 25, 2020 (edited) Then why could it possibly be turned off by default on a gaming PC? Edited March 25, 2020 by fxlr8 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 25, 2020 Share Posted March 25, 2020 (edited) It shouldn't be Consider that: you can get me more info and pester me with questions however you want, but real stuff is to make proper report to chromium bugtracker. Give them all parameters of devices, and params for context creation that pixi uses (from pixi sources or from SpectorJS capture frame feature). Maybe there's an issue already: https://bugs.chromium.org/p/chromium/issues/list?q=webgl&can=2 . ITs those guys job! However, those guys wont play with you like I do, they'll just close your ticket if you dont give them whole information. One of my stupid ideas is that Chromium actually renders with integrated video and not discrete one , and how to change that - well, nvidia control panel allows to change but chromium sometimes does it own stuff, you need extra launch param for it. Edited March 25, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 27, 2020 Share Posted March 27, 2020 Look at answer here: https://superuser.com/questions/645918/how-to-run-google-chrome-with-nvidia-card-optimus I dont know what is it about, but apparantly certain configurations were banned in chromium in firefox? I dont know . Did you look through chromium issues? I need that info yoo, you know! Quote Link to comment Share on other sites More sharing options...
kerbrose Posted January 13, 2021 Share Posted January 13, 2021 well, this happend to me when using firefox even though my project was working fine. I guess this is because there was an update https://stackoverflow.com/a/65707422/7045119 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.