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

Fix color greyscale colormap not being even #3391

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/re_renderer/shader/colormap.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const COLORMAP_VIRIDIS: u32 = 6u;
fn colormap_srgb(which: u32, t_unsaturated: f32) -> Vec3 {
let t = saturate(t_unsaturated);
if which == COLORMAP_GRAYSCALE {
return srgb_from_linear(Vec3(t));
// A linear gray gradient in sRGB gamma space is supposed to be perceptually even as-is!
// Easy to get confused: A linear gradient in sRGB linear space is *not* perceptually even.
return Vec3(t);
} else if which == COLORMAP_INFERNO {
return colormap_inferno_srgb(t);
} else if which == COLORMAP_MAGMA {
Expand Down