Orillusion / orillusion

Orillusion is a pure Web3D rendering engine which is fully developed based on the WebGPU standard.
https://www.orillusion.com
MIT License
4.7k stars 614 forks source link

[BUG]: this.textures[e].bindStateChange is not a function #154

Closed lj981213 closed 1 year ago

lj981213 commented 1 year ago

报错信息 TypeError: this.textures[e].bindStateChange is not a function

代码

let scene3D = new Scene3D()
let skyTexture = Engine3D.res.loadLDRTextureCube('/mg.jpg');
let sky = scene3D.addComponent(SkyRenderer)
sky.map = skyTexture;
scene3D.envMap = skyTexture;

我是想试一下自定义全景图天空,按照官网的代码写的,但是报错了

lslzl3000 commented 1 year ago

loadLDRTextureCube 是一个异步函数,不能直接= 需要配合await 或者在then 回调中使用

let skyTexture = await Engine3D.res.loadLDRTextureCube('/mg.jpg');
lj981213 commented 1 year ago

好的,解决了,感谢!!!!