Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-08 20:49:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-08 20:49:12 +0400
commitc21bf16c46a095ab0508793315cb236d93b17fee (patch)
tree80c9847195914c0caa07b497858ebdda75106041 /source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
parent748228d223d96690a606112c98db5c4a4b87ecb7 (diff)
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.
Diffstat (limited to 'source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp9
1 files changed, 9 insertions, 0 deletions
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);
+ }
}
}