GPencil: Disable vertex color when use holdout

If the material has the holdout enabled, the value of the vertex color must not be used.
This commit is contained in:
Antonio Vazquez 2020-11-25 16:00:44 +01:00
parent 436fd5663e
commit f67f895770
1 changed files with 10 additions and 0 deletions

View File

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