Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2020-10-27 15:20:50 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-10-29 11:27:10 +0300
commit6a5d2f4ea2261528ae9d15c66852635b05743d97 (patch)
treed509bfa5323316d3dd3ce6babb06e9e8f5df9b93 /source/blender
parent01d02e78b567d214926ce99be41fe76e7efc2bc6 (diff)
Fix blend_color_interpolate_byte returning wrong alpha in certain case
When the combined alpha [the 'tmp' variable having the mixfactor applied already] - reached zero it was handled like a no-op (for the alpha as well) and just copied the first color. So e.g mixing 255/255/255/255 with 0/0/0/0 with a factor of 1.0 gave alpha of 255, which looks wrong. cases where tmp gets zero: src1 alpha:0 src2 alpha:whatever mixfactor 0.0 src1 alpha:whatever src2 alpha:0 mixfactor 1.0 src1 alpha:0 src2 alpha:0 mixfactor whatever Now set alpha to zero in that case. ref T81914 Maniphest Tasks: T81914 Differential Revision: https://developer.blender.org/D9357
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenlib/intern/math_color_blend_inline.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_color_blend_inline.c b/source/blender/blenlib/intern/math_color_blend_inline.c
index eb82bb81a89..7ad4f0d9585 100644
--- a/source/blender/blenlib/intern/math_color_blend_inline.c
+++ b/source/blender/blenlib/intern/math_color_blend_inline.c
@@ -606,6 +606,7 @@ MINLINE void blend_color_interpolate_byte(uchar dst[4],
}
else {
copy_v4_v4_uchar(dst, src1);
+ dst[3] = 0;
}
}