From ecbeb0f575b2e6152795211c1fa807b384a6288d Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 2 Oct 2012 10:03:16 +0000 Subject: * fix for regression file [compo_map_zcombine_cubes.blend] the alpha mix formula was wrong. updated it. Be aware that the regression file does not take the alpha into account, but it should. or at least one z combine should and the other not. this fails in 2.63a. - At Mind - --- source/blender/compositor/operations/COM_ZCombineOperation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.cpp b/source/blender/compositor/operations/COM_ZCombineOperation.cpp index 7e23e7290f8..c3ae42a6d8a 100644 --- a/source/blender/compositor/operations/COM_ZCombineOperation.cpp +++ b/source/blender/compositor/operations/COM_ZCombineOperation.cpp @@ -69,7 +69,7 @@ void ZCombineAlphaOperation::executePixel(float output[4], float x, float y, Pix this->m_depth1Reader->read(depth1, x, y, sampler); this->m_depth2Reader->read(depth2, x, y, sampler); - if (depth1[0] < depth2[0]) { + if (depth1[0] <= depth2[0]) { this->m_image1Reader->read(color1, x, y, sampler); this->m_image2Reader->read(color2, x, y, sampler); } @@ -79,9 +79,9 @@ void ZCombineAlphaOperation::executePixel(float output[4], float x, float y, Pix } float fac = color1[3]; float ifac = 1.0f - fac; - output[0] = color1[0] + ifac * color2[0]; - output[1] = color1[1] + ifac * color2[1]; - output[2] = color1[2] + ifac * color2[2]; + output[0] = fac*color1[0] + ifac * color2[0]; + output[1] = fac*color1[1] + ifac * color2[1]; + output[2] = fac*color1[2] + ifac * color2[2]; output[3] = MAX2(color1[3], color2[3]); } -- cgit v1.2.3