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
path: root/source
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-11-27 00:19:46 +0300
committerAntonioya <blendergit@gmail.com>2018-11-27 00:20:06 +0300
commit26df95cff6620f17d6631c83efe05177b7a90e87 (patch)
treece5a68a9755ebf626e0bba2feb4f18aed52afb8e /source
parentfb262f942e44f86931f3519383da9ad350733afb (diff)
GP: Make Multiply blend works with opacity
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_blend_frag.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_blend_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_blend_frag.glsl
index 2ba02beecdb..8eeb0b8bc7f 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_blend_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_blend_frag.glsl
@@ -58,7 +58,8 @@ vec4 get_blend_color(int mode, vec4 src_color, vec4 blend_color)
outcolor.a = clamp(src_color.a - (mix_color.a * blend_opacity), 0.0, 1.0);
}
else if (mode == MODE_MULTIPLY) {
- mix_color.rgb = mix_color.rgb * mix_color.a * blend_opacity;
+ /* interpolate between 1 and color using opacity */
+ mix_color.rgb = mix(vec3(1,1,1), mix_color.rgb * mix_color.a, blend_opacity);
outcolor = src_color * mix_color;
outcolor.a = src_color.a;
}