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

Colors rendered differently compared to bevy default renderer #51

Open
rsk700 opened this issue Oct 7, 2021 · 0 comments
Open

Colors rendered differently compared to bevy default renderer #51

rsk700 opened this issue Oct 7, 2021 · 0 comments

Comments

@rsk700
Copy link

rsk700 commented Oct 7, 2021

I've tried to render simple mesh with vertex colors:

mesh.set_attribute(Mesh::ATTRIBUTE_COLOR, vec![[0.7, 0.2, 0.2]; buffers.vertices.len()]);

and looks like webgl2 in this case interprets color as sRGB, and bevy as linearRGB
using same code in both (left is web):
same

but if in native version I convert color from sRGB to linear first, then result color will be the same

let color = Color::rgb(0.7, 0.2, 0.2).as_linear_rgba_f32();
mesh.set_attribute(
    Mesh::ATTRIBUTE_COLOR,
    vec![[color[0], color[1], color[2]]; buffers.vertices.len()],
);

to_linear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant