What happens when WebGL context is lost?
See original GitHub issue-
pixi.js
version: _e.g.5.2.1 -
Browser & Version: Firefox 74.0
-
OS & Version: OpenSuSE 43.1
This is a question again: when I see “Error: WebGL context was lost.”, does this mean that pixi falls back to canvas drawing? I see this when I try to load my code in Firefox and the result is very slow and laggy - the animation stutters. When opening the same script in chromium, I don’t see the error message and the animation is very smooth.
Perhaps chrome is just a lot faster? What’s a good way to debug this?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:13 (1 by maintainers)
Top Results From Across the Web
WebGLRenderingContext.isContextLost() - Web APIs | MDN
The WebGLRenderingContext.isContextLost() method returns a boolean value indicating whether or not the WebGL context has been lost and must ...
Read more >HandlingContextLost - WebGL Public Wiki
You can lose the context AT ANY TIME ! In otherwords, you can lose the context part way through initialization. You can also...
Read more >WebGL scene does't render because of lost context
Either you have a huge memory leak in your application or your machine does not have enough power to run your texturized model...
Read more >WebGL context lost and Memory Issue Critical Bug - SciChart
WebGL context lost and Memory Issue Critical Bug · The WebGL Context Loss error occurs when the Browser denies a WebGL context ·...
Read more >Webgl context lost - Help & Support - PlayCanvas Forum
What I think is happening: your GPU / graphics driver crashes when rendering that cube for some reason. That takes down whole Webgl...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ha, Stalebot, we meet again. This issue still happens for us, Firefox is losing context without much debug info nor directions on how to fix this issue. Happy to contribute to this, we have a strong interest in fixing this bug
Hi, similar issues under Firefox 75 (also Firefox dev 76 beta 4). I also have this, after refreshing the page a couple of times :
Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. isWebGLSupported.js:31:32
WebGL context was lost. isWebGLSupported.js:31:32
I also have serious performance issues. For example, the demo shown on PixiJS official website (https://www.pixijs.com/) is very slow and choppy and I have a lot of CPU usage as well. On Chromium, it runs smoothly and does not show any sign of lost context in console. Other js WebGL libraries, are slow as well, it’s a browser related issue.
When testing 3D WebGL examples, both browsers show slowdowns…
I’ve read that Firefox and Chromium works best with Wayland. Their implementation of WebGL 2 for X11 is still a work in progress, while Chromium has the best support today (but still far from being perfect, especially in 3D). Apparently, WebGL 1 is better supported for X11 but as far as I’ve tested, it’s the same for me. I personally use X11 (xorg), and I think that’s why I have such poor performance.
The Firefox development team is currently working on it, but they started a month ago, so we will need to wait a bit before starting to see an improvement. https://bugzilla.mozilla.org/show_bug.cgi?id=1010527 https://bugzilla.mozilla.org/show_bug.cgi?id=1580166
That’s also explains why Windows users don’t experience this issue, as Firefox uses DXGL to render on this platform.
MacOS users probably have performance issues as well.
EDIT : The issue has been solved. The current Firefox Nightly build (77.0a1) shows more than 50 FPS on the Pixi.JS website (performance log) and the 3D WebGL aquarium runs at 60 FPS with 1000 fishes (https://webglsamples.org/aquarium/aquarium.html). But, the contexts are still lost and shows the same lost context issues after refreshing the page a couple of times, indicating that this time, it’s pixi.js’ fault. (see the top of my comment)