Pixi should support OffscreenCanvas Web Worker environments and other "headless" environments.
See original GitHub issueI’m trying to use Pixi.js in a webworker with the OffscreenCanvas reference API It fails at runtime with a window undefined error
.
I am aware of the other Github issues that explain how Pixi does not want to support Node.js (etc) environments because the Pixi team feels Pixi is a browser only tool and don’t want to write isomorphic code but, WebWorker is a browser enviroment. I even tried to use the recommended pixi-shim
and it failed expecting a window
object as well (lol):
OffscreenCanvas
Web worker environments are a “browser environment” so what are Pixis plan to support this enviroment?
Other WebGL rendering libraries like Regl support this pattern by accepting a reference to a WebGL context passed directly to the initialization code. I am making assumptions here but feels like PIXI could follow that pattern?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:22 (8 by maintainers)
Top GitHub Comments
hey @arbaaz yes progress is still being made, just slower than I would have liked.
I currently have pixi working inside a webworker using
OffscreenCanvas
. Here’s a little demo http://worker.goodboydigital.com/test/I’ll be testing node support soon
Please don’t go stale. I’m desperate to check out how you’ve done this.