{"id":403,"date":"2019-10-08T00:22:24","date_gmt":"2019-10-08T07:22:24","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=403"},"modified":"2019-10-08T00:22:26","modified_gmt":"2019-10-08T07:22:26","slug":"archived-post-by-matte-6","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2019\/10\/08\/archived-post-by-matte-6\/","title":{"rendered":"Archived post by matte"},"content":{"rendered":"<p class=\"\">Just a random thing if anyone finds it useful &#8211; here&#8217;s some vex to quantise a value to steps, with variable smoothness: &#8220;` float smoothstep(float n; float x) {     if (n == 0) return x;     return 1.0\/(1.0+pow(1.0\/x-1.0,n) ); }<br \/>\nvector smoothstep(float n; vector x) {     if (n == 0) return x;     vector un = {1,1,1};     return un\/(un+pow(un\/x-un,n) ); }<br \/>\n\/\/ step: levels of quantisation \/\/ val: value to quantise \/\/ rolloff: smoothness<br \/>\nval *= step; vector fraction = smoothstep(rolloff, frac(val)); val = floor(val) + fraction; val \/= step; &#8220;`<\/p>\n<p class=\"\">default houdini smooth() doesn&#8217;t work symmetrically<\/p>\n<p>Attachments in this post: <br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20192210\/08\/19\/smoothquant.png\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20192210\/08\/19\/smoothquant.png<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a random thing if anyone finds it useful &#8211; here&#8217;s some vex to quantise a value to steps, with variable smoothness: &#8220;` 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}; &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2019\/10\/08\/archived-post-by-matte-6\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by matte<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/403"}],"collection":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/comments?post=403"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/403\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=403"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}