Stats of an Offscreen Canvas

Just to make sure with the experts:
There can’t be any obscure workaround to use the stats panel with an offscreen canvas, right?

If you mean used directly - nope, because it depends on DOM, which is not accessible within a worker.

If you mean just measuring the performance of rendering for offscreen canvas - can, performance.now() before and after .render() should still be working just fine in the thread. You can send the resulting measurements to the main thread and then put it in a DOM element.

2 Likes

@mjurczyk Thanks for the quick reply. :bouquet:

There is also the renderer.info structure that can give you some additional information about rendering, like triangle counts, geometry counts, etc.

https://threejs.org/docs/#api/en/renderers/WebGLRenderer.info

1 Like