[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55423] trunk/blender/source/blender/ compositor/operations: change to variable size bokeh blue, dont blur larger areas then the current pixel defines.

Campbell Barton ideasman42 at gmail.com
Tue Mar 19 19:32:56 CET 2013


Revision: 55423
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55423
Author:   campbellbarton
Date:     2013-03-19 18:32:56 +0000 (Tue, 19 Mar 2013)
Log Message:
-----------
change to variable size bokeh blue, dont blur larger areas then the current pixel defines.
caused nasty looking errors with DOF.

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

Modified: trunk/blender/source/blender/compositor/operations/COM_OpenCLKernels.cl
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_OpenCLKernels.cl	2013-03-19 18:15:33 UTC (rev 55422)
+++ trunk/blender/source/blender/compositor/operations/COM_OpenCLKernels.cl	2013-03-19 18:32:56 UTC (rev 55423)
@@ -112,7 +112,7 @@
 					float dx = nx - realCoordinate.s0;
 					if (dx != 0 || dy != 0) {
 						inputCoordinate.s0 = nx - offsetInput.s0;
-						size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar;
+						size = min(read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar, size_center);
 						if (size > threshold) {
 							if (size >= fabs(dx) && size >= fabs(dy)) {
 								float2 uv = {256.0f + dx * 255.0f / size,

Modified: trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp	2013-03-19 18:15:33 UTC (rev 55422)
+++ trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp	2013-03-19 18:32:56 UTC (rev 55423)
@@ -146,7 +146,7 @@
 				int offsetNxNy = offsetNy + (minx * COM_NUMBER_OF_CHANNELS);
 				for (int nx = minx; nx < maxx; nx += QualityStepHelper::getStep()) {
 					if (nx != x || ny != y) {
-						float size = inputSizeFloatBuffer[offsetNxNy] * scalar;
+						float size = min(inputSizeFloatBuffer[offsetNxNy] * scalar, size_center);
 						if (size > this->m_threshold) {
 							float dx = nx - x;
 							if (size > fabsf(dx) && size > fabsf(dy)) {




More information about the Bf-blender-cvs mailing list