Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: LitMaterial.baseMap设置BitmapTextureCube错误:doesn't match the layout's binding dimension #425

Open
cutepet opened this issue Jul 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@cutepet
Copy link

cutepet commented Jul 22, 2024

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

@cutepet cutepet added the bug Something isn't working label Jul 22, 2024
@cutepet
Copy link
Author

cutepet commented Jul 31, 2024

1

@JingwenBai
Copy link
Collaborator

目前LitMaterial还不支持独立设置的这种特性,需要自定义shader来实现~

@cutepet
Copy link
Author

cutepet commented Aug 19, 2024

实现自定义shader的方法能给一下吗

@orillusion-admin
Copy link
Contributor

可以先参考下 文档的“高级功能”部分:https://www.orillusion.com/guide/advanced/shader/shader_intro.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants