diff --git a/src/shimmers/math/equations.cljc b/src/shimmers/math/equations.cljc index 06b6a06e..915e8dd1 100644 --- a/src/shimmers/math/equations.cljc +++ b/src/shimmers/math/equations.cljc @@ -179,3 +179,6 @@ (comment (map (fn [x] [x (flatstep x 1.2)]) (range 0 1 0.1))) + +(defn inv-smoothstep [x] + (- 0.5 (math/sin (/ (math/asin (- 1.0 (* 2.0 x))) 3.0)))) diff --git a/src/shimmers/sketches/cilia_phase.cljs b/src/shimmers/sketches/cilia_phase.cljs index e0e3853b..8bfc524b 100644 --- a/src/shimmers/sketches/cilia_phase.cljs +++ b/src/shimmers/sketches/cilia_phase.cljs @@ -100,7 +100,8 @@ (+ 0.025 (eq/gaussian amp 0.5 -0.125 y))) :pts [(dr/weighted {:equal 1.0 - :gaussian 1.0}) + :gaussian 1.0 + :inv-smooth 1.0}) (dr/weighted {150 1.0 200 5.0 250 4.0 300 2.0 400 0.75 600 0.25})] :phase @@ -136,7 +137,10 @@ :equal (range -0.05 1.05 (/ 1.0 density)) :gaussian (dr/gaussian-range (/ 1.0 density) (/ 1.0 (eq/sqr density)) - true [-0.05 1.05])) + true [-0.05 1.05]) + :inv-smooth + (for [x (tm/norm-range density)] + (eq/inv-smoothstep x))) cilia (cilias {:samples samples :screen-space screen