[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47992] trunk/blender/source/blender/ compositor/operations/COM_BlurBaseOperation.cpp: use ease interpolation for dilate/erode feather option, looks smoother
Campbell Barton
ideasman42 at gmail.com
Sat Jun 16 17:15:06 CEST 2012
Revision: 47992
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47992
Author: campbellbarton
Date: 2012-06-16 15:15:05 +0000 (Sat, 16 Jun 2012)
Log Message:
-----------
use ease interpolation for dilate/erode feather option, looks smoother
Modified Paths:
--------------
trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
Modified: trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp 2012-06-16 14:40:16 UTC (rev 47991)
+++ trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp 2012-06-16 15:15:05 UTC (rev 47992)
@@ -89,7 +89,8 @@
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 @@
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;
}
More information about the Bf-blender-cvs
mailing list