-
-
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
[Merged by Bors] - remove mandatory mesh attributes #6127
Conversation
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.
LGTM.
It would be nice to have warnings when a material is used with a mesh that is missing the required attributes.
Perhaps the Material
trait could be extended to optionally specify these, in a future PR.
Yeah, that could work, I like the idea |
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.
I like these changes a lot: users would regularly stumble on this. Can you add a test to verify that this continues to work?
Code looks good, so once we have automated testing I'm comfortable merging this (yay for slowly learning rendering).
@alice-i-cecile I tried writing a test, but it requires pretty much an entire I think rendering in general would need a bit more testing infrastructure before we can easily test things like this. |
Alright, that makes sense. bors r+ |
# Objective - It's possible to create a mesh without positions or normals, but currently bevy forces these attributes to be present on any mesh. ## Solution - Don't assume these attributes are present and add a shader defs for each attributes - I updated 2d and 3d meshes to use the same logic. --- ## Changelog - Meshes don't require any attributes # Notes I didn't update the pbr.wgsl shader because I'm not sure how to handle it. It doesn't really make sense to use it without positions or normals.
Pull request successfully merged into main. Build succeeded: |
# Objective - It's possible to create a mesh without positions or normals, but currently bevy forces these attributes to be present on any mesh. ## Solution - Don't assume these attributes are present and add a shader defs for each attributes - I updated 2d and 3d meshes to use the same logic. --- ## Changelog - Meshes don't require any attributes # Notes I didn't update the pbr.wgsl shader because I'm not sure how to handle it. It doesn't really make sense to use it without positions or normals.
# Objective - It's possible to create a mesh without positions or normals, but currently bevy forces these attributes to be present on any mesh. ## Solution - Don't assume these attributes are present and add a shader defs for each attributes - I updated 2d and 3d meshes to use the same logic. --- ## Changelog - Meshes don't require any attributes # Notes I didn't update the pbr.wgsl shader because I'm not sure how to handle it. It doesn't really make sense to use it without positions or normals.
# Objective - It's possible to create a mesh without positions or normals, but currently bevy forces these attributes to be present on any mesh. ## Solution - Don't assume these attributes are present and add a shader defs for each attributes - I updated 2d and 3d meshes to use the same logic. --- ## Changelog - Meshes don't require any attributes # Notes I didn't update the pbr.wgsl shader because I'm not sure how to handle it. It doesn't really make sense to use it without positions or normals.
# Objective - It's possible to create a mesh without positions or normals, but currently bevy forces these attributes to be present on any mesh. ## Solution - Don't assume these attributes are present and add a shader defs for each attributes - I updated 2d and 3d meshes to use the same logic. --- ## Changelog - Meshes don't require any attributes # Notes I didn't update the pbr.wgsl shader because I'm not sure how to handle it. It doesn't really make sense to use it without positions or normals.
Objective
Solution
Changelog
Notes
I didn't update the pbr.wgsl shader because I'm not sure how to handle it. It doesn't really make sense to use it without positions or normals.