From 3eee011742a208f6f3d07353c67fb0f3059c6851 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Thu, 21 Sep 2023 11:35:34 +0200 Subject: [PATCH] Fix color greyscale colormap not being even --- crates/re_renderer/shader/colormap.wgsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/re_renderer/shader/colormap.wgsl b/crates/re_renderer/shader/colormap.wgsl index 13d1ef58fba9..0a5c4e0b29a3 100644 --- a/crates/re_renderer/shader/colormap.wgsl +++ b/crates/re_renderer/shader/colormap.wgsl @@ -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 {