diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-03-30 02:23:00 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-03-30 18:57:31 +0300 |
commit | af1e3b027083041bb6555fba2e910ebefecbb5a0 (patch) | |
tree | 397eadff4cb82e9e632f1c709005688fa9300d49 /source/blender/draw | |
parent | 9371c051b155da2c688b499dfb181a337afcf738 (diff) |
GPencil: Fix overlay blend mode creating inverted colors
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl | 2 |
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: |