{"id":979,"date":"2025-05-22T16:31:48","date_gmt":"2025-05-22T23:31:48","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=979"},"modified":"2025-05-22T16:40:36","modified_gmt":"2025-05-22T23:40:36","slug":"archived-post-by-mattiasmalmer-80","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2025\/05\/22\/archived-post-by-mattiasmalmer-80\/","title":{"rendered":"Archived post by mattiasmalmer"},"content":{"rendered":"<div class=\"postie-post\">\n<p class=\"\">cateye&#8230;<\/p>\n<p class=\"\">&#8220;`<br \/>\n#bind layer src? val=0 #bind layer !&#038;dst<br \/>\ninline float2 fibonacci_spiral(int n ,int samples) {     float phi = (1.0f + sqrt(5.0f)) \/ 2.0f; \/\/ Golden ratio     float angle = 2.0f * M_PI * phi * n;     float r = 1.0f * sqrt((float)n \/samples); \/\/ Normalized radius     float x = r * cos(angle);     float y = r * sin(angle);     return (float2)(x,y); }<br \/>\ninline float2 scale_along_vector(float2 pos, float2 dir, float scale) {     \/\/ Normalize the direction     float2 n = normalize(dir);          \/\/ Project pos onto dir     float proj_len = dot(pos, n);     float2 proj = proj_len * n;          \/\/ Compute the component orthogonal to dir     float2 ortho = pos &#8211; proj;          \/\/ Scale only the projection     return proj * scale + ortho; }<\/p>\n<p>@KERNEL {     float2 pos=(float2)(@ix,@iy);          float4 color=(float4)(0,0,0,0);<br \/>\n    for (int i=0; i<@samples; i++)     {         float2 disc=fibonacci_spiral(i,@samples)<a href=\"mailto:*@radii\" >*@radii<\/a>;                  float2 dir=pos-(float2)(@xres,@yres)*.5f;                  float dist=length(dir)\/length((float2)(@xres,@yres)*.5f);                  disc=scale_along_vector(disc , dir ,(1-pow(dist,1.0f)<a href=\"mailto:*@squash\" >*@squash<\/a>));                  <a href=\"mailto:color+=@src.bufferSample\" >color+=@src.bufferSample<\/a>(pos+disc);     }<br \/>\n    @dst.set(<a href=\"mailto:color\/@samples\" >color\/@samples<\/a>); }<br \/>\n&#8220;`<br \/>\njust make radii, squash and (int)samples in the bindings<\/p>\n<p>Attachments in this post: <br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20253105\/22\/25\/image.png\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20253105\/22\/25\/image.png<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>cateye&#8230; &#8220;` #bind layer src? val=0 #bind layer !&#038;dst inline float2 fibonacci_spiral(int n ,int samples) { float phi = (1.0f + sqrt(5.0f)) \/ 2.0f; \/\/ Golden ratio float angle = 2.0f * M_PI * phi * n; float r = 1.0f * sqrt((float)n \/samples); \/\/ Normalized radius float x = r * cos(angle); float y &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2025\/05\/22\/archived-post-by-mattiasmalmer-80\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by mattiasmalmer<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/979"}],"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=979"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/979\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=979"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}