Open cutepet opened 1 month ago
[BUG]: LitMaterial.baseMap设置BitmapTextureCube错误:doesn't match the layout's binding dimension
创建一个几何体,设置LitMaterial材质,想要独立设置六个面的纹理
本地运行出错的Orillusion引擎版本, e.g. 0.8.2
const obj = new Object3D(); let mr = obj.addComponent(MeshRenderer); mr.geometry = new BoxGeometry(3, 4.37, 0.02); let material = new LitMaterial(); let evnMap = new BitmapTextureCube() let urls: string[] = [] urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_nx.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_px.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_py.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_ny.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_nz.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_pz.png') await evnMap.load(urls) material.baseMap = evnMap; mr.material = material
1
目前LitMaterial还不支持独立设置的这种特性,需要自定义shader来实现~
实现自定义shader的方法能给一下吗
可以先参考下 文档的“高级功能”部分:https://www.orillusion.com/guide/advanced/shader/shader_intro.html
Bug描述
[BUG]: LitMaterial.baseMap设置BitmapTextureCube错误:doesn't match the layout's binding dimension
期待的结果
创建一个几何体,设置LitMaterial材质,想要独立设置六个面的纹理
测试引擎版本:
本地运行出错的Orillusion引擎版本, e.g. 0.8.2
代码示例
const obj = new Object3D(); let mr = obj.addComponent(MeshRenderer); mr.geometry = new BoxGeometry(3, 4.37, 0.02); let material = new LitMaterial(); let evnMap = new BitmapTextureCube() let urls: string[] = [] urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_nx.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_px.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_py.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_ny.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_nz.png') urls.push('https://cdn.orillusion.com/textures/cubemap/skybox_pz.png') await evnMap.load(urls) material.baseMap = evnMap; mr.material = material