Commit 46ab5528 authored by Niklas Haas's avatar Niklas Haas
Browse files

shaders/colorspace: make gamut warning less broken

The current logic either just saturates the pixel or else does whatever.
I realized there's no really sane way to "invert" an out-of-gamut color,
and even if we did invert it in a reasonable manner, it's still less
visible than just making it pink.

Context provides better clues for what's out of gamut, anyways.
parent 68c2e806
Pipeline #81918 passed with stages
in 7 minutes and 47 seconds
......@@ -247,7 +247,7 @@ struct pl_color_map_params {
float max_boost;
// If true, enables the gamut warning feature. This will visibly highlight
// all out-of-gamut colors (by inverting them), if they would have been
// all out-of-gamut colors (by coloring them pink), if they would have been
// clipped as a result of gamut or tone mapping.
bool gamut_warning;
......
......@@ -1158,8 +1158,8 @@ void pl_shader_color_map(struct pl_shader *sh,
if (params->gamut_warning && need_gamut_warn) {
GLSL("if (any(greaterThan(color.rgb, vec3(%f + 0.005))) ||\n"
" any(lessThan(color.rgb, vec3(-0.005))))\n"
" color.rgb = vec3(%f) - color.rgb; // invert\n",
dst.sig_peak * dst.sig_scale, src.sig_peak * src.sig_scale);
" color.rgb = vec3(1.0, 0.0, 1.0); // magenta\n",
dst.sig_peak * dst.sig_scale);
}
if (need_linear)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment