Just a random thing if anyone finds it useful – here’s some vex to quantise a value to steps, with variable smoothness: “` float smoothstep(float n; float x) { if (n == 0) return x; return 1.0/(1.0+pow(1.0/x-1.0,n) ); }
vector smoothstep(float n; vector x) { if (n == 0) return x; vector un = {1,1,1}; return un/(un+pow(un/x-un,n) ); }
// step: levels of quantisation // val: value to quantise // rolloff: smoothness
val *= step; vector fraction = smoothstep(rolloff, frac(val)); val = floor(val) + fraction; val /= step; “`
default houdini smooth() doesn’t work symmetrically
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20192210/08/19/smoothquant.png