[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51004] trunk/blender/source/blender/ compositor/operations/COM_ZCombineOperation.cpp: * fix for regression file [compo_map_zcombine_cubes.blend]

Jeroen Bakker j.bakker at atmind.nl
Tue Oct 2 12:03:16 CEST 2012


Revision: 51004
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51004
Author:   jbakker
Date:     2012-10-02 10:03:16 +0000 (Tue, 02 Oct 2012)
Log Message:
-----------
 * 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 -

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/operations/COM_ZCombineOperation.cpp

Modified: trunk/blender/source/blender/compositor/operations/COM_ZCombineOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_ZCombineOperation.cpp	2012-10-02 06:24:02 UTC (rev 51003)
+++ trunk/blender/source/blender/compositor/operations/COM_ZCombineOperation.cpp	2012-10-02 10:03:16 UTC (rev 51004)
@@ -69,7 +69,7 @@
 
 	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 @@
 	}
 	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]);
 }
 




More information about the Bf-blender-cvs mailing list