#define rot(a) mat2(cos(a),sin(a),-sin(a),cos(a))
float cube(vec3 p,float r){vec3 q=abs(p)-r;return length(max(q,0.))+min(max(q.x,max(q.y,q.z)),0.);}
float octa(vec3 p,float r){return dot(abs(p),normalize(vec3(r)))-r;}
float tetra(vec3 p,float r){
vec3 p1=p,p2=p,p3=p,p4=p;
return max(-octa(p4,r*1.155),max(-octa(p3,r*1.155),max(-octa(p2,r*1.155),max(-octa(p1,r*1.155),cube(p,r)))));
p.yz*=rot(PI/2.-PI/4.-PI/16.);
float obj1 = min(tetra(p, 5.), tetra(p2, 5.));
float obj2 = octa(p, 2.5);
return mix(obj1, obj2, (cos(time*changeSpeed)+1.)/2.);
vec4 display = vec4(0.0);
vec2 uv=(gl_FragCoord.xy-.5*resolution)/resolution.y;
vec3 rd=normalize(vec3(uv,1));