BabylonJS / Spector.js

Explore and Troubleshoot your WebGL scenes with ease.

Home Page:http://spector.babylonjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Browser extension not detecting offscreen canvas passed to webworker?

kevzettler opened this issue · comments

The browser extension doesn't seem to be detecting my a canvas that I have passed to a webworker

const offscreen = canvas.transferControlToOffscreen();
const worker = new Worker();
worker.postMessage(
  {
    type: "main/canvas-init",
    payload: {
      canvas:  offscreen,
      width: window.innerWidth,
      height: window.innerHeight,
      player: fetchLocalStoragePlayerData(),
    }
  },
  [offscreen]
);

Is this supported? Should I manually use the spector.js lib instead?

Yup unfortunately it is not supported and even the lib would not be working due to the way we capture texture.

As this is getting more and more common, I really need to work on it but I won t have time before a month I guess.

Thanks @sebavan Any notes on the work needed? Maybe I or other community could hack on it.

Feel free that would be perfect, I would say at first we would need to detect the offscreen and be able to record the calls to them by simply disabling the texture captures (who relies on canvas2D internally).

This would be a great start :-)

is there any progress of this ticket?

Not at the moment, would would like to give it a try ?