I recently noticed that if you zoom out on a web page that contains three.js content, an error will come up in console after zooming out past about 33% and refreshing the page. To be clear I am referring to browser zoom (i.e. ctrl -). You can try it for yourself on any three.js page like three.js examples
In Chrome:
Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
In Firefox:
Uncaught DOMException: CanvasRenderingContext2D.drawImage: Passed-in canvas is empty
This also makes whatever three.js content is on the screen unusable. Any idea why this occurs? Is this an issue beyond three.js?
On my laptop, zooming out works fine. The browser prevents me from zooming out past 25–30%, but there are no issues visible there. I wonder if the page is eventually trying to resize the WebGL canvas to a resolution that your device (GPU or driver) cannot support?
If this is a problem affecting an application you’re working on, it might be worth trying to clamp the WebGL canvas resolution at some point (e.g. ≤4096px) and just scaling the HTML element beyond that.
If you can reproduce a graphics issue with more than one browser, the root cause is probably a buggy GPU driver.
We have observed multiple GPU driver related issues in the past on Ubuntu (and Linux in general). Sometimes the issues can be fixed by updating the drivers. Sometimes not and the issue should be reported to the driver’s vendor.
Also consider to file a bug at the browser’s bug tracker. At least in the Chromium project, the devs can redirect GPU driver related issue to dedicated contacts at Intel, Qualcomm etc…