[Bf-blender-cvs] [bdcc2583050] master: Fix: VSE colormix blend factor not working

Richard Antalik noreply at git.blender.org
Wed Dec 29 15:09:18 CET 2021


Commit: bdcc25830506aa8359351424707cc6d735df7f34
Author: Richard Antalik
Date:   Wed Dec 29 14:18:56 2021 +0100
Branches: master
https://developer.blender.org/rBbdcc25830506aa8359351424707cc6d735df7f34

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 fdee84fd567a where another change was, that
background alpha is copied into result, which is correct.

Apply blend factor to foreground image alpha channel.

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

M	source/blender/sequencer/intern/effects.c

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

diff --git a/source/blender/sequencer/intern/effects.c b/source/blender/sequencer/intern/effects.c
index f2ee1a058e2..8776bc63cf0 100644
--- a/source/blender/sequencer/intern/effects.c
+++ b/source/blender/sequencer/intern/effects.c
@@ -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;



More information about the Bf-blender-cvs mailing list