diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-10-02 14:03:16 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-10-02 14:03:16 +0400 |
commit | ecbeb0f575b2e6152795211c1fa807b384a6288d (patch) | |
tree | a41fc8b95af70137b0e44b286bf297553837783b /source/blender/compositor/operations/COM_ZCombineOperation.cpp | |
parent | c17cf368531cebfbf2cb300779f536d19d558bed (diff) |
* 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 -
Diffstat (limited to 'source/blender/compositor/operations/COM_ZCombineOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ZCombineOperation.cpp | 8 |
1 files 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]); } |