Last active
January 23, 2017 14:23
-
-
Save literallylara/43844c6621be811211bf5da8305c196c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// More info on the boilerplate at https://xem.github.io/articles/#webgl_quest | |
<canvas style=width:512px;height:512px id=a><svg onload='for(i in g=a.getContext`webgl`)g[i[0]+i[6]]=g[i];with(g)vA(P=cP(),2,5120,bD(B=ET-3,Int8Array.of(B,setInterval(x=>dr(6,vertexAttrib1f(1,NO+=.01),3),A=s=>sS(S=cS(FN++),s)|ce(S)|aS(P,S)),!A(`${V="precision lowp float;varying vec4 C,U;mat2 rot(float a){float c=cos(a),s=sin(a);return mat2(c,-s,s,c);}void main(){"}vec3 c=vec3(0),p,q;float t=0.,d,e,f,j,T=U.x;for(float i=0.;i<99.;i++){p=vec3(C.xy*3.,t-3.);q=p;q.yz*=rot(T-.8);q.xy*=rot(T-.6);e=max(length(q.xz)-.15,abs(q.y)-2.);q=p;q.xz*=rot(.8);q.yz*=rot(.6);f=length(vec2(length(q.xy)-2.,q.z))-.1;q=p;q.xz*=rot(-.8);q.yz*=rot(.6);f=min(f,length(vec2(length(q.xy)-2.,q.z))-.1);d=min(e,f);t+=d;if(d<.01){c=vec3(1.3-step(length(p),1.));j=i;break;}}gl_FragColor=vec4(c-t*j/50.,1);}`),B,!eV(bf(B,cB())),!A(`attribute vec4 A,B;${V}gl_Position=C=A;U=B;}`)),B+82),lo(P),ug(P))'> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
795b