[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59261] trunk/blender/source/blender/ compositor/intern/COM_MemoryBuffer.cpp: Fix issue with EWA filtering in compositor which disabled alpha

Sergey Sharybin sergey.vfx at gmail.com
Mon Aug 19 10:30:03 CEST 2013


Revision: 59261
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59261
Author:   nazgul
Date:     2013-08-19 08:30:03 +0000 (Mon, 19 Aug 2013)
Log Message:
-----------
Fix issue with EWA filtering in compositor which disabled alpha

It was caused by wrong copy-paste thing, which replaced check
"whether alpha channel is enabled" with "whether alpha channel
is not zero" (which is always zero in accumulator).

Compositor always works with RGBA, so no need to do any special
checks here.

TODO: Maybe MapUV ode shall ignore alpha channel?

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp

Modified: trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2013-08-19 08:03:44 UTC (rev 59260)
+++ trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2013-08-19 08:30:03 UTC (rev 59261)
@@ -335,8 +335,7 @@
 				float tc[4];
 				const float wt = EWA_WTS[(Q < 0.f) ? 0 : (unsigned int)Q];
 				read(tc, clipuv(u, width), clipuv(v, height));
-				madd_v3_v3fl(result, tc, wt);
-				result[3] += result[3] ? tc[3] * wt : 0.f;
+				madd_v4_v4fl(result, tc, wt);
 				d += wt;
 			}
 			Q += DQ;
@@ -346,9 +345,5 @@
 	
 	// d should hopefully never be zero anymore
 	d = 1.f / d;
-	result[0] *= d;
-	result[1] *= d;
-	result[2] *= d;
-	// clipping can be ignored if alpha used, texr->ta already includes filtered edge
-	result[3] = result[3] ? result[3] * d : 1.f;
+	mul_v4_fl(result, d);
 }




More information about the Bf-blender-cvs mailing list