GPencil: Fix overlay blend mode creating inverted colors

This commit is contained in:
2020-03-30 01:23:00 +02:00
parent 9371c051b1
commit af1e3b0270

View File

@@ -120,11 +120,13 @@ void blend_mode_output(
color = mix(vec4(0.5), color, color.a * opacity);
vec4 s = step(-0.5, -color);
frag_revealage = frag_color = 2.0 * s + 2.0 * color * (1.0 - s * 2.0);
frag_revealage = max(vec4(0.0), frag_revealage);
break;
case MODE_OVERLAY_SECOND_PASS:
/* Reminder: Blending func is additive blend (dst.rgba + src.rgba).*/
color = mix(vec4(0.5), color, color.a * opacity);
frag_revealage = frag_color = (-1.0 + 2.0 * color) * step(-0.5, -color);
frag_revealage = max(vec4(0.0), frag_revealage);
break;
case MODE_SUB:
case MODE_ADD: