Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-03-30 02:23:00 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-03-30 18:57:31 +0300
commitaf1e3b027083041bb6555fba2e910ebefecbb5a0 (patch)
tree397eadff4cb82e9e632f1c709005688fa9300d49 /source/blender/draw/engines
parent9371c051b155da2c688b499dfb181a337afcf738 (diff)
GPencil: Fix overlay blend mode creating inverted colors
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
index cb34515a960..872f25be72b 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -120,11 +120,13 @@ void blend_mode_output(
color = mix(vec4(0.5), color, color.a * opacity);
vec4 s = step(-0.5, -color);
frag_revealage = frag_color = 2.0 * s + 2.0 * color * (1.0 - s * 2.0);
+ frag_revealage = max(vec4(0.0), frag_revealage);
break;
case MODE_OVERLAY_SECOND_PASS:
/* Reminder: Blending func is additive blend (dst.rgba + src.rgba).*/
color = mix(vec4(0.5), color, color.a * opacity);
frag_revealage = frag_color = (-1.0 + 2.0 * color) * step(-0.5, -color);
+ frag_revealage = max(vec4(0.0), frag_revealage);
break;
case MODE_SUB:
case MODE_ADD: