diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-11-25 18:00:44 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-11-25 18:01:30 +0300 |
commit | f67f895770c546243d6976228fbf4a500c19185f (patch) | |
tree | e652a65d627cb692e91df731683c994676e2d5a6 | |
parent | 436fd5663e64979d59cacc12323053f860ce39b0 (diff) |
GPencil: Disable vertex color when use holdout
If the material has the holdout enabled, the value of the vertex color must not be used.
-rw-r--r-- | source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl | 10 |
1 files changed, 10 insertions, 0 deletions
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. */ |