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-02-11 19:18:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-02-11 19:18:26 +0300
commit6b24232474574fcceae243017c03f0842c652dce (patch)
tree1891e1a6ceaae0b164c3455d3f8ea7f1eca0fe78
parentd8c99ac34e62fd7606efdc1fafeba512a704ad0e (diff)
GPencil: Refactor: Fix blend modes broken
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c3
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_layer_blend_frag.glsl3
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 17a0ca25892..5c69a956d75 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -880,7 +880,8 @@ static void gpencil_draw_mask(GPENCIL_Data *vedata, GPENCIL_tObject *ob, GPENCIL
DRW_draw_pass(mask_layer->geom_ps);
}
- if (inverted) {
+ if (!inverted) {
+ /* Blend shader expect an opacity mask not a reavealage buffer. */
DRW_draw_pass(psl->mask_invert_ps);
}
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_layer_blend_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_layer_blend_frag.glsl
index 019e55ec0cd..6fbc7f47dac 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_layer_blend_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_layer_blend_frag.glsl
@@ -2,7 +2,6 @@
uniform sampler2D colorBuf;
uniform sampler2D revealBuf;
uniform sampler2D maskBuf;
-uniform bool maskInvert;
uniform int blendMode;
uniform float blendOpacity;
@@ -22,7 +21,7 @@ void main()
/* Stroke only render mono-chromatic revealage. We convert to alpha. */
color.a = 1.0 - textureLod(revealBuf, uvcoordsvar.xy, 0).r;
- float mask = 1.0 - textureLod(maskBuf, uvcoordsvar.xy, 0).r;
+ float mask = textureLod(maskBuf, uvcoordsvar.xy, 0).r;
mask *= blendOpacity;
fragColor = vec4(1.0, 0.0, 1.0, 1.0);