Fix: VSE colormix blend factor not working

Blend factor was used to adjust alpha of background image, which is not
correct. This was done in fdee84fd56 where another change was, that
background alpha is copied into result, which is correct.

Apply blend factor to foreground image alpha channel.
This commit is contained in:
Richard Antalik 2021-12-29 14:18:56 +01:00
parent 4bf74afacc
commit bdcc258305
Notes: blender-bot 2023-02-14 03:44:41 +01:00
Referenced by issue #75844, Blend modes are broken
1 changed files with 6 additions and 6 deletions

View File

@ -1072,10 +1072,10 @@ BLI_INLINE void apply_blend_function_byte(float fac,
for (int i = 0; i < y; i++) {
for (int j = 0; j < x; j++) {
unsigned int achannel = rt1[3];
rt1[3] = (unsigned int)achannel * fac;
unsigned int achannel = rt2[3];
rt2[3] = (unsigned int)achannel * fac;
blend_function(rt, rt1, rt2);
rt1[3] = achannel;
rt2[3] = achannel;
rt[3] = rt1[3];
rt1 += 4;
rt2 += 4;
@ -1098,10 +1098,10 @@ BLI_INLINE void apply_blend_function_float(float fac,
for (int i = 0; i < y; i++) {
for (int j = 0; j < x; j++) {
float achannel = rt1[3];
rt1[3] = achannel * fac;
float achannel = rt2[3];
rt2[3] = achannel * fac;
blend_function(rt, rt1, rt2);
rt1[3] = achannel;
rt2[3] = achannel;
rt[3] = rt1[3];
rt1 += 4;
rt2 += 4;