I HAD to know how this works 😱 I rewrote it in TypeScript and unminimized parts of the code for readability. TypeGPU takes that code and compiles it into WGSL (WebGPU Shading Language), so it can be executed on the GPU 🚀 Code & Preview: docs.swmansion.com/TypeGPU/exam... #WebGPU
"Runner" vec3 q,p;for(float z,d,i,l;l++<3e1;z+=d,o+=.1*(vec4(4,2,1,0)-tanh(p.y+4.))*d/(1.+z)){p=z*normalize(FC.rgb*2.-r.xyy)-2.;p.xz-=t+3.;for(q=p,d=p.y,i=4e1;i>.01;i*=.2)d=max(d,min(min(q=i*.9-abs(mod(q,i+i)-i),q.y).x,q.z)),q.xz*=rotate2D(9.);}o=tanh(o*o);
3 reposts27 likes