Replies: 1 comment
-
@viviuolo 引擎对 OffscreenCanvas 还没做过适配,有兴趣的话欢迎给我们 Pull Request 支持这个 API ^-^ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
主线程:
const offscreenCanvas = document.createElement('canvas');
const offCanvas = offscreenCanvas.transferControlToOffscreen();
const worker = new Worker('worker.js');
worker.postMessage({
type: 'init',
data: {
offCanvas
}
}, [offCanvas])
worker:
const engine = await WebGLEngine.create({ canvas: offCanvas });
......
// texture为base64图片
engine.resourceManager
.load({
url: texture,
type: AssetType.Texture2D
}) .then((resource) => {});
错误信息:
Beta Was this translation helpful? Give feedback.
All reactions