diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-16 19:15:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-16 19:15:05 +0400 |
commit | 392b3a78e2c3744a043c3f04bcc0f82df73ef40c (patch) | |
tree | d9f71fb6cc596cd34a3d932599456c104639c4b3 /source/blender/compositor/operations/COM_BlurBaseOperation.cpp | |
parent | 6fc277c410d5ee4d13562e4b8b260bc0929f30f5 (diff) |
use ease interpolation for dilate/erode feather option, looks smoother
Diffstat (limited to 'source/blender/compositor/operations/COM_BlurBaseOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_BlurBaseOperation.cpp | 7 |
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; } |