[Bf-blender-cvs] [f67f895770c] master: GPencil: Disable vertex color when use holdout

Antonio Vazquez noreply at git.blender.org
Wed Nov 25 16:01:35 CET 2020


Commit: f67f895770c546243d6976228fbf4a500c19185f
Author: Antonio Vazquez
Date:   Wed Nov 25 16:00:44 2020 +0100
Branches: master
https://developer.blender.org/rBf67f895770c546243d6976228fbf4a500c19185f

GPencil: Disable vertex color when use holdout

If the material has the holdout enabled, the value of the vertex color must not be used.

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

M	source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl

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

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
index 94b066c12e5..45b2b92a09b 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -526,6 +526,11 @@ void stroke_vertex()
   vec4 stroke_col = MATERIAL(m).stroke_color;
   float mix_tex = MATERIAL(m).stroke_texture_mix;
 
+  /* Special case: We don't use vertex color if material Holdout. */
+  if (GP_FLAG_TEST(GP_FLAG(m), GP_STROKE_HOLDOUT)) {
+    vert_col = vec4(0.0);
+  }
+
   color_output(stroke_col, vert_col, vert_strength * small_line_opacity, mix_tex);
 
   matFlag = GP_FLAG(m) & ~GP_FILL_FLAGS;
@@ -576,6 +581,11 @@ void fill_vertex()
   float fill_opacity = fcol1.a - (fcol_decode.a * 10);
   fcol_decode.a /= 10000.0;
 
+  /* Special case: We don't use vertex color if material Holdout. */
+  if (GP_FLAG_TEST(GP_FLAG(m), GP_FILL_HOLDOUT)) {
+    fcol_decode = vec4(0.0);
+  }
+
   /* Apply opacity. */
   fill_col.a *= fill_opacity;
   /* If factor is > 1 force opacity. */



More information about the Bf-blender-cvs mailing list