mirror of https://github.com/yshui/picom.git
glx: calculate residual in both directions
We only considered residual in the positive direction, i.e. we would set dithering to zero if the color is (whole number + 0.0001). But we should also set dithering to zero if color is (whole number - 0.0001). Fixes #1064
This commit is contained in:
parent
05ef18d78f
commit
3aed5599c3
|
@ -202,7 +202,8 @@ const char dither_glsl[] = GLSL(330,
|
|||
}
|
||||
vec4 dither(vec4 c, vec2 coord) {
|
||||
vec4 residual = mod(c, 1.0 / 255.0);
|
||||
vec4 dithered = vec4(greaterThan(residual, vec4(1e-4)));
|
||||
residual = min(residual, vec4(1.0 / 255.0) - residual);
|
||||
vec4 dithered = vec4(greaterThan(residual, vec4(1.0 / 65535.0)));
|
||||
return vec4(c + dithered * bayer(coord) / 255.0);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue