-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add UV channel selection to StandardMaterial #13200
Conversation
Added the same support for clearcoat textures and using shader defs instead of material flags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. clean code and provides a good base to extend to more UVs in future.
we could potentially select which texcoords to put into our uv attributes based on usage rather than just taking 0/1, but if we do extend to more uvs that would be unnecessary anyway, and it's a clear improvement as is.
just a quick note about the shader defs - we could alternatively use indexes/bits in the material data to specify the uv indexes and avoid a proliferation of shader variants. i think defs are probably better because
whereas using data in the material would increase its size having a (marginal) effect on all uses of |
Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1313 if you'd like to help out. |
Objective
Solution
Testing
This fixes #12496 for example:
For testing of all kind of textures I used the TextureTransformMultiTest from https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/TextureTransformMultiTest
Its purpose is to test multiple texture transfroms but it is also a good test for different texcoords.
It also shows the issue with emission #13133.
Before:
After: