-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Vertex Colors without a texture in 2D ColorMaterial #5679
Labels
Comments
This seems like a bug to me. Your proposed fix would seem to bring this in line with what we do in the PBR shader. I'd say fire away on the PR. |
I agree. This looks like a bug. It doesn't make sense that vertex colours require a texture. Please make a PR. |
maccesch
pushed a commit
to Synphonyte/bevy
that referenced
this issue
Sep 28, 2022
) # Objective This PR changes it possible to use vertex colors without a texture using the bevy_sprite ColorMaterial. Fixes bevyengine#5679 ## Solution - Made multiplication of the output color independent of the COLOR_MATERIAL_FLAGS_TEXTURE_BIT bit - Extended mesh2d_vertex_color_texture example to show off both vertex colors and tinting Not sure if extending the existing example was the right call but it seems to be reasonable to me. I couldn't find any tests for the shaders and I think adding shader testing would be beyond the scope of this PR. So no tests in this PR. 😬 Co-authored-by: Jonas Wagner <jonas@29a.ch>
james7132
pushed a commit
to james7132/bevy
that referenced
this issue
Oct 28, 2022
) # Objective This PR changes it possible to use vertex colors without a texture using the bevy_sprite ColorMaterial. Fixes bevyengine#5679 ## Solution - Made multiplication of the output color independent of the COLOR_MATERIAL_FLAGS_TEXTURE_BIT bit - Extended mesh2d_vertex_color_texture example to show off both vertex colors and tinting Not sure if extending the existing example was the right call but it seems to be reasonable to me. I couldn't find any tests for the shaders and I think adding shader testing would be beyond the scope of this PR. So no tests in this PR. 😬 Co-authored-by: Jonas Wagner <jonas@29a.ch>
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
) # Objective This PR changes it possible to use vertex colors without a texture using the bevy_sprite ColorMaterial. Fixes bevyengine#5679 ## Solution - Made multiplication of the output color independent of the COLOR_MATERIAL_FLAGS_TEXTURE_BIT bit - Extended mesh2d_vertex_color_texture example to show off both vertex colors and tinting Not sure if extending the existing example was the right call but it seems to be reasonable to me. I couldn't find any tests for the shaders and I think adding shader testing would be beyond the scope of this PR. So no tests in this PR. 😬 Co-authored-by: Jonas Wagner <jonas@29a.ch>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
What problem does this solve or what need does it fill?
It seems that it is currently impossible to use vertex colors (Mesh::ATTRIBUTE_COLOR) without a texture in the 2D Color Material.
I currently have two use cases for this, one is drawing flat colored meshes, the other is in my debug renderer.
What solution would you like?
I would like vertex colors to have an effect even if no texture is applied to the ColorMaterial.
I'm new to bevy and WGSL but at least from a quick test it looks like this can be achieved by a simple change to the fragment shader:
What alternative(s) have you considered?
The alternative is to use a white texture to make vertex colors work. :))
Additional context
I couldn't come up with a good reason why it shouldn't be possible to use vertex colors without a texture but I might be missing something.
Happy to create a PR if this is considered desirable behavior in bevy.
The text was updated successfully, but these errors were encountered: