[Bf-blender-cvs] [15eec7f8b98] blender-v2.91-release: Fix T80842 Grease Pencil: Subtract mode is not working as expected

Clément Foucault noreply at git.blender.org
Thu Nov 5 18:00:37 CET 2020


Commit: 15eec7f8b985852219e842ef434f80b6cf9ed165
Author: Clément Foucault
Date:   Thu Nov 5 14:12:02 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rB15eec7f8b985852219e842ef434f80b6cf9ed165

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.

===================================================================

M	source/blender/gpu/opengl/gl_state.cc

===================================================================

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.
    */



More information about the Bf-blender-cvs mailing list