[Bf-blender-cvs] [af1e3b02708] master: GPencil: Fix overlay blend mode creating inverted colors

Clément Foucault noreply at git.blender.org
Mon Mar 30 17:57:53 CEST 2020


Commit: af1e3b027083041bb6555fba2e910ebefecbb5a0
Author: Clément Foucault
Date:   Mon Mar 30 01:23:00 2020 +0200
Branches: master
https://developer.blender.org/rBaf1e3b027083041bb6555fba2e910ebefecbb5a0

GPencil: Fix overlay blend mode creating inverted colors

===================================================================

M	source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl

===================================================================

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:



More information about the Bf-blender-cvs mailing list