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-11-05 16:12:02 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-11-05 20:00:27 +0300
commit15eec7f8b985852219e842ef434f80b6cf9ed165 (patch)
tree5d61f8fd422a277730da039f741953a128b0370e /source/blender/gpu
parent4988f5f39ca2819516a487019008fb7e0dc28b28 (diff)
Fix T80842 Grease Pencil: Subtract mode is not working as expected
The blend equation was not set correctly inside the GL Module since the refactor.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/opengl/gl_state.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc
index 3a474da8b8e..5483f889a8a 100644
--- a/source/blender/gpu/opengl/gl_state.cc
+++ b/source/blender/gpu/opengl/gl_state.cc
@@ -437,6 +437,13 @@ void GLStateManager::set_blend(const eGPUBlend value)
}
}
+ if (value == GPU_BLEND_SUBTRACT) {
+ glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
+ }
+ else {
+ glBlendEquation(GL_FUNC_ADD);
+ }
+
/* Always set the blend function. This avoid a rendering error when blending is disabled but
* GPU_BLEND_CUSTOM was used just before and the frame-buffer is using more than 1 color target.
*/