Replies: 3 comments
-
I have what I think is the same issue (at this point in Bevy 0.7.0). However, the Would love to get some understanding around this, and whether it's a feature or a bug. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
For anyone who finds this post, looking for a solution: (it's not a bug)
--> when you pass a color as raw floats to Bevy, Bevy expects you to pre-convert them to linear. Complete example: (put bevy = "0.11" in your Cargo.toml and it should run)
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I recently ran into an issue with my custom shader where it was outputting unexpected colors:
This picture is from this project. The first is a SpriteBundle with a ColorMaterial, the second is a MeshBundle with a custom material and shader copied from the example, the third is a MeshBundle with a shader that uses vertex colors. All three use the same color, but the third renders differently.
I asked about this in discord and was told to convert the color to linear
col.as_rgba_linear()
before I write it to the vertex colors on the mesh. I tried that and it does indeed fix the issue, the third square renders identically to the first two.My question is: Why do I need to convert to linear color for vertex colors? Is this intentional? Is this something that should be obvious?
Beta Was this translation helpful? Give feedback.
All reactions