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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-06-16 19:15:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-16 19:15:05 +0400
commit392b3a78e2c3744a043c3f04bcc0f82df73ef40c (patch)
treed9f71fb6cc596cd34a3d932599456c104639c4b3 /source
parent6fc277c410d5ee4d13562e4b8b260bc0929f30f5 (diff)
use ease interpolation for dilate/erode feather option, looks smoother
Diffstat (limited to 'source')
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
index 0e7676dfcef..a233c7a50ae 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
@@ -89,7 +89,8 @@ float *BlurBaseOperation::make_gausstab(int rad)
return gausstab;
}
-/* normalized distance from the current (inverted so 1.0 is close and 0.0 is far) */
+/* normalized distance from the current (inverted so 1.0 is close and 0.0 is far)
+ * 'ease' is applied after, looks nicer */
float *BlurBaseOperation::make_dist_fac_inverse(int rad)
{
float *dist_fac_invert, val;
@@ -101,6 +102,10 @@ float *BlurBaseOperation::make_dist_fac_inverse(int rad)
for (i = -rad; i <= rad; i++) {
val = 1.0f - fabsf(((float)i / (float)rad));
+
+ /* ease - gives less hard lines for dilate/erode feather */
+ val = (3.0f * val * val - 2.0f * val * val * val);
+
dist_fac_invert[i + rad] = val;
}