diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-08-22 17:38:42 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-08-22 20:49:32 +0300 |
commit | 477b4559ece0d12ec0bab88d317b9fe2e1832417 (patch) | |
tree | 0116d849a0a662845375383fabccffe2a624972d /source/blender/gpu | |
parent | 07d0f2eb01554ca6695310ca1bcbc7d129ab30a0 (diff) |
Paint Overlay: Fix blending of the brush overlay
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_image_alpha_color_frag.glsl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_image_alpha_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_alpha_color_frag.glsl index 727c3c0a832..fc0c8609069 100644 --- a/source/blender/gpu/shaders/gpu_shader_image_alpha_color_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_image_alpha_color_frag.glsl @@ -7,5 +7,8 @@ uniform sampler2D image; void main() { - fragColor = texture(image, texCoord_interp).r * color; + fragColor = texture(image, texCoord_interp).r * color.rgba; + /* Premul by alpha (not texture alpha) + * Use blending function GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); */ + fragColor.rgb *= color.a; } |