[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49709] trunk/blender/source/blender/ compositor/operations/COM_VariableSizeBokehBlurOperation.cpp: dof node; change how threshold is applied, rather then clip out pixels at the threshold, fade instead.

Campbell Barton ideasman42 at gmail.com
Wed Aug 8 18:49:12 CEST 2012


Revision: 49709
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49709
Author:   campbellbarton
Date:     2012-08-08 16:49:12 +0000 (Wed, 08 Aug 2012)
Log Message:
-----------
dof node; change how threshold is applied, rather then clip out pixels at the threshold, fade instead.

note: need to apply this change to opencl still.

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

Modified: trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp	2012-08-08 16:48:05 UTC (rev 49708)
+++ trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp	2012-08-08 16:49:12 UTC (rev 49709)
@@ -158,6 +158,15 @@
 		color[1] = color_accum[1] / multiplier_accum[1];
 		color[2] = color_accum[2] / multiplier_accum[2];
 		color[3] = color_accum[3] / multiplier_accum[3];
+
+		/* blend in out values over the threshold, otherwise we get sharp, ugly transitions */
+		if ((sizeCenter > this->m_threshold) &&
+		    (sizeCenter < this->m_threshold * 2.0f))
+		{
+			/* factor from 0-1 */
+			float fac = (sizeCenter - this->m_threshold) / this->m_threshold;
+			interp_v4_v4v4(color, readColor, color, fac);
+		}
 	}
 
 }




More information about the Bf-blender-cvs mailing list