From c21bf16c46a095ab0508793315cb236d93b17fee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Aug 2012 16:49:12 +0000 Subject: 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. --- .../compositor/operations/COM_VariableSizeBokehBlurOperation.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/compositor') diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index cd2438ecd12..5508eb4c8bd 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -158,6 +158,15 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo 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); + } } } -- cgit v1.2.3