[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49409] trunk/blender/source/blender/ compositor/operations/COM_BokehBlurOperation.cpp: Fixed [#32226] Black cadioptric lenses in CPU BokehBlur node

Jeroen Bakker j.bakker at atmind.nl
Tue Jul 31 14:36:09 CEST 2012


Revision: 49409
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49409
Author:   jbakker
Date:     2012-07-31 12:36:08 +0000 (Tue, 31 Jul 2012)
Log Message:
-----------
Fixed [#32226] Black cadioptric lenses in CPU BokehBlur node

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

Modified: trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp	2012-07-31 10:34:42 UTC (rev 49408)
+++ trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp	2012-07-31 12:36:08 UTC (rev 49409)
@@ -94,9 +94,14 @@
 		int bufferstartx = inputBuffer->getRect()->xmin;
 		int bufferstarty = inputBuffer->getRect()->ymin;
 		int pixelSize = this->m_size * this->getWidth() / 100.0f;
-		if (pixelSize==0) {
-			this->m_inputProgram->read(color, x, y, COM_PS_NEAREST);
-			return;
+		zero_v4(color_accum);
+
+		if (pixelSize<2) {
+			this->m_inputProgram->read(color_accum, x, y, COM_PS_NEAREST);
+			multiplier_accum[0] = 1.0f;
+			multiplier_accum[1] = 1.0f;
+			multiplier_accum[2] = 1.0f;
+			multiplier_accum[3] = 1.0f;
 		}
 		int miny = y - pixelSize;
 		int maxy = y + pixelSize;
@@ -107,7 +112,6 @@
 		maxy = min(maxy, inputBuffer->getRect()->ymax);
 		maxx = min(maxx, inputBuffer->getRect()->xmax);
 
-		zero_v4(color_accum);
 
 		int step = getStep();
 		int offsetadd = getOffsetAdd();




More information about the Bf-blender-cvs mailing list