0x32d4…f436

All memos sent from and to 0x32d4…f436.

Transition explores the concept of motion resulting from the shift between two states. The tipping point from stability/order to chaos. Structures emerge and dissolve into surreal landscapes lost in time. It is highly recommended to experience the piece in big format or zoom in on parts of the image. Transition is a work that uses WebGL2, while a lot of work has been put into optimisation, recent devices might be required to render it.
!function(){"use strict";var e=Math.exp,t=Math.cos,c=Math.sin,r=Math.PI,n=Math.pow,o=Math.min,a=Math.max,f=Math.abs,l=Math.sqrt,i=Math.floor;class s{constructor(){this.useA=!1;let e=function(e){let t=parseInt(e.substring(0,8),16),c=parseInt(e.substring(8,16),16),r=parseInt(e.substring(16,24),16),n=parseInt(e.substring(24,32),16);return function(){t|=0,c|=0,r|=0,n|=0;let e=0|(0|t+c)+n;return n=0|n+1,t=c^c>>>9,c=0|r+(r<<3),r=r<<21|r>>>11,r=0|r+e,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substring(2,34)),this.prngB=new e(tokenData.hash.substring(34,66));for(let e=0;1e6>e;e+=2)this.prngA(),this.prngB()}rd(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}rn(e,t){return e+(t-e)*this.rd()}ri(e,t){return i(this.rn(e,t+1))}rc(e){return e[this.ri(0,e.length-1)]}rp(e){let t=0;return Object.entries(e).reduce(((e,[c,r])=>(t+=r,e.concat(Array(r).fill(0).map((()=>c))))),[])[this.ri(0,t-1)]}}let v=new s;const u=480,d=1800,g=120,x=l(2),b=e=>2*i(e/2),m=(e,t,c)=>.2125*e+.7154*t+.0721*c,p=e=>2*f(e-i(e+.5)),y=(e,t)=>{if(e=e||window.innerWidth,(t=t||window.innerHeight)<=e){const e=b(t);let c=i(e);return[c,e,c+c%2,e,!1]}{const t=b(e);let c=i(t);return[t,c,t,c+c%2,!0]}},h=(e,t,c,r)=>{const n=a(e,t,c),f=n-o(e,t,c),l=0===f?0:f&&(n===e?(t-c)/f:n===t?2+(c-e)/f:4+(e-t)/f);r[0]=(0>l?l+6:l)/6,r[1]=n&&f/n,r[2]=n},E=(e,t,c,r)=>{if(0===t)r[0]=r[1]=r[2]=c;else{const n=(e,t,c)=>(0>c&&(c+=1),1<c&&(c-=1),c<1/6?e+6*(t-e)*c:c<.5?t:c<2/3?e+(t-e)*(2/3-c)*6:e);let o=.5>c?c*(1+t):c+t-c*t,a=2*c-o;r[0]=n(a,o,e+1/3),r[1]=n(a,o,e),r[2]=n(a,o,e-1/3)}},R=(...e)=>new THREE.Vector3(...e),w={Hessonite:[3,[1,.727,.521],[.337,.392,.667],[.4,.3,.2],[.45,.5],[.49,.56,.75],[.9,.8,.9],2.3,2.1,1.3,.025,.95],Aquamarine:[1,[.01,.08,.48],[.312,.611,.541],[.4,.1,.4],[.25,.6],[.517,.768,.56],[.9,1,.8],2.2,1.5,1.15,.015,1.1],Labradorite:[3,[.345,.624,.973],[.87,.76,.27],[.5,.3,.3],[.176,.77],[2,.9,.9],[.85,.75,1],2.3,1.1,1.5,.02,1.05],VerdeDarno:[3,[.345,.614,.823],[.87,.76,.27],[.5,.2,0],[.156,.57],[1,.9,.85],[1,1,.8],2.2,1.1,1.4,.02,1.03],DendriticAgate:[3,[.345,.624,.973],[.87,.76,.27],[.5,.3,.3],[.16,.7],[.9,.81,.81],[1,.8,.4],2.2,1.1,1.6,.04,1.1],Amethyst:[3,[.474,.749,.856],[.728,.658,.784],[.6,.5,.2],[.13,1.5],[.8,.704,.704],[.7,1,.9],2.1,1.1,2.2,.019,1.02],Ammolite:[2,[.8,.744,.604],[.41,.49,.29],[.25,.1,.5],[.18,.59],[.488,.31,.136],[.85,.95,.7],2.6,2.1,1.15,.01,1.05],"Unakite-a":[3,[.6,.6143,.3997],[.137,.442,.727],[.64,.56,.16],[.3,.42],[.66,.396,.35],[1,.9,.8],2.3,2.2,1.3,.02,1],Peridot:[4,[.6,.6143,.3997],[.037,.442,.767],[.64,.56,.16],[.28,.45],[.5,.43,.4],[1,.9,.8],2.3,2.1,1.3,.025,1.05],"Ametrine-a":[2,[.896,.698,.39],[.192,.162,.312],[.3,.2,0],[.3,.5],[.493,.489,.72],[.8,.8,1],2.2,2,1.3,.015,1.02],"Ametrine-b":[3,[.945,.768,.598],[.282,.149,.384],[.227,.122,.31],[.4,.56],[.59,.54,.9],[1,.9,.7],2.25,1.9,1.44,.02,.9],"Unakite-b":[1,[.522,.46,.29],[.304,.536,.375],[0,.2,.4],[.13,.7],[.524,.069,.068],[1,1,.5],2.3,2.1,.85,.012,1.05]},T=[(e,t,c)=>v.rd()>c,(e,t,c)=>v.rd()>c+5e-5*(1-t)-.001*e,(e,t,c)=>v.rd()>c+5e-5*(1-t)-.01*e],M=[(e,t)=>1*(v.rd()>t+.25*(1-t)-e*(1-t)*.5),e=>1*(v.rd()>.025*e+.975)],F=(e,t,c,r,o,a,f,l)=>{z(e,t,a,f,l,n(r,2-.75*(o+1-c[3]))*a[4]+(1-a[4]))},z=(e,t,c,r,n,o)=>{const a=(r*c[2]*n+c[2])/1080;e[0]+=t[0]*(a/o*.7),e[1]+=t[1]*(a/o*.7)},U=()=>{const e=(v=new s,{Palette:v.rp(Object.fromEntries(Object.keys(w).map((e=>[e,w[e][0]])))),Rendering:v.rp({Default:5,Light:4,Flat:1,"Cluttered-1":3,"Cluttered-2":3,Tall:4}),Scene:v.rp({Default:12,Arch:5,Dendrite:4})}),t={Default:(()=>{const e=v.rc([[[-1,2,5],[-24,9,-1],[-24,4,-2],[[.8,.9],[1.1,1.2]],[.5,1,.2]],[[-.5,5,0],[-24,6,-6],[-24,2,-6.1],[[.6,.9],[1.1,1.4]],[.5,1,.2]],[[0,7,0],[-26,5,-2],[-26.1,-2,-3],[[.6,.9],[1.1,1.6]],[0,1,0]],[[0,5,1],[-24,4,0],[-24.2,-2,-.8],[[.6,.9],[1.1,1.5]],[0,1,0]],[[-1,7,2],[-28.5,5,0],[-29,1,-1],[[.6,.9],[1.1,1.6]],[0,1,.5]]]);let[t,c]=[[0,[.8,1.2]],[1,[.8,.9]]][.9>v.rd()?0:1];return[1,A(-.02).multiply(k(.04)),e[0],e[1],e[2],e[3],c,0,[e[4]],t]})(),Arch:(()=>{const e=v.rc([[[-1,5,1],[-28.8,4,0],[-29.8,1,-1]]]);return[1,A(-.02).multiply(k(.04)),e[0],e[1],e[2],[[1.1,1.4]],[1.1,1.5],0,[[0,1,2]],2]})(),Dendrite:(()=>{const e=v.rc([[[2,2,-5],[-13,5,3],[-11,-2,-4]],[[2,2,-6],[-13,5,3],[-11,-3,-6]]]);return[0,A(-.025).multiply(C(-.05)).multiply(k(.07)),e[0],e[1],e[2],[[.7,.9]],[1.1,1.4],0,[[0,1,1]],0]})()}[e.Scene];t[8].push(...w[e.Palette]);const o={Default:[[[25,0,.7,1,.7],[90,.2,2,4,.1]],[.98,.5,40,T[1]],[.99,.9991,6,M[1]],[.9995,.9991,1,.5,90],F,v.rc([-.05,0,0,0,.04,.1,.18])],Light:[[[100,0,.5,1,.1],[100,.6,1.4,3,.495]],[.98,.5,50,T[1]],[.99,.9982,8,M[1]],[.9998,.9991,15,.5,150],(e,t,n,o,a,f,l,i)=>{z(e,t,f,l,i,.8*(.5*c(a*r-r/2)+.5+.5*c(o*r-r/2)+.5)*f[4]+(1-f[4]))},v.rc([-.2,-.1,0,0,.05,.1,.2,.25])],Flat:[[[100,.1,.55,1.3,.8],[50,.3,9,2,-.3]],[.992,.5,50,T[0]],[.989,.997,50,M[0]],[.9991,.9996,5,.5,150],(e,t,o,a,f,l,i,s)=>{z(e,t,l,i,s,n(a,2-.75*(f+1-.5*c(o[3]*r-r/2)+.5))*l[4]+(1-l[4]))},0],"Cluttered-1":[[[70,0,1.3,1.3,.03],[65,.6,2,2.5,2]],[.99,.75,45,T[2]],[.99,.9997,6,M[1]],[.998,.9998,20,.5,150],F,v.rc([-.15,-.1,0,0,.05,.1,.2])],"Cluttered-2":[[[60,0,.9,1.2,.05],[65,.6,1.9,2.7,2]],[.99,.75,45,T[2]],[.994,.9997,6,M[1]],[.9989,.9998,20,.5,100],F,v.rc([-.15,-.08,0,0,.08,.2])],Tall:[[[50,.1,.5,1.1,.5],[5,.1,6,4,.9]],[.98,.5,90,T[1]],[.97,.998,10,M[0]],[1,.982,3,.5,20],(e,t,c,r,o,a,f,l)=>{z(e,t,a,f,l,n(r,2-.5*o)*a[4]+(1-a[4]))},v.rc([-.3,-.2,-.1,0,0,0,.1,.2])]}[e.Rendering],a=.5<v.rd(),f=+v.rp({".9992":1,".9997":2,"1.":3}),l=i(99999*v.rd()*1e3)/1e3;return t[7]=B(R(...t[3]),R(3,-1,-10),t[1],R(...t[2])),[t,o[5],o[0],o[4],o[1],o[2],o[3],f,a,l]},C=e=>{const n=c(-e*r*2),o=t(-e*r*2),a=new THREE.Matrix3;return a.set(1,0,0,0,o,-n,0,n,o),a},k=e=>{const n=c(-e*r*2),o=t(-e*r*2),a=new THREE.Matrix3;return a.set(o,0,n,0,1,0,-n,0,o),a},A=e=>{const n=c(-e*r*2),o=t(-e*r*2),a=new THREE.Matrix3;return a.set(o,-n,0,n,o,0,0,0,1),a},B=(e,t,c,r)=>{const n=c.clone().transpose();return i(100*e.clone().applyMatrix3(n).add(r).add(t).length())/100};var S="uniform float uF;uniform vec3 uR;out vec2 vU;out vec2 vF;void main(){vU=uv;vF=vec2(uv.x,uv.y*.5+.5*mod(uF+1.,2.));gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.);}",L="uniform float uF;uniform vec3 uR;uniform sampler2D uT;uniform sampler2D uB;in vec2 vU;const float C=/*!F:C*/;const float E=/*!F:E*/;const float S=/*!F:S*/;vec3 b(vec3 e,float g){return vec3(step(e.x,g),step(e.y,g),step(e.z,g));}vec3 c(vec3 h){h=clamp(h,0.,1.);return mix(pow(h,vec3(.4166))*1.055-.055,h*12.92,b(h,.0031308));}vec3 d(vec3 j){return clamp((j*(2.51*j+.03))/(j*(2.43*j+.59)+.14),0.,1.);}void main(){vec4 k;if(vU.y>.5){k=texelFetch(uT,ivec2(floor(vU.x*uR.x),floor((vU.y*2.-1.)*uR.y)),0);}else{k=texelFetch(uB,ivec2(floor(vU.x*uR.x),floor((vU.y*2.)*uR.y)),0);}k.rgb/=float(uF)/2.+1.;vec3 l=vec3(dot(k.rgb,vec3(.2125,.7154,.0721)));k.rgb=c(d(clamp(pow(mix(l,k.rgb,S)*E,vec3(C)),0.,1.)));gl_FragColor=vec4(clamp(k.rgb,0.,1.),k.a);}";const P=(e,t,c,r=!1)=>new THREE.ShaderMaterial({uniforms:Object.fromEntries(c.map((e=>[e[0],{value:e[1]}]))),vertexShader:e,fragmentShader:t,transparent:!1,depthTest:r,depthWrite:r}),D=(e,t,c)=>{const r=`/*!S:${t}`,n=[`${r}`,`${r}:${c}*/`,`${r}:${c+1}*/`,`${r}:END*/`],o=n.map((t=>e.indexOf(t)));return-1===o[1]||-1===o[3]?e:e.slice(0,o[0])+e.slice(o[1]+n[1].length,void 0===o[2]?o[3]:0<=o[2]?o[2]:o[3])+e.slice(o[3]+n[3].length)},H=(e,t,c)=>{const r=`/*!F:${t}*/`,n=e.indexOf(r);return-1===n?e:`${e.slice(0,n)}${c}${0==i(c)-c?".":""}${e.slice(n+r.length)}`},I=(e,t,c)=>{const r=`/*!V3:${t}*/`,n=e.indexOf(r);return-1===n?e:`${e.slice(0,n)}vec3(${c.x},${c.y},${c.z})${e.slice(n+r.length)}`},j=(e,t)=>{e[0]=t[0],e[1]=t[1]};(()=>{let s,b,w,T,M,F,z,C,k,A,B,V,N,K,O,X,G,$,q,W,J,Z,_,Q=window,Y=document,ee=0,te=1+2*v.rd(),ce=-1;W=J=Z=!1,k=A=B=V=N=null;const re=i(15),ne=(e,t,c,r)=>{let n=new THREE.OrthographicCamera(e,t,c,r,.01,100);return n.position.z=.1,n.lookAt(R(0,0,0)),n},oe=(e,n,o)=>{let f;[K,O,G,$,f]=y(e,n),q=O/1080;let l=Q.devicePixelRatio??1;s.setRenderTarget(null),s.setPixelRatio(Q.devicePixelRatio),s.setClearColor(0,1),s.setSize(K*l,O*l),s.clear();let g=1*(o??f),m=["width","height"];X.style=`aspect-ratio:1;${m[1-g]}:100%;${m[g]}:max-content;margin:auto;padding:0;display:block;position:absolute;inset:0;`,b=ne(-240,240,240,-240),w=ne(-240,240,120,-120),T=ne(0,G,$,0),[C,z,k,A,M,F]=((e,t)=>{const c=THREE.NearestFilter,n=THREE.ClampToEdgeWrapping,o={type:THREE.FloatType,format:THREE.RGBAFormat,antialias:!1,precision:"highp",stencilBuffer:!1,depthBuffer:!1,minFilter:c,magFilter:c,wrapS:n,wrapT:n,alpha:!1,encoding:THREE.sRGBEncoding},f=[,,,,].fill(0).map((()=>new THREE.WebGLRenderTarget(u,240,o)));f.forEach((e=>e.texture.generateMipmaps=!1));const l=new THREE.WebGLRenderTarget(480,480,o);l.texture.generateMipmaps=!1,e.setRenderTarget(l),e.clearColor();let i=t[0][8],s=1===t[0][5].length,g="uniform float uF;uniform int uI;uniform float uS;uniform vec3 uR;uniform sampler2D uP;uniform float uT;uniform mat3 uC;in vec2 vU;in vec2 vF;\n#define k normalize\n#define C fract\n#define E floor\nconst float PI=3.1416;const float TAU=6.2832;const float MD=.002;const float Mat1=1.;const float Mat2=2.;const vec2 B=vec2(10.,0.);struct j{vec3 e;float r;float p;vec3 c;float s;float ss;};uint G(uint Rb){Rb^=Rb>>17;Rb*=0xed5ad4bbU;Rb^=Rb>>11;Rb*=0xac4c1b51U;Rb^=Rb>>15;Rb*=0x31848babU;Rb^=Rb>>14;return Rb;}uvec2 s1=uvec2(0);void H(){s1=uvec2(vF*uR.xy*84.67)+uvec2(uS,float(E(uF/2.))*84.67);}float I(){s1+=uvec2(1);return float(G(s1.x+G(s1.y)))/float(0xffffffffU);}uvec2 s2=uvec2(0);void J(int Vb){s2=uvec2(uS*84.67,uS*84.67+float(Vb)*13.31);}float K(){s1+=uvec2(1);return float(G(s2.x+G(s2.y)))/float(0xffffffffU);}uint L(uvec2 Xb){Xb=1103515245U*((Xb>>1U)^Xb.yx);uint Zb=1103515245U*(Xb.x^(Xb.y>>3U));return Zb^(Zb>>16);}vec2 N(uvec2 bc){uint dc=L(bc);return vec2((uvec2(dc,dc*48271U)>>1)&uvec2(0x7fffffffU))/float(0x7fffffff);}float P(vec2 fc){return dot(fc,fc);}float Q(vec2 hc){uvec2 kc=uvec2(int(E(hc.x)),int(E(hc.y)));vec2 mc=C(hc);float oc=1e10;vec3 qc=vec3(-1.,0.,1.);uvec3 sc=uvec3(-1,0,1);oc=min(P(qc.xx-mc+N(kc+sc.xx)),oc);oc=min(P(qc.xy-mc+N(kc+sc.xy)),oc);oc=min(P(qc.xz-mc+N(kc+sc.xz)),oc);oc=min(P(qc.yx-mc+N(kc+sc.yx)),oc);oc=min(P(qc.yy-mc+N(kc+sc.yy)),oc);oc=min(P(qc.yz-mc+N(kc+sc.yz)),oc);oc=min(P(qc.zx-mc+N(kc+sc.zx)),oc);oc=min(P(qc.zy-mc+N(kc+sc.zy)),oc);oc=min(P(qc.zz-mc+N(kc+sc.zz)),oc);return sqrt(oc);}vec2 R(float uc){vec2 wc=C(vec2(.5,1.)-uc*2.)*2.-1.;vec2 yc=sign(.5-C(vec2(.25,.5)-uc));return(20./(wc*wc+4.)-4.)*yc;}vec2 U(float Ac){return vec2(cos(Ac*TAU),sin(Ac*TAU));}mat3 V(float Cc){vec4 Ec=vec4(R(Cc),0.,1.);return mat3(Ec.wzz,vec3(Ec.zx,-Ec[1]),Ec.zyx);}mat3 W(float Gc){vec4 Ic=vec4(R(Gc),0.,1.);return mat3(Ic.xzy,Ic.zwz,vec3(-Ic[1],Ic.zx));}mat3 X(float Kc){vec4 Mc=vec4(R(Kc),0.,1.);return mat3(vec3(Mc.x,-Mc[1],Mc.z),Mc.yxz,Mc.zzw);}mat3 Y(vec3 Oc,vec3 Qc){vec3 Sc=k(Qc-Oc);vec3 Uc=k(cross(vec3(0.,1.,0.),Sc));vec3 Wc=cross(Sc,Uc);return mat3(Uc,Wc,Sc);}vec3 Z(vec3 Yc,float ad){return vec3(step(Yc.x,ad),step(Yc.y,ad),step(Yc.z,ad));}vec3 ab(vec3 cd){cd=clamp(cd,0.,1.);return mix(pow(((cd+.055)/1.055),vec3(2.4)),cd/12.92,Z(cd,.04045));}vec2 cb(vec3 ed,vec3 gd,float jd){vec3 ld=abs(ed)-gd;return vec2(length(max(ld,0.))+min(max(ld.x,max(ld.y,ld.z)),0.),jd);}vec2 eb(vec2 nd,vec2 pd){return step(nd.x,pd.x)*nd+step(pd.x,nd.x)*pd;}vec2 gb(vec2 td,vec2 vd){return step(-td.x,vd.x)*vd+step(vd.x,-td.x)*vec2(-td.x,td.y);}vec3 jb(vec2 xd,float zd){float Bd=atan(xd.y,xd.x);float Dd=C(E(Bd/TAU*zd+.5)/zd)/zd*(zd+1.);zd=PI/zd;Bd=mod(Bd+zd,zd*2.)-zd;vec2 Fd=length(xd)*U(Bd/TAU);return vec3(Fd.x-.5,Fd.y,Dd);}vec3 lb(vec3 Hd,float Jd,vec3 Ld,vec3 Nd){return Hd-Jd*clamp(round(Hd/Jd),Ld,Nd);}vec2 nb(vec2 Pd,vec3 Rd,vec3 Td,vec3 Vd,float Xd,float Zd,float be){return eb(Pd,cb(lb(vec3(abs(Rd.x),Rd.yz),Xd,-Td,Td)*W(Zd),Vd,be));}vec2 pb(vec2 de,vec3 fe,vec3 he){vec3 ke=lb(fe,5.,-B.xyx,B.xyx);ke.xz=jb(ke.xz,6.).xz;ke.x-=2.;return eb(de,cb(ke,he,Mat1));}vec3 rb(vec3 me,float oe,float qe){vec3 se=me;se.xz=jb(se.xz,oe).xy;se.x-=qe;return se;}vec2 tb(vec3 we){vec2 ye=vec2(99.);/*!S:S:0*/const float Ae=10.;we=(we*uC)/1.2+/*!V3:ST*/;ye=eb(ye,cb(rb(we,15.,Ae),vec3(.8,7.,.4),Mat2));vec3 Ce=we;Ce.xz=jb(Ce.xz,15.).xy;Ce.y+=.3;ye=eb(ye,cb(Ce,vec3(Ae,.4,2.),Mat2));vec3 Ee=rb(we,120.,Ae-5.);Ce=rb(we,20.,Ae-5.)+vec3(-0.,-3.,0.);Ce.xy=jb(Ce.xy,60.).xy;Ce.x-=Ae-7.5;ye=eb(ye,cb(Ce,vec3(.25,.2,.2),Mat1));ye=eb(ye,gb(cb(Ee+vec3(0.,-1.,0.),vec3(Ae-8.5,3.,2.),Mat1),cb(Ee+vec3(0.,1.,0.),vec3(Ae-7.,3.5,2.),Mat1)));ye=nb(ye,we+vec3(0.,-4.,0.),B.xyx,vec3(10.,.5,.25),2.,0.,Mat1);return vec2(ye.x*1.2,ye.y);/*!S:S:1*/we=(we*uC)/1.5+/*!V3:ST*/;ye=nb(ye,we+vec3(8.,-6.,-2.),B.yyx,vec3(1.5,10.,1.5),5.,.165,Mat2);ye=pb(ye,we+vec3(2.5,-6.,2.5),vec3(.2,1.,3.));ye=pb(ye,we+vec3(0.,-3.,1.),vec3(.2,.2,3.));return vec2(ye.x*1.5,ye.y);/*!S:S:END*/}vec3 vb(vec3 Ge,vec3 Ie){float Ke=MD;vec2 Me;int Oe=0;while(Oe<60){Me=tb(Ge+Ke*Ie);Ke+=Me.x;if(abs(Me.x)<MD*Ke || Ke>30.){break;}Oe++;}return vec3(step(Ke,30.)*vec2(Ke,Me.y),Oe);}float xb(vec3 Qe,vec3 Se){float Ue=MD;int We=0;while(We<60){float Ye=tb(Qe+Ue*Se).x;Ue+=Ye;if(Ye<MD*Ue || Ue>30.){break;}We++;}return step(30.,Ue);}vec3 zb(vec3 af){vec2 cf=vec2(.03,-.03);return k(cf.xyy*tb(af+cf.xyy).x+cf.yyx*tb(af+cf.yyx).x+cf.yxy*tb(af+cf.yxy).x+cf.xxx*tb(af+cf.xxx).x);}vec3 Bb(){float ef=I()*2.-1.;return pow(I(),.33)*vec3(sqrt(1.-ef*ef)*U(I()).yx,ef);}vec3 Db(vec3 gf){float jf=I()*2.-1.;return k(gf+vec3(sqrt(1.-jf*jf)*U(I()),jf));}vec3 Fb(vec3 lf,float nf){float pf=K()*nf*2.-1.;return k(lf+vec3(sqrt(1.-pf*pf)*U(K()),pf));}vec3 Hb(vec3 rf,vec3 tf){float vf=/*!F:LS2*/;float xf=dot(rf,tf);return step(xf,1.-vf)*/*!V3:LB*/+step(1.-vf,xf)*mix(/*!V3:LC1*/,/*!V3:LC2*/,clamp(1./(1.+exp((-(1.-xf)/vf+/*!F:LS1*//vf)*42.)),0.,1.));}vec4 Jb(vec2 zf,vec3 Bf,vec3 Df,vec3 Ff){vec3 Hf=Bf;vec3 Jf=vec3(0.);vec3 Lf=vec3(1.);vec3 Nf;vec3 Pf;int Rf=0;while(Rf<3){Nf=vb(Bf,Df);if(Nf.x<MD){if(Rf==0){return vec4(0.);}Jf+=ab(Hb(Df,Ff))*Lf;break;}Bf=Bf+Df*Nf.x;vec3 Tf=zb(Bf);if(Rf==0){Pf=Tf;}float Vf=xb(Bf+Tf*3e-2,Ff+Db(Ff)*.04);j Xf;if(Nf.y>Mat2-.5){Xf=j(/*!V3:LE*/,0.,.2,vec3(1.),1.,0.);}else{Xf=j(vec3(0.),.81,.14,vec3(.91),256.,.7);}float Zf=step(I(),Xf.p);float bg=Zf*Xf.p+(1.-Zf)*(1.-Xf.p);bg=max(bg,1e-3);vec3 dg=vec3(Xf.ss)*pow(max(0.,dot(k(Hf-Bf),-reflect(Ff,Tf))),Xf.s);vec3 fg=k(Tf+Bb());vec3 hg=reflect(Df,Tf);hg=k(mix(hg,fg,Xf.r*Xf.r));Df=mix(fg,hg,Zf);Jf+=(Xf.e+dg*Vf)*Lf;Lf*=mix(vec3(.96),Xf.c,Zf);Lf/=bg;Lf*=Vf;Lf*=exp(length(Hf-Bf)*-/*!F:F*/);float kg=max(Lf.r,max(Lf.g,Lf.b));if(I()>kg){break;}Lf*=1./kg;Bf+=Tf*(1e-3/abs(dot(Df,Tf)));Rf++;}return vec4(Jf,dot(Pf,k(vec3(.7071,-.7071,0.))));}vec2 Lb(vec2 mg,float og){mg.xy=pow(length(mg),og)*U(atan(mg.y,mg.x)/TAU);return mg;}vec3 Nb(vec3 sg){return sg*X(.09*pow(max(Q(sg.zz*3.)+E(uF/2.)*.006,1e-4),2.5));}vec4 Pb(vec2 ug){if(uI==-1){float wg=/*!F:SS*/;J(int(E(ug.y*wg))*int(wg)+int(E(ug.x*wg)));ug=C(ug*wg);}else{J(uI);}float yg=/*!F:A*/+K()*.4-.2;vec3 Ag=/*!V3:O*/;vec3 Cg=/*!V3:T*/;vec2 Eg=U(K());/*!S:BT:0*/ug=Lb(ug-Eg,(/*!F:B1*/+K()*/*!F:B2*/))+Eg;/*!S:BT:1*/ug=Lb(ug-Eg,(K()>.5?/*!F:B1*/+K()*/*!F:B2*/:/*!F:B3*/+K()*/*!F:B4*/))+Eg;/*!S:BT:END*/vec3 Gg=k(Cg-Ag);vec3 Ig=k(cross(Gg,vec3(0.,0.,1.)));vec2 Kg=ug+Bb().xz/uR.zz;vec3 Mg=k(vec3((Kg*2.-1.)*(/*!F:FM*/+K()*/*!F:FS*/),1.))*X(yg);vec2 Og=U(I())*sqrt(I())*.036;vec3 Qg=Ag+vec3(Og.x*Ig+Og.y*cross(Ig,Gg));Mg=k((Ag+/*!F:FL*/*Mg*Y(Ag,Cg))-Qg);vec3 Sg=Fb(k(/*!V3:LP*/),.125);/*!S:D:0*/Mg=Nb(Mg);/*!S:D:1*/Mg=Nb(Mg)*W(.15*(Q(sin(Mg.zz*PI)*1.5)-.5));/*!S:D:2*/Mg=Nb(Mg)*V(.125*Mg.z-.1);/*!S:D:END*/return Jb(ug,Qg,Mg,Sg);}void main(){H();vec4 Ug=(uF<2.?vec4(0.):texelFetch(uP,ivec2(E(vU.x*uR.x/2.),E(vU.y*uR.y/4.)),0));vec4 Wg=Pb(vF);gl_FragColor=vec4(Ug.xyz+clamp(Wg.xyz,0.,1.),Wg.w);}";g=D(g,"S",t[0][0]),g=D(g,"D",t[0][9]),g=D(g,"BT",s?0:1),g=H(g,"B1",t[0][5][0][0]),g=H(g,"B2",a(t[0][5][0][1]-t[0][5][0][0],0)),s||(g=H(g,"B3",t[0][5][1][0]),g=H(g,"B4",a(t[0][5][1][1]-t[0][5][1][0],0))),g=I(g,"LP",R(...i[0])),g=I(g,"LC1",R(...i[2])),g=I(g,"LC2",R(...i[3])),g=I(g,"LB",R(...i[4])),g=H(g,"LS1",i[5][0]),g=H(g,"LS2",i[5][1]),g=I(g,"LE",R(...i[6])),g=H(g,"F",i[11]),g=I(g,"O",R(...t[0][3])),g=I(g,"T",R(...t[0][4])),g=I(g,"ST",R(...t[0][2])),g=H(g,"FL",t[0][7]),g=H(g,"FM",t[0][6][0]),g=H(g,"FS",a(t[0][6][1]-t[0][6][0],0)),g=H(g,"A",v.rd()*r*2),g=H(g,"SS",10);const x=new THREE.PlaneBufferGeometry(480,240),b=P(S,g,[["uS",t[9]],["uF",0],["uI",-1],["uR",R(960,960,d)],["uP",null],["uT",60],["uC",t[0][1]]]),m=new THREE.Mesh(x,b);let p=L;p=H(L,"C",i[8]),p=H(p,"E",i[9]),p=H(p,"S",i[10]);const y=P(S,p,[["uF",0],["uR",R(480,240,d)],["uT",null],["uB",null]]),h=new THREE.PlaneBufferGeometry(480,480);return[b,m,y,new THREE.Mesh(h,y),f,l]})(s,_),B=((e,n,o,a)=>{let f="uniform float uS;uniform vec3 uR;in vec2 vU;in vec3 vC;in vec3 vP;float s=1.;void b(vec2 d){s=uS*2.3e-4;}float c(){vec3 e=fract(vec3((vU.xyx*uR.xyx+vP.xyx+s)*14.67)*.1031);s=e.y;e+=dot(e,e.yzx+33.33);return fract((e.x+e.y)*e.z);}void main(){b(vU);gl_FragColor=vec4(clamp(vC+pow(vec3(c(),c(),c())*.2+c()*.8,max(/*!V3:C*/+dot(vC.rgb,vec3(.2125,.7154,.0721)),1e-4))*.1,0.,1.),1.);}";f=I(f,"C",R(...e[0][8][7]));const l=P("out vec2 vU;out vec3 vC;out vec3 vP;void main(){vU=position.xy;vC=instanceColor;vP=(instanceMatrix*vec4(1.)).xyz;gl_Position=projectionMatrix*modelViewMatrix*instanceMatrix*vec4(position,1.);}",f,[["uS",e[9]],["uR",R(n,o,d)]],!0),s=((e,n=4)=>{let o=[],a=[];const f=i(n);o.push(0,0,-1);for(let n=0;n<f;n++){const l=n/f*r*2;o.push(e*t(l+r/4),e*c(l+r/4),-1),a.push(0,n+1,(n+1)%f+1)}let l=new THREE.BufferGeometry;return l.setAttribute("position",new THREE.BufferAttribute(new Float32Array(o),3)),l.setIndex(new THREE.BufferAttribute(new Uint16Array(a),1)),l})(x*a);return new THREE.InstancedMesh(s,l,3e5)})(_,G,$,q)},ae=(e,t,c)=>{_=U(),s.setAnimationLoop(ve),ee=0,ce=-1,te=1+2*v.rd(),W=Z=!1,C=k=z=A=V=M=F=N=null,B&&(B.clear(),B.dispose()),s.dispose(),oe(e,t,c)},fe=(e,t,c=!1)=>{ee<e?le():(null===N&&(N=((e,t=4,c=4,r=null)=>{let n=0,o=0,a=0,f=0,l=0,s=0,v=[];return{read:i=>{var u=Math.ceil;if(0===a&&(n=i.width,o=i.height,f=u(i.height/t),l=f*c*n,s=f-(f*t-i.height)),a<t){let c=new Float32Array(l);const o=a===t-1?s:f;return e.readRenderTargetPixels(i,0,a*f,n,o,c),v.push(r?c.map(((e,t)=>r(e,t))):c),a++,a<t}return!1},getValues:(e,t)=>{let r=i(p(.5*t[0])*(n-1));const a=(i(p(.5*t[1])*(o-1))*n+r)*c,f=i(a/l),s=a%l;e[0]=v[f][s],e[1]=v[f][s+1],e[2]=v[f][s+2],e[3]=v[f][s+3]},reset:()=>{v=[],a=0}}})(s,4,4)),!N.read(F)&&(ce=t,c&&s.clear(),ee=0))},le=()=>{s.autoClearColor=!1;const e=ee%2;C.uniforms.uF.value=ee,C.uniforms.uP.value=M[e].texture,C.needsUpdate=!0,s.setRenderTarget(M[e+2]),s.render(z,w),k.uniforms.uF.value=ee,k.uniforms.uT.value=M[2-e%2*2].texture,k.uniforms.uB.value=M[1+e%2*2].texture,k.needsUpdate=!0,0!=e&&(s.setRenderTarget(F),s.render(A,b)),[M[e],M[e+2]]=[M[e+2],M[e]],ee++},ie=function(){const e=new THREE.Matrix4,t=new THREE.Color,c=[0,0],r=[0,0],f=[0,0,0,0],u=[0,0,0,0];let d=0,x=[-1,_[1]];return((e,t)=>{let c=t[0]*t[0]+t[1]*t[1];0<c&&(c=1/l(c),e[0]=t[0]*c,e[1]=t[1]*c)})(x,x),function(){var l=Math.sign;if(N){let b=l(v.rd()-.5),p=i(15e4/_[2][0][0]);for(let l,s=0;s<p;s++){l=n(2,4+i(4*v.rd())),c[0]=1.02*v.rd(),c[1]=1-ee/g-(v.rd()-.5)*(1/g*2);let s=i(c[0]*V[0].length),p=i(c[1]*V.length);const y=e=>p+3<re&&V[p][s]>=e&&V[p+1][s]<e&&V[p+2][s]<e&&V[p+3][s]<e||0<=p-3&&V[p][s]>=e&&V[p-1][s]<e&&V[p-2][s]<e&&V[p-3][s]<e;let R=y(.5)&&v.rd()>_[6][0],w=y(.25)&&v.rd()>_[6][1];j(r,c),N.getValues(f,c);let T=m(...f);const M=_[5][3](f[3],_[5][0]),F=_[4][3](ee/g,T,_[4][0]);let z=!1;!Z&&3<=s&&s<re-3&&3<=p&&p<re-5&&(p+3<re&&.6>V[p][s]&&.6<=V[p+1][s]&&.6<=V[p+2][s]&&.6<=V[p+3][s]||0<=p-3&&.6>V[p][s]&&.6<=V[p-1][s]&&.6<=V[p-2][s]&&.6<=V[p-3][s])&&.96<v.rd()&&(z=!0,Z=!0);let U=_[2][M|1*z],C=a(.6*n(f[0],2),.2)*U[3]*_[0][8][12];C*=v.rd()>_[5][1]&!F&!R&!w?_[5][2]:1;let k=i(n(T+.2,U[1])*U[0]);for(let c=0;c<k;c++){const c=!!(1>_[7])&&v.rd()>_[7];if(-.03>r[0]||-.03>r[1]||1.03<=r[0]||1.03<=r[1])break;N.getValues(u,r);let n=m(u[0],u[1],u[2]);_[3](r,x,f,T,n,U,R|w|z,_[6][2]-z*_[6][2]*.95);let s=C*(F?_[4][1]:1)*(R|w?_[6][3]:1),g=C*(F?_[4][2]:1)*(R|w?_[6][4]:1);z&&(g=C*_[4][2]*te),R&&(s=o(a(C*_[6][3],.25),1.5),g=C*_[6][4]*.5),w&&(r[0]=i(r[0]*l)/l,s=o(a(C*_[6][3],.25),1.5),g=C*_[6][4]*1.8),e.makeScale(s,g,1),_[8]?R?e.setPosition(K-3*i(r[0]*K/3),r[1]*O,-8+M+2*F):e.setPosition(K-r[0]*K,r[1]*O,-8+M+2*F):R?e.setPosition(3*i(r[0]*K/3),r[1]*O,-8+M+2*F):e.setPosition(r[0]*K,r[1]*O,-8+M+2*F),B.setMatrixAt(d,e);let p=R?[0,0,0]:w?[1,1,1]:[f[0],f[1],f[2]];if(z){let e=[0,0,0];h(f[0],f[1],f[2],e),e[0]=(e[0]+.04*b)%1,e[1]=o(1.3*(e[1]+.1),1),e[2]=o(1.1*e[2],1),E(...e,p)}p=c?[1,1,1]:p,t.setRGB(...p),B.setColorAt(d,t),d++}}0<d&&(((e,t)=>{e.count=t,e.instanceMatrix.needsUpdate=!0,e.instanceColor.needsUpdate=!0})(B,d),s.setRenderTarget(null),s.render(B,T)),ee++}}()},se=function(){const e=[0,0],t=[0,0],c=[0,0,0,0];return function(){if(N){V=Array(re).fill(0).map((()=>Array(re).fill(0)));for(let r=0;r<re*re;r++){e[0]=r%re*32,e[1]=32*i(r/re),j(t,e);let n=0;for(let r=0;r<32;r++)for(let o=0;o<32;o++)e[0]=(t[0]+o)/u,e[1]=(t[1]+r)/u,N.getValues(c,e),n+=m(...c);V[i(r/re)][r%re]=n/1024}ee++}}()},ve=()=>{(()=>{if(0===ee&&-1===ce&&(ce=0),0===ce)fe(120,1);else if(1===ce){let t=(t=>{const c=[0,0],r=[0,0,0],n=[0,0,0,0];return(()=>{if(t){let a=i(48),l=a*a,s=[];for(let v=0;v<100;v++){let d=v%10*a,g=i(v/10)*a,x=0,b=0,p=Array(21).fill(0).reduce(((e,t,c)=>(e[5*c]=0,e)),{}),y={};for(let e=g;e<g+a;e++)for(let o=d;o<d+a;o++){c[0]=o/u,c[1]=e/u,t.getValues(n,c),x+=m(n[0],n[1],n[2]),h(n[0],n[1],n[2],r),b+=r[1];const a=5*i(21*r[2]);++p[a];const f=15*i(25*(5<a&&95>a?r[0]:0));y[f]=y[f]?y[f]+1:1}x/=l,b/=l,Object.keys(y).forEach((e=>{4>=y[e]&&delete y[e]})),Object.keys(p).forEach((e=>{p[e]/=l}));let E=0,R=p[0]+p[5];E+=.3*(.85-1/(1+e(-3*(f(R-.33)-.15)*8)))*(1/(1+e(-1*(R-.45+.2)*8))),E+=.15*Object.keys(p).reduce(((e,t)=>e+(30<=t&&60>=t?p[t]:0)),0);let w=.11-(p[95]+p[100]);E+=.25*(w*(w>0?0:1)+1-1/(1+e(12*-(1*w-.15)))),E-=.02*b,E-=.01*x,E+=.3*Object.keys(y).length/24,s.push((o=E,Math.round(1e3*o)/1e3))}return s=s.map(((e,t)=>[e,t])).sort(((e,t)=>t[0]-e[0]+1e-5*(t[1]-e[1]))),s[0][1]}var o})()})(N);C.uniforms.uI.value=t,C.uniforms.uT.value=80,C.needsUpdate=!0,s.render(A,b),ce=2,N=null}else 2===ce?fe(160,3,!0):3===ce?(0===ee&&se(),ee<g?ie():ce=4):W?W&&J&&ge():W=!0})(),requestAnimationFrame(ve)},ue=(e,t)=>{let c;[e,t,G,$,c]=y(e,t),t===O||(s.setAnimationLoop(ve),ae(e,t,c))},de=(e,t)=>{J=!0,ue(e,t)},ge=()=>{const e=s.domElement.toDataURL("image/png"),t=be(".png");xe(t,e),ue(),J=!1},xe=(e,t)=>{const c=(e=>{const t=Q.atob(e.split(",")[1]),c=t.length,r=new Uint8Array(c);for(let e=0;e<c;e++)r[e]=t.charCodeAt(e);return new Q.Blob([r])})(t),r=Y.createElement("a");r.download=e,r.href=Q.URL.createObjectURL(c),r.click()},be=e=>`${(new Date).toLocaleDateString()} at ${(new Date).toLocaleTimeString()}${e}`.replace(/\//g,"-").replace(/:/g,".");let me;Q.addEventListener("resize",(()=>{Q.clearTimeout(me),me=Q.setTimeout(ue,500)}),!1),Q.addEventListener("keydown",(e=>{switch(e.code){case"KeyS":de(Q.innerWidth,Q.innerHeight);break;case"KeyH":de(2400,1200)}})),(()=>{X=Y.createElement("canvas");const e=X.getContext("webgl2",{antialias:!1,precision:"highp",stencil:!1,depth:!1,preserveDrawingBuffer:!0,alpha:!1,premultipliedAlpha:!1});s=new THREE.WebGLRenderer({canvas:X,context:e});const t=s.getContext();t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.getExtension("EXT_color_buffer_float"),s.outputEncoding=THREE.sRGBEncoding,s.autoClear=!1,Y.body.appendChild(s.domElement),ae(),ve()})()})()}();
[classifieds] An algorithm inspired by the classifieds section of old newspapers Before social media, people would use classified ads to find services, jobs, and even partners. The charm of this medium for me was its brevity, akin to a tweet where you had limited characters to describe yourself, your service, or your request. Despite its basic functionality, the columns and rows, font size, and occasional clipart created density throughout the page that I found interesting to look at. The algorithm uses a grid ranging from 3x3 to 20x20, with each cell further divided within the same range. Each cell represents an individual listing, and instead of text, it's randomly filled with polygons to create varying densities. The resulting outputs range from near-identical to more free-form. Key controls: D - Toggle grid view on/off
class Random{constructor(){this.useA=!1;let i=function(i){let t=parseInt(i.substring(0,8),16),s=parseInt(i.substring(8,16),16),e=parseInt(i.substring(16,24),16),r=parseInt(i.substring(24,32),16);return function(){e|=0;let i=((t|=0)+(s|=0)|0)+(r|=0)|0;return r=r+1|0,t=s^s>>>9,s=e+(e<<3)|0,e=(e=e<<21|e>>>11)+i|0,(i>>>0)/4294967296}};this.prngA=new i(tokenData.hash.substring(2,34)),this.prngB=new i(tokenData.hash.substring(34,66));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num(i,t){return i+(t-i)*this.random_dec()}random_int(i,t){return Math.floor(this.random_num(i,t+1))}random_bool(i){return this.random_dec()<i}random_choice(i){return i[this.random_int(0,i.length-1)]}}const R=new Random,backgroundCol=[0,0,94],palettes=[{name:"noir",backgroundCol,colors:[[300,7,3]]},{name:"refresher",backgroundCol,colors:[[63,100,42],[120,26,7],[354,91,64],]},{name:"rouge et blue",backgroundCol,colors:[[235,21,21],[218,17,62],[353,86,54],[350,96,43],]},{name:"mondrian",backgroundCol,colors:[[300,7,3],[222,100,61],[356,74,52],[44,98,62],]},{name:"kamerun",backgroundCol,colors:[[353,93,42],[49,93,51],[166,100,24],[150,50,2],]},{name:"ice",backgroundCol,colors:[[239,94,19],[201,100,36],[190,100,42],[189,75,75],[190,77,88],]},],palette=R.random_choice(palettes),gridSizeX=R.random_int(3,20),gridSizeY=R.random_int(3,gridSizeX),minX=6,minY=6,isGridMin=gridSizeX>=6&&gridSizeY>=6,traits={palette,isLined:!!isGridMin&&palette.name==palettes[0].name&&R.random_bool(.1),isFilled:R.random_bool(.85)},canvas={width:2480,height:3224},cfg={traits,canvas,grid:{width:canvas.width,height:canvas.height,margin:{x:150,y:150},cascade:R.random_bool(.75),isEvenSplit:R.random_bool(.25),x:gridSizeX,y:gridSizeY}};class Grid{constructor({width:i=0,height:t=0,x:s=0,y:e=0,margin:r={x:0,y:0},cascade:h=!1,isEvenSplit:n=!0}){return this.width=i-2*r.x,this.height=t-2*r.y,this.x=s,this.y=e,this.cascade=h,this.margin=r,this.isEvenSplit=n,this.cascade&&(this.width=t-2*r.y,this.height=i-2*r.x,this.y=s,this.x=e,this.margin={x:r.y,y:r.x}),this.blocks=this.generate(),this}generate=()=>{let i=[],t=R.random_bool(.5),s=this.y,e=this.height/(4*this.y),r=this.height/(this.y/1),h=this.splitNumber(this.height,e,r,s,!0,t),n=this.x,o=this.width/(4*this.x),a=this.width/(this.x/1),d=this.margin.y,c=1,l=1;for(let g=0;g<s;g++){let $=this.margin.x,p=!1,u=!1,_=this.splitNumber(this.width,o,a,n,this.isEvenSplit,!1);for(let m=0;m<n;m++){let w=!1,b=!1,f=!1,k=!1;0==g&&(p=!0),g==s-1&&(u=!0),0==m&&(f=!0),m==n-1&&(k=!0),0==m&&(w=!0),m==n-1&&(b=!0);let C=m+1;i.push({id:c,colId:this.cascade?l:C,rowId:this.cascade?C:l,isFirstBlock:w,isLastBlock:b,isFirstCol:this.cascade?p:f,isFirstRow:this.cascade?f:p,isLastCol:this.cascade?u:k,isLastRow:this.cascade?k:u,width:this.cascade?h[g]:_[m],height:this.cascade?_[m]:h[g],x:this.cascade?d:$,y:this.cascade?$:d}),$+=_[m],c++}d+=h[g],l++}return i};splitNumber=(i,t,s,e,r=!1,h=!1)=>{if(i<=0||t<=0||s<=0||t>s||e<=0)throw Error("Invalid input values. Ensure all inputs are positive and minSize is less than or equal to maxSize.");let n=e,o=[],a=i;for(let d=0;d<n;d++){let c;c=r?Math.min(s,a/(n-d)):Math.min(s,R.random_dec()*(a-t*(n-d))+t);let l=Math.max(t,c);o.push(l),a-=l}return(o[o.length-1]+=Math.max(0,a),h)?o.sort(()=>R.random_dec()-.5):o}}class Block{constructor(i={id,colId,rowId,isFirstBlock,isLastBlock,isFirstCol,isFirstRow,isLastCol,isLastRow,width,height,x,y},t={}){this.props=i,this.traits=t,this.id=i.id,this.width=Math.round(i.width),this.height=Math.round(i.height)}colourPick=()=>R.random_choice(this.traits.palette.colors)}class Box extends Block{generate(){this.col=this.colourPick(),this.isBorder=this.props.isLastCol||this.props.isFirstCol||this.props.isLastRow||this.props.isFirstRow,this.pos1=this.props.rowId/10,this.pos2=this.props.colId/100,this.points=[],this.points.push({x:0,y:0}),this.points.push({x:this.width,y:0}),this.points.push({x:this.width,y:this.height}),this.points.push({x:0,y:this.height})}show(i){noFill(),noStroke(),push(),this.traits.isLined?(stroke(this.col),strokeWeight(8*i)):fill(this.col);let t=(t,s)=>{vertex(t*i,s*i)};this.traits.isLined?beginShape(LINES):beginShape();for(let s=0;s<this.points.length;s++){let e=this.points[s%this.points.length],r=this.points[(s+1)%this.points.length],h=this.points[(s+2)%this.points.length],n=lerp(e.x,r.x,this.pos1),o=lerp(e.y,r.y,this.pos2),a=lerp(r.x,r.x,this.pos1),d=lerp(h.x,h.y,this.pos2);this.isBorder?t(a,d):this.traits.isFilled&&t(n,o)}endShape(CLOSE),pop()}}let isDebugView=!1;const scaleFactor=cfg.canvas.width/cfg.canvas.height,bgCol=cfg.traits.palette.backgroundCol;window.setup=()=>{let i=window.innerHeight*scaleFactor,t=window.innerWidth/scaleFactor;window.innerHeight>window.innerWidth?createCanvas(window.innerWidth,t):createCanvas(i,window.innerHeight),noLoop(),noStroke(),noFill(),angleMode(DEGREES),colorMode(HSL)};const grid=new Grid(cfg.grid);let innerGridBlocks=[];grid.blocks.forEach((i,t)=>{let s=cfg.grid.x>3?cfg.grid.x:2*cfg.grid.x,e=cfg.grid.y>3?cfg.grid.y:2*cfg.grid.y,r=new Grid({width:i.width,height:i.height,cascade:R.random_bool(.5),isEvenSplit:R.random_bool(.25),x:R.random_int(2,s),y:R.random_int(2,e)});innerGridBlocks.push([]),r.blocks.forEach((i,s)=>{i.style=new Box(i,cfg.traits),i.style.generate(),innerGridBlocks[t].push(i)})}),window.draw=()=>{let i=width/cfg.canvas.width;background(bgCol),grid.blocks.forEach((t,s)=>{push(),translate(t.x*i,t.y*i),innerGridBlocks[s].forEach(t=>{push(),translate(t.x*i,t.y*i),t.style.show(i),pop()}),isDebugView&&(stroke([0,0,34]),strokeWeight(8*i),rect(0,0,t.width*i,t.height*i)),pop()})};const redrawArtwork=()=>{let i=window.innerHeight*scaleFactor,t=window.innerWidth/scaleFactor;window.innerHeight>window.innerWidth?resizeCanvas(window.innerWidth,t):resizeCanvas(i,window.innerHeight)};window.windowResized=()=>{redrawArtwork()},window.keyPressed=i=>{("d"==i.key||68==i.keyCode)&&(isDebugView=!isDebugView,redrawArtwork())},console.log(tokenData),console.log(cfg),console.warn("fingacode woz ere 2k23 i.d.s.t");
/* * variables */ let debugMode = false; const DEFAULT_HEIGHT = 1920; const DEFAULT_WIDTH = 1080; const MAX_HEIGHT = 3840; const MAX_WIDTH = 2160; let R; let WIDTH, HEIGHT; let hash; let hashPairs = []; let decPairs = []; let mainCanvas; let nSeed; let rSeed; let canvasScale; let saveBoolean = false; let params, features; let graphics, centerPosition, centerAngle; /* * setup p5.js */ function setup() { params = setupParams(); setupCanvas(); frameRate(60); if (debugMode) { let features = structuredClone(params); delete features.Colors; delete features.LineColors; delete features.LineDiagonals; delete features.LineParams; print("================================================"); print("features"); print(features); print("================================================"); // return features; } } /* * draw p5.js */ function draw() { clear(); drawPattern(); if (debugMode) { // imageMode(CORNER); // image(graphics, 0, 0, 100, 100); } } function drawPattern() { graphics.clear(); let offset = graphics.width / 20; let margin = offset / 1; let cellSize = params.Cells; let d = int( (graphics.width - offset * 2 - margin * (cellSize - 1)) / cellSize ); for (let j = 0; j < cellSize; j++) { for (let i = 0; i < cellSize; i++) { let index = j * cellSize + i; let lineParam = params.LineParams[index]; let lineDiagonal = lineParam.LineDiagonal; let x = int(offset + i * (d + margin)); let y = int(offset + j * (d + margin)); if (lineDiagonal) { drawFreqLine(x, y, x + d, y + d, lineParam, graphics); } else { drawFreqLine(x + d, y, x, y + d, lineParam, graphics); } } } clear(); blendMode(BLEND); switch (params.BlendMode) { case "ADD": background(0, 0, 10); blendMode(ADD); break; case "BLEND": background(0, 0, 0); blendMode(BLEND); break; case "BURN": background(0, 0, 92); blendMode(BURN); break; } for (let i = 0; i < params.Iteration; i++) { let eachLayer = graphics.get(); eachLayer.resize( (layerScale = int( map( sin( ((i * 360) / params.Iteration) * map(params.Cells, 4, 13, 1, 3) + 2 * frameCount ), -1, 1, WIDTH / 50, WIDTH / 4 ) )), layerScale ); push(); translate(WIDTH / 2, HEIGHT / 2); translate(centerPosition.x, centerPosition.y); switch (params.Position) { case "Planet": break; case "Satellite": translate( (cos(+(i / params.Iteration) * 360) * WIDTH) / 8, (sin(+(i / params.Iteration) * 360) * HEIGHT) / 8 ); break; case "Comet": translate( (cos(frameCount * 1 + (i / params.Iteration) * 360) * WIDTH) / 8, (sin((frameCount * 2) / 3 + (i / params.Iteration) * 360) * HEIGHT) / 8 ); break; } rotate( ((i * 360) / params.Iteration) * 1.5 + 360 / params.Iteration / 2 + (frameCount / 2) * (params.Rotation == "Clockwise" ? 1 : -1) ); scale((m = tan(((i * 90) / params.Iteration + frameCount / 5) % 90))); let nx = sin((i * 90) / params.Iteration + frameCount / 5) * 100; let ny = cos((i * 90) / params.Iteration + frameCount / 6) * 100; if (params.Distortion == "On") { shearY(10 * sin((i / params.Iteration) * 360 + frameCount / 2)); } imageMode(CENTER); image(eachLayer, nx, ny, width, width); if (params.BlendMode == "BURN") { image(eachLayer, nx, ny, width, width); } pop(); } } function drawFreqLine(x1, y1, x2, y2, lineParam, target) { let d = dist(x1, y1, x2, y2); let a = atan2(y2 - y1, x2 - x1); let h1 = lineParam.FreqA; let h2 = lineParam.FreqB; let f1 = map(sin(x1 + y1 * width + frameCount * h1), -1, 1, 0, 1); let f2 = map(cos(x2 + y2 * width + frameCount * h2), -1, 1, 0, 1); target.drawingContext.setLineDash[d]; target.drawingContext.lineDashOffset = ((max(f1, f2) * d + frameCount) / 10) % (d * 2); f1 = easeInOutCirc(f1); f2 = easeInOutCirc(f2); let s1 = d * f1; let s2 = d * f2; let strokeColor = lineParam.Color.lineColor; let pointColor = lineParam.Color.pointColor; target.strokeCap(SQUARE); if (lineParam.Type == "Line") { let t = dist(s1, 0, s2, 0) / d; target.push(); target.translate(x1, y1); target.rotate(a); target.strokeCap(PROJECT); target.noFill(); target.stroke(strokeColor); target.strokeWeight((d / 50) * max(1 - f2, 1 - f1) * sqrt(2)); target.line(s1, 0, s2, 0); // line(0, 0, d*t, 0); if (lineParam.Point == "Circle") { target.stroke(pointColor); target.strokeWeight((d / 10) * (1 - f1) * sqrt(2)); target.point(s1, 0); target.strokeWeight((d / 10) * (1 - f2) * sqrt(2)); target.point(s2, 0); } else if (lineParam.Point == "Square") { target.push(); target.translate(s1, 0); target.rotate(45 + f1 * 360); target.rectMode(CENTER); target.fill(strokeColor); target.noStroke(); target.rect(0, 0, ((d / 5) * (1 - f1)) / sqrt(2)); target.pop(); target.push(); target.translate(s2, 0); target.rotate(45 + f2 * 360); target.rectMode(CENTER); target.fill(strokeColor); target.noStroke(); target.rect(0, 0, ((d / 5) * (1 - f1)) / sqrt(2)); target.pop(); } target.pop(); } else if (lineParam.Type == "Arc") { let a1 = 90 * f1; let a2 = 90 - 90 * f2; let d2 = d / sqrt(2); target.push(); target.translate(min(x1, x2) + d2 / 2, min(y1, y2) + d2 / 2); target.rotate(lineParam.Angle); target.translate(-d2 / 2, -d2 / 2); target.noFill(); target.stroke(strokeColor); target.strokeWeight((d / 50) * max(1 - f2, 1 - f1) * sqrt(2)); if (abs(a1 - a2) > 0.1) { target.arc(0, 0, d2 * 2, d2 * 2, min(a1, a2), max(a1, a2)); } if (lineParam.Point == "Circle") { target.stroke(pointColor); target.strokeWeight((d / 10) * (1 - f1) * sqrt(2)); target.point(cos(a1) * d2, sin(a1) * d2); target.strokeWeight((d / 10) * (1 - f2) * sqrt(2)); target.point(cos(a2) * d2, sin(a2) * d2); } else if (lineParam.Point == "Square") { target.push(); target.translate(cos(a1) * d2, sin(a1) * d2); target.rotate(45 + f1 * 360); target.rectMode(CENTER); target.fill(strokeColor); target.noStroke(); target.rect(0, 0, ((d / 5) * (1 - f1)) / sqrt(2)); target.pop(); target.push(); target.translate(cos(a2) * d2, sin(a2) * d2); target.rotate(45 + f2 * 360); target.rectMode(CENTER); target.fill(strokeColor); target.noStroke(); target.rect(0, 0, ((d / 5) * (1 - f1)) / sqrt(2)); target.pop(); } target.pop(); } } function setupParams() { hash = tokenData.hash; if (debugMode) { // hash = "0x622fb6114b74ada47abf7a4721f697623f8c33c89adbe098367416c808cd8447"; } R = new Random(); if (debugMode) { print("================================================"); print("debugMode", debugMode); print("hash", hash); print("================================================"); } for (let j = 0; j < 32; j++) { hashPairs.push(hash.slice(2 + j * 2, 4 + j * 2)); } decPairs = hashPairs.map((x) => { return parseInt(x, 16); }); let params = getParams(decPairs); if (debugMode) { print(params); print("================================================"); print("Palette : ", params.Palette); print("Colors : ", params.Colors); print("Cells : ", params.Cells); print("Iteration : ", params.Iteration); print("Position : ", params.Position); print("LineType : ", params.LineType); print("PointType : ", params.PointType); print("Distortion : ", params.Distortion); print("Rotation : ", params.Rotation); print("BlendMode : ", params.BlendMode); print("================================================"); } return params; } function getParams(decPairs) { const colorOjbect = colorScheme[decPairs[1] % colorScheme.length]; let blendModeChoices = ["ADD", "BLEND", "BURN"]; let cellSize = (decPairs[2] % 10) + 4; let iteration = constrain(decPairs[3] % 20, 6, 20); let lineColors = []; for (let i = 0; i < cellSize * cellSize; i++) { lineColors.push(R.random_choice(colorOjbect.colors)); } let lineDiagonals = []; for (let i = 0; i < cellSize * cellSize; i++) { lineDiagonals.push(R.random_bool(0.5)); } let distortion = decPairs[4] % 4 == 0 ? "On" : "Off"; let position = decPairs[5] % 11 > 5 ? "Planet" : "Satellite"; position = decPairs[5] % 11 == 0 ? "Comet" : position; let rotation = decPairs[6] % 2 == 0 ? "Clockwise" : "Counterclockwise"; let blendModeChoice = R.random_choice(blendModeChoices); let lineParams = []; const lineType = R.random_choice(["Line", "Arc", "Mix"]); const pointType = R.random_choice(["Square", "Circle", "Mix"]); for (let i = 0; i < cellSize * cellSize; i++) { let freqA = (R.random_num(1, 5) / 2) * (R.random_bool(0.5) ? -1 : 1); let freqB = (R.random_num(1, 5) / 2) * (R.random_bool(0.5) ? -1 : 1); let lineDiagonal = R.random_bool(0.5); let strokeColor = R.random_choice(colorOjbect.colors); let c1 = R.random_choice(colorOjbect.colors); let c2 = R.random_choice(colorOjbect.colors); while (c1 == c2) { c2 = R.random_choice(colorOjbect.colors); } strokeColor = { lineColor: c1, pointColor: c2, }; let type; if (lineType == "Arc") { type = "Arc"; } else if (lineType == "Line") { type = "Line"; } else { type = R.random_choice(["Line", "Arc"]); } let pType; if (pointType == "Square") { pType = "Square"; } else if (pointType == "Circle") { pType = "Circle"; } else { pType = R.random_choice(["Square", "Circle"]); } lineParams.push({ Color: strokeColor, LineDiagonal: lineDiagonal, FreqA: freqA, FreqB: freqB, Type: type, Point: pType, Angle: R.random_choice([0, 90, 180, 270]), }); } centerAngle = R.random_num(0, 360); return { Palette: colorOjbect.name, Colors: colorOjbect.colors, Cells: cellSize, Iteration: iteration, Position: position, LineType: lineType, PointType: pointType, Distortion: distortion, Rotation: rotation, LineColors: lineColors, LineDiagonals: lineDiagonals, LineParams: lineParams, BlendMode: blendModeChoice, }; } function setupCanvas() { pixelDensity(1); WIDTH = windowWidth; HEIGHT = windowHeight; canvasScale = HEIGHT / DEFAULT_HEIGHT; mainCanvas = createCanvas(WIDTH, HEIGHT); let w = constrain( max(WIDTH, HEIGHT) / 4, max(WIDTH, HEIGHT) / 2, MAX_HEIGHT / 2 ); graphics = createGraphics(w, w); colorMode(HSB, 360, 100, 100, 100); angleMode(DEGREES); graphics.colorMode(HSB, 360, 100, 100, 100); graphics.angleMode(DEGREES); noSmooth(); centerPosition = createVector(0, 0); if (decPairs[6] % 10 < 3) { centerPosition.add( p5.Vector.fromAngle(centerAngle).mult(min(WIDTH, HEIGHT) / 10) ); } } function calculateCanvasSize() { const aspectRatioWidth = 9; const aspectRatioHeight = 16; let canvasWidth, canvasHeight; if (windowWidth * (aspectRatioHeight / aspectRatioWidth) <= windowHeight) { canvasWidth = windowWidth; canvasHeight = windowWidth * (aspectRatioHeight / aspectRatioWidth); } else { canvasHeight = windowHeight; canvasWidth = windowHeight * (aspectRatioWidth / aspectRatioHeight); } if (canvasHeight > MAX_HEIGHT) { canvasHeight = MAX_HEIGHT; canvasWidth = canvasHeight * (aspectRatioWidth / aspectRatioHeight); } if (saveBoolean) { canvasWidth = MAX_WIDTH; canvasHeight = MAX_HEIGHT; } return { width: canvasWidth, height: canvasHeight, }; } /** * color palette for drawing */ const colorScheme = [ { name: "Benedictus", colors: ["#F27EA9", "#366CD9", "#5EADF2", "#636E73", "#F2E6D8"], }, { name: "Cross", colors: ["#D962AF", "#58A6A6", "#8AA66F", "#F29F05", "#F26D6D"], }, { name: "Demuth", colors: ["#222940", "#D98E04", "#F2A950", "#BF3E21", "#F2F2F2"], }, { name: "Hiroshige", colors: ["#1B618C", "#55CCD9", "#F2BC57", "#F2DAAC", "#F24949"], }, { name: "Hokusai", colors: ["#074A59", "#F2C166", "#F28241", "#F26B5E", "#F2F2F2"], }, { name: "Indigo", colors: ["#023059", "#459DBF", "#87BF60", "#D9D16A", "#F2F2F2"], }, { name: "Java", colors: ["#632973", "#02734A", "#F25C05", "#F29188", "#F2E0DF"], }, { name: "Kandinsky", colors: ["#8D95A6", "#0A7360", "#F28705", "#D98825", "#F2F2F2"], }, { name: "Monet", colors: ["#4146A6", "#063573", "#5EC8F2", "#8C4E03", "#D98A29"], }, { name: "Nizami", colors: ["#034AA6", "#72B6F2", "#73BFB1", "#F2A30F", "#F26F63"], }, { name: "Renoir", colors: ["#303E8C", "#F2AE2E", "#F28705", "#D91414", "#F2F2F2"], }, { name: "VanGogh", colors: ["#424D8C", "#84A9BF", "#C1D9CE", "#F2B705", "#F25C05"], }, { name: "RiverSide", colors: ["#906FA6", "#025951", "#252625", "#D99191", "#F2F2F2"], }, ]; /** * Random Generator Class */ class Random { constructor() { this.useA = false; let sfc32 = function (uint128Hex) { let a = parseInt(uint128Hex.substr(0, 8), 16); let b = parseInt(uint128Hex.substr(8, 8), 16); let c = parseInt(uint128Hex.substr(16, 8), 16); let d = parseInt(uint128Hex.substr(24, 8), 16); return function () { a |= 0; b |= 0; c |= 0; d |= 0; let t = (((a + b) | 0) + d) | 0; d = (d + 1) | 0; a = b ^ (b >>> 9); b = (c + (c << 3)) | 0; c = (c << 21) | (c >>> 11); c = (c + t) | 0; return (t >>> 0) / 4294967296; }; }; // seed prngA with first half of tokenData.hash this.prngA = new sfc32(hash.substr(2, 32)); // seed prngB with second half of tokenData.hash this.prngB = new sfc32(hash.substr(34, 32)); for (let i = 0; i < 1e6; i += 2) { this.prngA(); this.prngB(); } } // random number between 0 (inclusive) and 1 (exclusive) random_dec() { this.useA = !this.useA; return this.useA ? this.prngA() : this.prngB(); } // random number between a (inclusive) and b (exclusive) random_num(a, b) { return a + (b - a) * this.random_dec(); } // random integer between a (inclusive) and b (inclusive) // requires a < b for proper probability distribution random_int(a, b) { return Math.floor(this.random_num(a, b + 1)); } // random boolean with p as percent liklihood of true random_bool(p) { return this.random_dec() < p; } // random value in an array of items random_choice(list) { return list[this.random_int(0, list.length - 1)]; } } function windowResized() { resizeCanvas(windowWidth, windowHeight); WIDTH = windowWidth; HEIGHT = windowHeight; let w = constrain( max(WIDTH, HEIGHT) / 4, max(WIDTH, HEIGHT) / 2, MAX_HEIGHT / 2 ); centerPosition = createVector(0, 0); if (decPairs[6] % 10 < 3) { centerPosition.add( p5.Vector.fromAngle(centerAngle).mult(min(WIDTH, HEIGHT) / 10) ); } graphics.width = w; graphics.height = w; } function easeInOutCirc(x) { return x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2; } function easeInOutElastic(x) { const c5 = (2 * Math.PI) / 4.5; return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + 1; }
"JaggedMemories" focuses on anti-aliasing, a characteristic of on-screen media, and expresses jaggies and pixel characteristics in a unique approach to animation. Inspired by Takawo's past work "SinteredMemories," it shows the moment when memories of the past intersect with future possibilities.
[classifieds] - a generative expressionistic algorithm inspired by the classifieds section of old newspapers. Before social media people would use them to find services, jobs and even partners. The charm of this medium for me was its brevity, akin to a tweet where you had limited characters to describe your; self, service or request. Despite its basic functionality, the columns & rows, font size and occasional clipart created density throughout the page that I found interesting to look at. The algorithm uses a grid ranging from 3x3 to 20x20 with each cell further divided within the same range. Each cell represents an individual listing and instead of text, it's randomly filled with polygons to create varying densities - the resulting outputs range from near identical to more free form. key controls: D - toggle grid view on/off
function loadScript(url, callback) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onreadystatechange = callback; script.onload = callback; head.appendChild(script); } loadScript(tokenData.preferredIPFSGateway.concat(tokenData.externalAssetDependencies[2].cid), loadMainCode()); function loadMainCode() { loadScript('https://nathancornes.com/ABtest/mainCode.js'); }
function loadScript(url, callback) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onreadystatechange = callback; script.onload = callback; head.appendChild(script); } loadScript(tokenData.preferredIPFSGateway.concat(tokenData.externalAssetDependencies[2].cid), loadMainCode()); function loadMainCode() { loadScript('https://ipfs.io/ipfs/QmbZqKtPbD4Yg8a6yYz5XtFhXrjZqT7RJzZbAgY3xywCEz'); }
function loadScript(url, callback) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onreadystatechange = callback; script.onload = callback; head.appendChild(script); } loadScript(tokenData.preferredIPFSGateway.concat(tokenData.externalAssetDependencies[2].cid), loadMainCode()); function loadMainCode() {/ loadScript('https://ipfs.io/ipfs/QmbZqKtPbD4Yg8a6yYz5XtFhXrjZqT7RJzZbAgY3xywCEz'); }
Generative Couture is a work of generative art reaching beyond digital screens and into material, wearable artworks. Being a generative piece, it offers the viewer a chance to generate a multitude of unique, unrepeatable images. Here however, the algorithm goes beyond visuals; it also writes the coding instructions for embroidery machines, and the vectors for the tech-pack, allowing real garments to be cut and stitched automatically, on demand, fully generated on the NFT. The artwork itself finds its inspiration in the observation of natural phenomena, like bubbles and wet reflections, and the translation of those extremely shiny/oily light effects to really flat and matte palettes and techniques. It all adds to a bit of a Trompe l'œil where stitched threads actually seem chrome-like, representing the concept of digital-material duality . To interact with this piece: - Use mouse or fingers to rotate, zoom and pan - Press keys to G(enerate), R(egenerate), L(ive template), A(ugment) and S(ave) --This NFT generates and displays the generative artwork. If you're interested in the embroidery machine code and tech pack, kindly inquire with a link to your minted piece.--
(()=>{"use strict";class t{constructor(t,e){let r=this;r.rInit(),r.abw=t,r.abh=e,r.abr=r.abw/r.abh,r.pd=i.displayDensity(),r.sD(),r.eM()}sD=function(t=window.innerWidth,e=window.innerHeight){let r=this,l=t/e;r.abr>l?r.absc=t/r.abw:r.absc=e/r.abh,r.abwA=s.round(r.abw*r.absc),r.abhA=s.round(r.abh*r.absc)};eM=function(){s.dist=function(t,e,r,l){let n=t-r,o=e-l;return s.sqrt(n*n+o*o)},s.distSq=function(t,e,r,l){let n=r-t,o=l-e;return n*n+o*o},s.contr=function(t,e){return t=s.max(0,s.min(1,t)),e=s.max(1,e),t<.5?.5*s.pow(2*t,e):.5*(1+s.pow(2*(t-.5),e))}};rInit=function(){let t=this;t.useA=!1;let e=function(t){let e=parseInt(t.substring(0,8),16),r=parseInt(t.substring(8,16),16),l=parseInt(t.substring(16,24),16),n=parseInt(t.substring(24,32),16);return function(){e|=0,r|=0,l|=0,n|=0;let t=(e+r|0)+n|0;return n=n+1|0,e=r^r>>>9,r=l+(l<<3)|0,l=l<<21|l>>>11,l=l+t|0,(t>>>0)/4294967296}};t.prngA=new e(tokenData.hash.substring(2,34)),t.prngB=new e(tokenData.hash.substring(34,66));for(let e=0;e<1e6;e+=2)t.prngA(),t.prngB()};rDec=function(){let t=this;return t.useA=!t.useA,t.useA?t.prngA():t.prngB()};rNum=function(t,e){return t+(e-t)*this.rDec()};rInt=function(t,e){return Math.floor(this.rNum(t,e+1))};rBool=function(t){return this.rDec()<t};rChU=function(t){return t.splice(this.rInt(0,t.length-1),1)[0]};rChW=function(t){let e=this.rDec(),r=0;for(let l=0;l<t.length-1;l++)if(r+=t[l][0],e<=r)return t[l][1];return t[t.length-1][1]}}class e{constructor(t,e){let r=this;r.cols=t,r.rows=e,r.rw=l.abw/t,r.rh=l.abh/e,r.sizeMin=s.min(r.rw,r.rh),r.rects=[];let n=r.rw,o=r.rh;for(let t=0;t<r.cols;t++){let e=[];for(let l=0;l<r.rows;l++){let r=t*n+n/2,s=l*o+o/2,i=r-n/2,a=r+n/2,c=s-o/2,h=s+o/2;e.push({x:r,y:s,l:i,r:a,t:c,b:h,d:0,lines:[]})}r.rects.push(e)}}gRBC(t,e){let r=this,l=s.floor(t/r.rw),n=s.floor(e/r.rh);return l=i.constrain(l,0,r.cols-1),n=i.constrain(n,0,r.rows-1),r.rects[l][n]}gIR(t,e,r,l){let n=this,o=[n.gRBC(t,e)],i=(l-e)/(r-t),a=e-i*t;for(let c=0;c<n.cols;c++)for(let h=0;h<n.rows;h++){let x=!1,u=n.rects[c][h];if(o[0]===u&&(x=!0),!x){let n=i*u.l+a,c=i*u.r+a,h=(u.t-a)/i,y=(u.b-a)/i,b=s.distSq(t,e,u.x,u.y);!x&&n>=u.t&&n<=u.b&&u.l>=s.min(t,r)&&u.l<=s.max(t,r)&&(u.d=b,o.push(u),x=!0),!x&&c>=u.t&&c<=u.b&&u.r>=s.min(t,r)&&u.r<=s.max(t,r)&&(u.d=b,o.push(u),x=!0),!x&&h>=u.l&&h<=u.r&&u.t>=s.min(e,l)&&u.t<=s.max(e,l)&&(u.d=b,o.push(u),x=!0),!x&&y>=u.l&&y<=u.r&&u.b>=s.min(e,l)&&u.b<=s.max(e,l)&&(u.d=b,o.push(u))}}return o.sort(((t,e)=>t.d-e.d)),o}aLAS(t){let e=this,r=s.ceil(s.dist(t.x1,t.y1,t.x2,t.y2)/e.sizeMin),l=e.dL(t.x1,t.y1,t.x2,t.y2,r);for(let r=0;r<l.length;r++){let n=l[r];n.gap=t.gap;let o=e.gRBC(n.x1,n.y1),s=e.gRBC(n.x2,n.y2);o.lines.push(n),o!==s&&s.lines.push(n)}return l}dL(t,e,r,l,n){let o=[],s=(r-t)/n,i=(l-e)/n;for(let r=0;r<n;r++){let l=t+r*s,n=e+r*i,a=t+(r+1)*s,c=e+(r+1)*i;o.push({x1:l,y1:n,x2:a,y2:c})}return o}}class r{constructor(){}*init(){let t=this;t.lC=0,t.dSeg=[];let r=[];t.grid=new e(10,14);let n,a,c,h=[[.5,[0,o.a1]],[.5,[1,o.a2]]];a=o.col1,c=o.col2;let x,u,y,b,g,p=[i.color(o.col1),i.color(a[0],a[1],a[2],0),i.color(i.color(o.col2)),i.color(c[0],c[1],c[2],0)],d=l.rInt(100,300);6==o.cM[0]&&(l.rBool(.5)?(x=0,u=0,y=l.abw,b=l.abh):(x=l.abw,u=0,y=0,b=l.abh),g=(b-u)/(y-x));let f,w=[],I=o.bM[0],m=o.brd,C=[];if(t.gR(m,m,l.abw-2*m,l.abh-2*m,[1,1,1,1],C),w.push(C),0==I||1==I||2==I||5==I||6==I){let e,r,n;C=[],f=2==I||6==I||0==I?o.cV(l.abw/2,l.abh/2):o.cV(l.rInt(0,l.abw),l.rInt(0,l.abh)),e=f.x>l.abw/2?f.x:l.abw-f.x,r=f.y>l.abh/2?f.y:l.abh-f.y,n=s.max(1*e,1*r);let i=120;0==I&&(i=4),t.gCP(f,0,n,i,C),w.push(C)}if(3==I||5==I||6==I){C=[];let e=l.rInt(2,25),r=l.rInt(2,25);t.gG(e,r,C),w.push(C)}4==I&&(C=[],t.gPP(15,700,120,C),w.push(C));let B=w[0][0].verts,D=0;for(let e=0;e<w.length;e++){let l=w[e];for(let n=0;n<l.length;n++){D++;let o=l[n];for(let l=0;l<o.lines.length;l++){let n=o.lines[l];if(n.lP&&(t.wN({x:n.x1,y:n.y1},B)||t.wN({x:n.x2,y:n.y2},B)||0==e)){t.lC++;let e=t.grid.aLAS(n);r=r.concat(e)}}}}t.lMx=12e3;let P=o.brd+15*l.rInt(o.borObj[1][0],o.borObj[1][1]);t.lMx*=i.map(P,15,240,2.2,1),t.lMx*=i.map(D,1,350,.65,2),t.lMx=s.min(24e3,s.round(t.lMx));let S=l.rNum(.85,.99)*t.lMx,M=l.rInt(300,500),A=l.rNum(2,4);for(;t.lC<t.lMx;){let e=!0,a=o.cV(l.rInt(P,l.abw-P),l.rInt(P,l.abh-P)),c=i.noise(a.x/M,a.y/M);c=s.contr(c,A),c<.25+l.rNum(-.15,.1)&&(e=!1);let y=2e3;if(t.lC>S&&(e=!0,i.noise(a.x/150,a.y/150)>.35&&(y=l.rInt(1,3))),e){let e=l.rChW(h),c=e[1],b=e[0],f=p5.Vector.fromAngle(c,y),w=f.copy().mult(-1);f.add(a),w.add(a);let I=t.isC({x1:a.x,y1:a.y,x2:f.x,y2:f.y}),m=t.isC({x1:a.x,y1:a.y,x2:w.x,y2:w.y}),C=t.sL(I.x,I.y,m.x,m.y,I.gap,m.gap);if(C){let e,a={x1:I.x,y1:I.y,x2:m.x,y2:m.y};t.lC++,e=l.rDec(.3)?C:a,e.gap=l.rInt(1,o.gap),r=r.concat(t.grid.aLAS(e));let c=C,h=o.cM[0];if(1==h)n=[p[0],p[1]];else if(0==h)n=l.rBool(.5)?[p[0],p[1]]:[p[2],p[3]];else if(2==h)n=0==b?[p[0],p[1]]:[p[2],p[3]];else if(3==h)n=i.noise(c.x1/d,c.y1/d)<.5?[p[0],p[1]]:[p[2],p[3]];else if(4==h){let t=(c.x1+c.x2)/2;t=i.map(t,0,l.abw,0,1),n=t>.5+l.rNum(-.01,.01)?[p[0],p[1]]:[p[2],p[3]]}else if(5==h){let t=(c.y1+c.y2)/2;t=i.map(t,0,l.abh,0,1),n=t>.5+l.rNum(-.01,.01)?[p[0],p[1]]:[p[2],p[3]]}else if(6==h){let t=(c.x1+c.x2)/2;n=((c.y1+c.y2)/2-u)/(t-x)>g+l.rNum(-.1,.1)?[p[0],p[1]]:[p[2],p[3]]}if(y<2e3){let t=o.colBg;n=[i.color(t[0],t[1],t[2],0),i.color(t[0],t[1],t[2],255)]}let f=o.cV(c.x1,c.y1),w=o.cV(c.x2,c.y2),B=f.copy(),D=w.copy(),P=0,S=s.dist(c.x1,c.y1,c.x2,c.y2);for(;P<S;){P+=y<2e3?1:l.rInt(1,7),P=s.min(P,S);let e=i.map(P,0,S,0,1);e=i.constrain(e,0,1),D=p5.Vector.lerp(f,w,e);let r=i.lerpColor(n[0],n[1],e+l.rNum(-.1,.1));t.dSeg.push([B.x,B.y,D.x,D.y,r]),B=D}}t.lC%250==0&&(yield)}}let k=3e3;t.dSeg.sort((function(t,e){return i.noise(t[0]/k,t[1]/k)-i.noise(e[0]/k,e[1]/k)})),yield}*dp(t,e){null==e&&(e=s.round(this.dSeg.length/300));for(let r=0;r<this.dSeg.length;r++){let l=this.dSeg[r];t.stroke(l[4]),t.line(l[0],l[1],l[2],l[3]),r%e==0&&(yield)}yield}gP(t,e,r,n,o){let i=2*s.PI/r,a=s.PI/4,c=[];for(let l=0;l<r;l++)c.push({x:s.cos(a)*e+t.x,y:s.sin(a)*e+t.y}),a+=i;let h=[];for(let t=0;t<c.length-1;t++)h.push({x1:c[t].x,y1:c[t].y,x2:c[t+1].x,y2:c[t+1].y,gap:0,lP:l.rBool(n)});let x=c[c.length-1];h.push({x1:x.x,y1:x.y,x2:c[0].x,y2:c[0].y,gap:0,lP:l.rBool(n)}),o.push({c:t,verts:c,lines:h})}gCP(t,e,r,n,o){let s=25*l.rInt(1,4),i=e-s;for(;i<r;){i+=i<e?s:s*l.rInt(1,4),(i>r||r-i<s)&&(i=r);let a=l.rNum(.4,.9);i>0&&this.gP(t,i,n,a,o)}}gPP(t,e,r,n){let i=[{c:o.cV(l.rInt(0,l.abw),l.rInt(0,l.abh)),r:l.rInt(20,e)}];for(;i.length<t;){let t=o.cV(l.rInt(0,l.abw),l.rInt(0,l.abh)),r=e;for(let e=0;e<i.length;e++){let l=i[e],n=s.dist(t.x,t.y,l.c.x,l.c.y);r=s.min(r,n-l.r)}r>0&&i.push({c:t,r})}for(let t=0;t<i.length;t++){let e=i[t];this.gP(e.c,e.r,r,.75,n)}}gR(t,e,r,n,o,s){let i=[];i.push({x:t,y:e}),i.push({x:t+r,y:e}),i.push({x:t+r,y:e+n}),i.push({x:t,y:e+n});let a=[];a.push({x1:i[0].x,y1:i[0].y,x2:i[1].x,y2:i[1].y,gap:0,lP:l.rBool(o[0])}),a.push({x1:i[1].x,y1:i[1].y,x2:i[2].x,y2:i[2].y,gap:0,lP:l.rBool(o[1])}),a.push({x1:i[2].x,y1:i[2].y,x2:i[3].x,y2:i[3].y,gap:0,lP:l.rBool(o[2])}),a.push({x1:i[3].x,y1:i[3].y,x2:i[0].x,y2:i[0].y,gap:0,lP:l.rBool(o[3])}),s.push({verts:i,lines:a})}gG(t,e,r){let n=(l.abw-2*o.brd)/t,s=(l.abh-2*o.brd)/e;for(let l=0;l<e;l++)for(let i=0;i<t;i++){let a=i*n+o.brd,c=l*s+o.brd,h=[.65,0,0,.65];i==t-1&&(h[1]=.65),l==e-1&&(h[2]=.65),this.gR(a,c,n,s,h,r)}}isC(t){let e=this.grid.gIR(t.x1,t.y1,t.x2,t.y2),r={x:t.x2,y:t.y2},l=s.distSq(t.x1,t.y1,t.x2,t.y2),n=0;for(let o=0;o<e.length;o++){let i=e[o];for(let e=0;e<i.lines.length;e++){let o=i.lines[e],a=this.is(t,o);if(a){let e=s.distSq(a.x,a.y,t.x1,t.y1);e<l&&(r=a,l=e,n=o.gap)}}}return{x:r.x,y:r.y,gap:n}}is(t,e){let r=t.x1,l=t.y1,n=t.x2,o=t.y2,s=e.x1,i=e.y1,a=n-r,c=o-l,h=e.x2-s,x=e.y2-i,u=-h*c+a*x;if(0==u)return!1;let y=(-c*(r-s)+a*(l-i))/u;if(y<0||y>1)return!1;let b=(h*(l-i)-x*(r-s))/u;return!(b<0||b>1)&&{x:r+b*a,y:l+b*c}}sL(t,e,r,l,n,o){let a=s.dist(t,e,r,l),c=i.lerp;if(a>n+o){let s=n/a,i=1-o/a;return{x1:c(t,r,s),y1:c(e,l,s),x2:c(t,r,i),y2:c(e,l,i)}}return!1}wN(t,e){let r=0;for(let l=0;l<e.length;l++){let n=(l+1)%e.length,o=e[n].x-e[l].x,s=e[n].y-e[l].y;(t.x-e[l].x)*s-(t.y-e[l].y)*o<0&&r++}return r==e.length}}let l,n=tokenData.hash;console.log(n);let o={},s=Math,i=new p5((e=>{let i;function a(t){let e=o.colBg;t.background(e[0],e[1],e[2]),t.fill(o.colDots),t.noStroke();for(let e=0;e<o.dots.length;e++){let r=o.dots[e];for(let e=0;e<r.length;e++){let l=r[e];t.circle(l[0],l[1],l[2])}}}function c(t){let e=o.colBg;t.noStroke(),t.fill(e[0],e[1],e[2]),t.rect(0,0,l.abw,o.brd),t.rect(l.abw-o.brd,0,o.brd,l.abh),t.rect(0,l.abh-o.brd,l.abw,o.brd),t.rect(0,0,o.brd,l.abh)}function h(t,e){if(t.strokeCap(t.PROJECT),t.scale(e),o.dBD||(a(t),o.dBD=!0),t.noFill(),t.strokeWeight(.75),o.xp){let e=i.dp(t,999999999);e.next(),e.next()}else o.dD||(o.dD=o.gD.next().done);c(t)}function x(t){if(o.dS&&!o.xp){o.xp=!0,o.dBD=!1,console.log(`Exporting a hi-res file (${t} pixels wide), please be patient...`);let r=t/l.abw,i=s.ceil(l.abh*r),a=e.createGraphics(t,i);a.pixelDensity(1),h(a,r),e.saveCanvas(a,"LINEA RECTA - "+n,"jpg"),console.log("Export successful"),a&&(a.remove(),a=null),o.xp=!1}}e.setup=()=>{l=new t(1e3,1414),function(){let t=l.rChW([[.3,[0,[[0,0,0,70],[232,231,209],[28,28,26,240],[0,0,0,180]]]],[.25,[1,[[255,255,255,40],[28,28,26],[212,211,189,235],[252,251,229,180]]]],[.15,[2,[[0,0,0,200],[58,58,56],[212,211,189,200],[4,4,2,200]]]],[.05,[3,[[0,0,0,100],[216,162,6],[30,20,20,165],[252,251,240,165]]]],[.05,[4,[[0,0,0,100],[216,162,6],[252,251,240,100],[252,251,240,160]]]],[.05,[5,[[0,0,0,100],[0,78,130],[252,251,240,100],[252,251,240,180]]]],[.05,[6,[[0,0,0,100],[0,78,130],[4,30,53,180],[252,251,240,180]]]],[.05,[7,[[0,0,0,85],[140,6,5],[252,251,240,100],[252,251,240,180]]]],[.05,[8,[[0,0,0,85],[140,6,5],[60,10,5,220],[252,251,240,180]]]]]);o.colDots=t[1].splice(0,1)[0],o.colBg=t[1].splice(0,1)[0],o.col1=l.rChU(t[1]),o.col2=l.rChU(t[1]),o.cM=l.rChW([[.05,[0,0]],[.05,[1,1]],[.25,[2,2]],[.35,[3,3]],[.1,[4,4]],[.1,[5,5]],[.1,[6,6]]]),o.borObj=l.rChW([[.3,[0,[0,5]]],[.3,[1,[6,10]]],[.4,[2,[11,15]]]]);let e=l.rChW([[1/3,[0,0]],[1/3,[1,1]],[1/3,[2,2]]]);o.gap=l.rInt(28*e[1],28*(e[1]+1))+15,o.bM=l.rChW([[.1,[0,0]],[.15,[1,1]],[.15,[2,2]],[.15,[3,3]],[.15,[4,4]],[.15,[5,5]],[.15,[6,6]]]),o.a1=l.rInt(0,10)*(s.PI/12),o.a2=o.a1+l.rInt(2,10)*(s.PI/12),l.rBool(.2)&&(o.a1=0,o.a2=s.PI/2)}(),e.createCanvas(l.abwA,l.abhA),e.noiseSeed(l.rInt(0,20));let n=o.colBg;e.background(n[0],n[1],n[2]),o.brd=15,o.cV=e.createVector,function(){let t=s.round(399.49),r=l.abw/175,n=l.abh/t;o.dots=[];let i=l.rInt(250,500);for(let l=0;l<=t;l++){let t=[];for(let o=0;o<=175;o++){let a=0;l%2==0&&(a=r/2);let c=o*r+a,h=l*n,x=e.noise(c/i,h/i);x=s.contr(x,2),x=s.max(x,.25),x*=6,t.push([c,h,x])}o.dots.push(t)}}(),i=new r,o.gS=i.init(),o.gD=i.dp(e),o.dS=!1,o.dD=!1,o.dBD=!1,o.xp=!1,e.scale(l.absc),a(e),c(e)},e.draw=()=>{o.dS?o.dD?e.noLoop():h(e,l.absc):(o.dS=o.gS.next().done,e.scale(l.absc),e.noStroke(),e.fill(o.colBg),e.rect(l.abw/2-200,l.abh/2-5,400,5),e.fill(o.col1),e.rect(l.abw/2-200,l.abh/2-5,e.map(i.lC,0,i.lMx,0,400),5))},e.keyPressed=()=>{"1"==e.key?x(7016):"2"==e.key?x(4961):"3"==e.key?x(3508):"4"==e.key&&x(2480)}}),window.document.body)})();
This generative algorithm explores the geometric theme of non-intersecting line segments. In short: no two lines in this design are allowed to cross each other. By incorporating various boundaries and shapes, constraining line angles, adjusting line density and applying several other techniques, a wide range of intricate compositions is produced. The inability to truly connect can be interpreted as a metaphor for modern day life where we are flooded with digital means of communication but often struggle or fail to connect on a deeper, interpersonal level. This project thus reflects on the paradoxical nature of our increasingly interconnected yet isolated existence. Using the keys numbered 1 to 4, you can export high-resolution files in sizes from A1 to A4 for printing at 300 dpi. Please be patient while the exports render. The success of the export may depend on your hardware configuration. If larger sizes fail to render, try exporting smaller sizes.
const t="\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\nvTexCoord = aTexCoord;\nvec4 positionVec4 = vec4(aPosition, 1.0);\npositionVec4.xy = positionVec4.xy * 2.0 - 1.0;\ngl_Position = positionVec4;\n}\n";let i,n,e,s,o,r,h,a,l,c,x,d,m,f,g,p,v,u,y,b="11161d1f2e413846523e6d70de806eac0c2f824f4f4d283334141dZ8C6718CDAB7A2A3D4B2029323350648f4d326f151513201bZ5437267e6244c6a17bdecfc07996a94a4c4f2534411a191aZE5CDBDDE60623D4F83A36E6DE4AF93583847EDDFD9261B3A6A5F74Z1B2F4BC88F39C63114D1D6D364737E8AB1BA274460B09570Z18201f2f403d2c5e4de9e6d9e39051c144259b9270ddbd67Zf0e9c691CAB83e9b9663B1A0f7f7e83e87812D625DZe3ddcec8bea7b4a5879888716e5e5048372f2e1e1aZ2232493f5d886e8e999dbeaaebe3cfc5baa08f7f66E27A46da5716Z815a51BAA098d45d40e7b491f2e5dece82898b62936a40772f3165".split`Z`.map((t=>t.match(/.{6}/g).map((t=>"#"+t)))),w=100,S=0,k=[],C=[],B=[],D=[],A=window.innerWidth,L=window.innerHeight,M=window.innerWidth/.5625,P=.5625*window.innerHeight;M<window.innerHeight?L=M:A=P;let T=Math.min(A,L)/1e3;window.preload=()=>{d=new p5.Shader(this._renderer,t,"\nprecision mediump float;\nvarying vec2 vTexCoord;\nuniform sampler2D tex0;\n\n/*2D simplex noise-https://github.com/ashima/webgl-noise*/\nvec3 mod289(vec3 x) {\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\nreturn mod289(((x*34.0)+10.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\nconst vec4 C = vec4(0.211324865405187,\n 0.366025403784439,\n-0.577350269189626,\n 0.024390243902439);\nvec2 i= floor(v + dot(v, C.yy) );\nvec2 x0 = v - i + dot(i, C.xx);\nvec2 i1;\ni1.x = step( x0.y, x0.x );\ni1.y = 1.0 - i1.x;\nvec4 x12 = x0.xyxy + C.xxzz;\nx12.xy -= i1;\ni = mod289(i);\nvec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n\t\t+ i.x + vec3(0.0, i1.x, 1.0 ));\n\nvec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\nm = m*m ;\nm = m*m ;\n\nvec3 x = 2.0 * fract(p * C.www) - 1.0;\nvec3 h = abs(x) - 0.5;\nvec3 ox = floor(x + 0.5);\nvec3 a0 = x - ox;\nm *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\nvec3 g;\ng.x= a0.x* x0.x+ h.x* x0.y;\ng.yz = a0.yz * x12.xz + h.yz * x12.yw;\nreturn 130.0 * dot(m, g);\n}\n\n\nvoid main() {\n\nvec2 uv = vTexCoord;\nuv = 1.0 - uv;\nuv.x = 1.0 - uv.x;\n\ngl_FragColor = texture2D(tex0, uv + vec2((snoise(uv * 5.5)*0.01)));\n}\n"),gSh=new p5.Shader(this._renderer,t,"precision mediump float;\n\nvarying vec2 vTexCoord;\nuniform float r;\nuniform float g;\nuniform float b;\n\nfloat rand(in vec2 _st) {\nreturn fract(sin(dot(_st.xy,\n vec2(12.9898,78.233)))*\n43758.5453123);\n}\n\nvec3 HSLtoRGB(vec3 hsl) {\nvec3 rgb = clamp(abs(mod(hsl.x*6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0);\nreturn hsl.z + hsl.y * (rgb - 0.5) * (1.0 - abs(2.0 * hsl.z - 1.0));\n}\n\n\nvec3 RGBtoHSL(vec3 rgb) {\nvec3 hsl;\nfloat ma = max(max(rgb.r, rgb.g), rgb.b);\nfloat mi = min(min(rgb.r, rgb.g), rgb.b);\nfloat d = ma - mi;\nhsl.z = (ma + mi) / 2.0;\nif (d == 0.0) {\nhsl.x = 0.0;\nhsl.y = 0.0;\n}\nelse {\nhsl.y = d / (1.0 - abs(2.0 * hsl.z - 1.0));\nif (ma == rgb.r) {\nhsl.x = mod((rgb.g - rgb.b) / d, 6.0);\n}\nelse if (ma == rgb.g) {\nhsl.x = (rgb.b - rgb.r) / d + 2.0;\n}\nelse {\nhsl.x = (rgb.r - rgb.g) / d + 4.0;\n}\nhsl.x *= 60.0;\nif (hsl.x < 0.0) {\nhsl.x += 360.0;\n}\n}\nreturn hsl;\n}\n\n\n\nvoid main() {\n\nvec2 coord = vTexCoord;\nfloat dist = length(coord);\n\nvec3 color1 = vec3(r, g, b);\nvec3 hsl1 = RGBtoHSL(color1);\nhsl1.x -= 1.0;\nhsl1.z += 0.05;\nvec3 hsl2 = hsl1;\nhsl2.x -= 1.0;\nhsl2.z += 0.05;\nvec3 color2 = HSLtoRGB(hsl1);\nvec3 color3 = HSLtoRGB(hsl2);\n\ngl_FragColor = vec4(mix(color1, mix(color2, color3, coord.y), coord.y*abs(cos(smoothstep(0.0, 1.0, dist)))), 1.0) - (fract(sin(dot(coord, vec2(12.9898,78.233)*2.0)) * 43758.5453)) * 0.01; \n}")},setup=()=>{if(u=new G,x=u.i(0,b.length-1),D=b[x],c=u.i(0,D.length-1),i=D[c],v=u.c([200,400,600]),g=u.c(["w","c","a","o","g","r"]),f=u.b(.3),randomSeed(240290*u.d()),noiseSeed(110421*u.d()),createCanvas(A,L,WEBGL),colorMode(HSB,360,100,100,100),o=createGraphics(A,L,WEBGL),o.colorMode(HSB,360,100,100,100),o.noStroke(),o.setAttributes('alpha', false),r=createGraphics(A,L,WEBGL),r.colorMode(HSB,360,100,100,100),r.noStroke(),h=createGraphics(A,L,WEBGL),h.colorMode(HSB,360,100,100,100),h.noStroke(),a=createGraphics(A,L,WEBGL),a.colorMode(HSB,360,100,100,100),a.noStroke(),pixelDensity(2),o.pixelDensity(2),r.pixelDensity(2),h.pixelDensity(2),a.pixelDensity(2),h.shader(gSh),r.shader(d),noFill(),background(i),o.background(i),a.background(i),o.strokeWeight(s),o.translate(-A/2,-L/2),a.translate(-A/2,-L/2),s=T/100,p=cLgh(i)?"#000":"#fff",y=u.d(),n=Math.min(A,L)/map(v,200,600,100,200),e=Math.min(A,L)/map(v,200,600,8,10),D.splice(c,1),m=D,f){let t=htr(i);gSh.setUniform("r",map(t[0],0,255,0,1)),gSh.setUniform("g",map(t[1],0,255,0,1)),gSh.setUniform("b",map(t[2],0,255,0,1)),h.rect(0,0,A,L),o.texture(h),o.rect(0,0,A,L),a.texture(h),a.rect(0,0,A,L)}dLd(100);for(var t=0;C.length<v;){let i=u.n(n,e);for(var S={x:u.n(0,A),y:u.n(0,L),r:i},M=!1,P=0;P<C.length;P++){var z=C[P];dist(S.x,S.y,z.x,z.y)<(S.r+z.r)/u.n(1,1.5)&&(M=!0)}if(M||C.push(S),++t>1e4)break}if(o.noStroke(),m=sA(m),"a"==g)for(t=0;B.length<3*m.length;){let i=u.n(Math.min(A,L)/20,Math.min(A,L)/4);var W={x:u.n(0,A),y:u.n(0,L),r:i,c:u.c(m)};for(M=!1,P=0;P<B.length;P++)z=B[P],dist(W.x,W.y,z.x,z.y)<W.r+z.r&&(M=!0);if(M||B.push(W),++t>1e4)break}if("g"==g){var E=[];for(let t=0;t<m.length;t++){var H={x:A/2/m.length*t,y:L/2/m.length*t,w:A-A/2/m.length*2*t,h:L-L/2/m.length*2*t,c:m[t]};E.push(H)}image(o,-A/2,-L/2,A,L)}if("o"==g)var V=createVector(u.n(0,A),u.n(0,L));for(var _=0;_<C.length;_++){var Z=createVector(C[_].x,C[_].y);if("w"==g&&(l=m[Math.floor(map(C[_].y,0,L,0,m.length))]),"r"==g&&(l=m[Math.floor(map(180*Math.atan2(C[_].x-A/2,C[_].y-L/2)/Math.PI,-180,180,0,m.length))]),"c"==g&&(l=m[Math.floor(map(C[_].x,0,A,0,m.length))]),"a"==g){var F=2*Math.max(A,L);for(let t=0;t<B.length;t++){var R=createVector(B[t].x,B[t].y);Z.dist(R)-B[t].r<F&&(F=Z.dist(R),l=B[t].c)}}if("o"==g&&(l=m[Math.floor(map(Z.dist(V),0,Math.sqrt(A*A+L*L),0,m.length))]),"g"==g)for(let t=0;t<E.length;t++)inRct(Z.x,Z.y,E[t].x,E[t].y,E[t].w,E[t].h)&&(l=E[t].c);let t=new I(C[_].x,C[_].y,l,C[_].r);k.push(t)}w=map(v,200,600,w,w/2),bgTx();let O=.03*k.length;for(let t=0;t<O;t++)k.splice(Math.floor(u.d()*k.length),1);for(let t=0;t<k.length;t++)cos(t)<-.99&&k[t].spl()},draw=()=>{const t=prtg(w-S,w);dLd(t);for(let t=0;t<15;t++)for(let t=0;t<k.length;t++)k[t].m<2*n&&cos(t)>.97?y>.5?k[t].yl():k[t].xl():k[t].m<3*n&&sin(t)>.995?k[t].ccl():k[t].cil(),k[t].show(),k[t].move();S++,S>w&&(d.setUniform("tex0",o),r.rect(0,0,A,L),image(r,-A/2,-L/2,A,L),noLoop())},keyPressed=()=>{"s"!=key&&"S"!=key||save("Spensieratezza.png")},htr=t=>{let i=0,n=0,e=0;return 4==t.length?(i="0x"+t[1]+t[1],n="0x"+t[2]+t[2],e="0x"+t[3]+t[3]):7==t.length&&(i="0x"+t[1]+t[2],n="0x"+t[3]+t[4],e="0x"+t[5]+t[6]),[i,n,e]},prtg=(t,i)=>100*t/i,dLd=t=>{a.strokeWeight(T),a.stroke(p),a.fill(i),a.rect(A/4,L/2-5*T,A/2,10*T),a.strokeWeight(10*T),a.line(A/4,L/2,map(t,100,0,A/4,A-A/4,!0),L/2),image(a,-A/2,-L/2,A,L)},inRct=(t,i,n,e,s,o)=>t>=n&&t<=n+s&&i>=e&&i<=e+o,cLgh=(t)=>(t=t.replace("#",""),(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>=.5),bgTx=()=>{p=color(p);o.fill(hue(p),saturation(p),brightness(p),u.n(5,25));for(let t=0;t<100;t++)for(let i=0;i<100;i++)o.circle(60*T+(A-120*T)/100*i,60*T+(L-120*T)/100*t,T+u.d(.25*-T,.5*T));};class I{constructor(t,i,n,e){this.p=createVector(t,i),this.n=u.n(1e3,3e3)*T,this.s=u.n(1,5)*T,this.clr=color(n),this.m=e,this.f=1e4*u.d(),this.k=this.f*2802,this.i=u.n(.005,.01),this.a=u.n(0,TWO_PI),this.dq=u.i(2,4),this.dir=createVector(cos(this.a),sin(this.a)),this.l=createVector(t,i)}cil(){this.l.dist(this.p)>this.m&&(this.l=createVector(this.p.x+u.n(-this.m/2,this.m/2),this.p.y+u.n(-this.m/2,this.m/2)),this.mReached=!0,this.isActive=!1)}ccl(){(this.l.x>A||this.l.x<0||this.l.y>L||this.l.y<0)&&(this.l=this.p)}yl(){Math.abs(this.l.x-this.p.x)>this.m&&(this.l.x=this.p.x+u.n(-this.m/2,this.m/2)),(this.l.y>L-0||this.l.y<0)&&(this.l.y=u.n(0,L-0))}xl(){Math.abs(this.l.y-this.p.y)>this.m&&(this.l.y=this.p.y+u.n(-this.m/2,this.m/2)),(this.l.x>this.p.x-0||this.l.x<0)&&(this.l.x=u.n(0,A-0))}show(){o.noStroke(),this.t=map(noise(this.f),0,1,this.m/5,this.m),o.fill(hue(this.clr)+map(noise(this.k),0,1,-5,5),saturation(this.clr)+map(noise(this.k),0,1,-5,5),brightness(this.clr)+map(noise(this.k),0,1,-15,15),90),o.translate(this.l.x,this.l.y),o.rotate(this.a),o.translate(-this.l.x,-this.l.y),o.blendMode(ADD),o.ellipse(this.l.x,this.l.y,this.t),o.fill(hue(this.clr)+map(noise(this.f),0,1,-10,10),saturation(this.clr)+map(noise(this.f),0,1,-5,5),brightness(this.clr)+map(noise(this.f),0,1,-25,25),map(this.l.dist(this.p),0,this.m,90,0));for(let t=-this.dq;t<this.dq+1;t++)o.rect(this.l.x-this.t/2,this.l.y+this.t/(4*t),this.t/Math.abs(4*t),65*s);o.translate(this.l.x,this.l.y),o.rotate(-this.a),o.translate(-this.l.x,-this.l.y),this.f+=this.i,this.k+=this.i}spl(){let t=u.n(0,TWO_PI);o.beginShape();for(let i=0;i<TWO_PI;i+=.01)o.fill(hue(this.clr)+map(noise(this.f),0,1,-5,5),saturation(this.clr)+map(noise(this.f),0,1,-5,5),brightness(this.clr)+map(noise(this.f),0,1,-10,10),100),o.curveVertex(this.l.x+sin(i)*this.m*2*noise(t+i),this.l.y+cos(i)*this.m*2*noise(t+i)),o.ellipse(this.l.x+randomGaussian(0,sin(i)*this.m*6*noise(t+i)),this.l.y+randomGaussian(0,cos(i)*this.m*6*noise(t+i)),randomGaussian(0,this.m/10));o.endShape(CLOSE)}move(){this.a=noise(this.l.x/this.n,this.l.y/this.n)*TWO_PI*this.s/T,this.dir.x=cos(this.a),this.dir.y=sin(this.a),this.vel=this.dir.copy(),this.vel.mult(map(noise(this.f),0,1,50,300)*s),this.l.add(this.vel),this.f+=this.i}}class G{constructor(){this.uA=!1;let t=t=>{let i=parseInt(t.substr(0,8),16),n=parseInt(t.substr(8,8),16),e=parseInt(t.substr(16,8),16),s=parseInt(t.substr(24,8),16);return()=>{i|=0,n|=0,e|=0,s|=0;let t=(i+n|0)+s|0;return s=s+1|0,i=n^n>>>9,n=e+(e<<3)|0,e=e<<21|e>>>11,e=e+t|0,(t>>>0)/4294967296}};this.A=t(tokenData.hash.substr(2,32)),this.B=t(tokenData.hash.substr(34,32));for(let t=0;t<1e6;t+=2)this.A(),this.B()}d(){return this.uA=!this.uA,this.uA?this.A():this.B()}n(t,i){return t+(i-t)*this.d()}i(t,i){return~~this.n(t,i+1)}b(t){return this.d()<t}c(t){return t[this.i(0,t.length-1)]}}sA=(a)=>{for(let i=a.length-1;i>0;i--){const j=Math.floor(u.d()*(i+1));[a[i],a[j]]=[a[j],a[i]]}return a}
Spensieratezza is a heartfelt tribute to the joy and carefree of childhood. In the piece, the simple code-painted brush strokes symbolize the instinctive and careless action of painting typical of kids, and the muted colors represent the fears and responsibilities of adults. In this harmonious dichotomy, the artwork embodies the struggle to relinquish past and future thoughts and embrace the present moment with a carefree spirit.
eight),gl.uniform2f(i,dP.shDir[0],dP.shDir[1])}function drawShader(){gl.TRIANGLES;gl.drawArrays(5,0,4)}function setFramebuffer(r,e,t){gl.bindFramebuffer(gl.FRAMEBUFFER,r),gl.viewport(0,0,e,t)}function readURLParams(){const r=window.location.search,e=new URLSearchParams(r);for(var t of e.entries())dP[t[0]]=t[1]}document.addEventListener("keyup",r=>{var e=r.key;r.code;if("s"===e){doSave=!0;var t=new Date;canvas.toBlob(r=>{saveBlob(r,`lacaverna_${tD.tokenId}_${tD.hash}_${t.toISOString()}.png`)})}else"l"===e?keepDrawing=!keepDrawing:"r"===e&&doDraw()},!1),sAP();var canvas=document.querySelector("canvas");canvas.style.width=dP.sW+"px",canvas.style.height=dP.sH+"px",document.body.style.margin=0,document.body.style.overflow="hidden",document.body.style.display="flex",document.body.style.justifyContent="center",document.body.style.alignItems="center",document.body.style.verticalAlign="center";var gl=canvas.getContext("webgl2",{preserveDrawingBuffer:!0});canvas.width=dP.sW*dP.pd*dP.globalResK,canvas.height=dP.sH*dP.pd*dP.globalResK,gl.viewport(0,0,gl.drawingBufferWidth,gl.drawingBufferHeight);const targetTexture1=gl.createTexture(),targetTexture2=gl.createTexture();init1(),gl.useProgram(program),initUniforms(),initDataTexture();var textures=[],framebuffers=[];gl.activeTexture(gl.TEXTURE0+3);for(var ii=0;ii<2;++ii){var texture=createAndSetupTexture(gl);textures.push(texture);var mipLevel=0,internalFormat=gl.RGBA,border=0,srcFormat=gl.RGBA,srcType=gl.UNSIGNED_BYTE,data=null;gl.texImage2D(gl.TEXTURE_2D,mipLevel,internalFormat,canvas.width,canvas.height,border,srcFormat,srcType,data);var fbo=gl.createFramebuffer();framebuffers.push(fbo),gl.bindFramebuffer(gl.FRAMEBUFFER,fbo);var attachmentPoint=gl.COLOR_ATTACHMENT0;gl.framebufferTexture2D(gl.FRAMEBUFFER,attachmentPoint,gl.TEXTURE_2D,texture,mipLevel)}gl.bindTexture(gl.TEXTURE_2D,textures[1]),gl.uniform1i(imageLocation,3),gl.uniform1f(flipYLocation,1);var count=0;init2(),gl.useProgram(program2),initUniforms2();var thisRoundInitTime,d=new Date,initRenderTime=Date.now();function doDraw(){thisRoundInitTime=Date.now(),gl.useProgram(program),gl.activeTexture(gl.TEXTURE0+3);for(var r=0;r<1;++r)gl.uniform1f(uFrameUnLoc,count+1),setFramebuffer(framebuffers[count%2],canvas.width,canvas.height),drawShader(),gl.bindTexture(gl.TEXTURE_2D,textures[count%2]),++count;gl.useProgram(program2),gl.activeTexture(gl.TEXTURE0+3),gl.uniform1i(gl.getUniformLocation(program2,"tex"),3),gl.uniform1f(flipYLocation2,1),gl.uniform1i(u_timeUnLoc,dP.nK),gl.uniform1i(uF,count),setFramebuffer(null,gl.canvas.width,gl.canvas.height),gl.uniform1f(iterUnLoc,count),drawShader()}var finishRenderTime,keepDrawing=!0,finished=!1;setInterval(()=>{keepDrawing&&(count>0?finished||(finished=!0,finishRenderTime=d.getMilliseconds()):doDraw())},250);console.clear();console.log("la caverna / marcelo soria-rodríguez @msoriaro 2023");console.log("CC BY-NC-SA 4.0, https://creativecommons.org/licenses/by-nc-sa/4.0/");console.log("always keep a healthy doubt and take time for self-reflection and outer inspection");console.log("and thanks for inspecting the console")
tD=tokenData;var sh_fs="#version 300 es\n#define TX texture\n#define V3 vec3\n#define FF float\nprecision highp FF;out vec4 outColor;in vec2 v_texcoord; uniform sampler2D tex0;uniform sampler2D dtx;uniform vec2 dtxS;uniform int u_numObjects;uniform FF u_time;uniform FF uFrame,aR;uniform int uBW;uniform FF uRndmArr[100];uniform V3 uPosCam;uniform FF uCamFl;uniform V3 uLookAt;uniform FF uICEK;const int MAXMARCHINGSTEPSMAX = 128;uniform int uMaxIter;const FF MIN_DIST = 0.0;const FF MAX_DIST = 100.0;const FF EPSILON = 0.0005;const FF PI = 3.14159265359;const FF PI2 = 1.570796326795;const int COLORITER = 128;uniform int uCi;vec2 uv; FF modm( FF x,FF y) {return x-y*floor(x/y);} FF hash( FF seed) {return fract(sin(seed)*43758.5453);}V3 cD(in FF seed,in V3 nor) {V3 tc = V3(1.0+nor.z-nor.xy*nor.xy,-nor.x*nor.y)/(1.0+nor.z);V3 uu = V3(tc.x,tc.z,-nor.x);V3 vv = V3(tc.z,tc.y,-nor.y); FF u = hash(78.233+seed+uRndmArr[(int(32.+u_time))%45]); FF v = hash(10.873+seed+uRndmArr[(int(15.+u_time))%45]); FF a = 6.283185*v;return sqrt(u)*(cos(a)*uu+sin(a)*vv)+sqrt(1.0-u)*nor;} FF rdn(vec2 st) {return fract(sin(dot(st.xy,vec2(12.9898,78.233)))*43758.5453123);}V3 uniformVector(in FF seed) { FF a = 3.141593*hash(78.233+seed); FF b = 6.283185*hash(10.873+seed);return V3(sin(b)*sin(a),cos(b)*sin(a),cos(a));}mat3 rotateX( FF theta) { FF c = cos(theta); FF s = sin(theta);return mat3(V3(1,0,0),V3(0,c,-s),V3(0,s,c));}mat3 rotateY( FF theta) { FF c = cos(theta); FF s = sin(theta);return mat3(V3(c,0,s),V3(0,1,0),V3(-s,0,c));}mat3 rotateZ( FF theta) { FF c = cos(theta); FF s = sin(theta);return mat3(V3(c,-s,0),V3(s,c,0),V3(0,0,1));}mat3 identity() {return mat3(V3(1,0,0),V3(0,1,0),V3(0,0,1));} FF ssub( FF d1,FF d2) {return max(-d1,d2);}struct SurfaceWithP { FF sd;V3 col;V3 p;};struct Srfc { FF sd;V3 col;};struct SrfcP { FF sd;V3 col;vec4 dim;};Srfc sdB(V3 p,V3 b,V3 ofs,V3 col,mat3 trns) {p = (p-ofs)*trns;V3 q = abs(p)-b; FF d = length(max(q,0.0))+min(max(q.x,max(q.y,q.z)),0.0);return Srfc(d,col);}Srfc sCyl(V3 p,V3 c) {return Srfc(length(p.xz-c.xy)-c.z-0.01,V3(0));}Srfc sdSphere(V3 p,FF d,V3 col) {return Srfc(length(p)-d,col);}Srfc sdPyramid( V3 p,FF h,V3 col){ FF m2 = h*h+0.25; p.xz = abs(p.xz); p.xz = (p.z>p.x) ? p.zx : p.xz; p.xz -= 0.5; V3 q = V3( p.z,h*p.y-0.5*p.x,h*p.x+0.5*p.y); FF s = max(-q.x,0.0); FF t = clamp( (q.y-0.5*p.z)/(m2+0.25),0.0,1.0 ); FF a = m2*(q.x+s)*(q.x+s)+q.y*q.y; FF b = m2*(q.x+0.5*t)*(q.x+0.5*t)+(q.y-m2*t)*(q.y-m2*t); FF d2 = min(q.y,-q.x*m2-q.y*0.5) > 0.0 ? 0.0 : min(a,b); return Srfc(sqrt( (d2+q.z*q.z)/m2 )*sign(max(q.z,-p.y)),col);}Srfc sdTriPrism( V3 p,vec2 h ,V3 col){ V3 q = abs(p); return Srfc(max(q.z-h.y,max(q.x*0.866025+p.y*0.5,-p.y)-h.x*0.5),col);}Srfc sadd(Srfc o1,Srfc o2) {if(o2.sd < o1.sd)return o2;return o1;}V3 opRepLim(V3 p,FF c,V3 l) {V3 q = p-c*clamp(floor(p/c+0.5),-l,l);return q;}Srfc sdWall_3(V3 p,V3 b,V3 ofs,V3 col,mat3 trns) {V3 qq = p;qq = trns*(qq-ofs-V3(0,b.y,0));V3 q = abs(qq)-b; FF d = length(max(q,0.0))+min(max(q.x,max(q.y,q.z)),0.0);return Srfc(d,col);}Srfc sdScene_addPoles(V3 p,Srfc co,vec4 headDim) { FF c = max(0.1,uRndmArr[27]); FF w = uRndmArr[26]; FF L = headDim.x/1.;p -= V3(0,headDim.y,0);p = rotateX(PI2*uRndmArr[47])*rotateY(PI2*uRndmArr[44])*p;V3 l = V3((headDim.z+headDim.w)/c,headDim.x/c,headDim.y/c);V3 repQ = opRepLim(p,c,l*V3(abs(uRndmArr[43])*3.));return sadd(co,sdB(repQ,V3(w,L,w),V3(0,0,0),V3(1.),identity()));}Srfc sdFloor(V3 p,V3 col) { FF d = p.y-0.75 +uRndmArr[97]*(uRndmArr[5]*sin(p.x)+ +uRndmArr[4]*sin(p.z+uRndmArr[2])); return Srfc(d,col);}Srfc cutWholeSceneWithThings(V3 p,Srfc co) { FF c = 2.; FF pSize = uRndmArr[31]*70.;V3 l = V3(pSize,uRndmArr[32]*100.,pSize);V3 cuttingWorld = opRepLim(p-V3(0.,3.,0),c,l);V3 cuttingPlaneSize = V3(pSize,pSize,0.1);Srfc cuttingElements = sdB(cuttingWorld,cuttingPlaneSize,V3(0.),V3(0.),rotateY(uRndmArr[40])*rotateZ(uRndmArr[20])*rotateX(uRndmArr[10]));co = Srfc(ssub(cuttingElements.sd,co.sd),co.col);return co;}Srfc sdSetObjects(V3 p) {V3 pos,c,dim;Srfc co = Srfc(10000.,V3(0.));Srfc tempCo;V3 pt;mat3 rot; FF x,rX,rY;for (int m=0; m<200;m++) {if (m>u_numObjects) break;rX = ( FF(m)*2.+0.5)/dtxS[0];rY = 1.5/dtxS[1];x = TX(dtx,vec2(rX,rY)).r;dim = V3(x,TX(dtx,vec2(( FF(m)*2.+1.5)/ dtxS[0],rY)).r,TX(dtx,vec2(( FF(m)*2.+2.5)/ dtxS[0],rY)).r);rY = 2.5/dtxS[1];c = V3(TX(dtx,vec2(( FF(m)*3.+.5)/ dtxS[0],rY)).r,TX(dtx,vec2(( FF(m)*3.+1.5)/ dtxS[0],rY)).r,TX(dtx,vec2(( FF(m)*3.+2.5)/ dtxS[0],rY)).r);rY = 3.5/dtxS[1];pos = V3(TX(dtx,vec2(( FF(m)*3.+.5)/ dtxS[0],rY)).r,TX(dtx,vec2(( FF(m)*3.+1.5)/ dtxS[0],rY)).r,TX(dtx,vec2(( FF(m)*3.+2.5)/ dtxS[0],rY)).r);rot = rotateX(uRndmArr[int(modm( FF(m),49.))]+uRndmArr[int(modm( FF(m+50),30.))])*rotateY(uRndmArr[int(modm( FF(m)+11.,49.))]+uRndmArr[int(modm( FF(m+32),30.))]);pt = (p-pos)*rot;if (TX(dtx,vec2( FF(m)/ dtxS[0],0)).r == 0.) {co = sadd(co,sdSphere(pt,dim.x,c));} else if (TX(dtx,vec2( FF(m)/ dtxS[0],0)).r == 1.) {co = sadd(co,sdPyramid((pt),dim.x,c));} else if (TX(dtx,vec2( FF(m)/ dtxS[0],0)).r == 2.) {co = sadd(co,sdTriPrism((pt),vec2(dim.x,dim.y),c));}}return co;}Srfc sdScenePartial(V3 p,bool onlyShadows) {p += 0.025*rdn(p.zx);Srfc co = Srfc(10000.,V3(0.));co = sdSetObjects(p);co = sdScene_addPoles(p,co,vec4(0.1,5,0.1,1.));return co;}Srfc sdScene(V3 p,bool onlyShadows) {p += 0.23*uRndmArr[94]*mod(p,5.*uRndmArr[96])*uRndmArr[98];p += 0.5*uRndmArr[93]*fract(p)*uRndmArr[99];Srfc co = Srfc(10000.,V3(0.));co = sadd(co,sdScenePartial(p,onlyShadows)); FF rY = (5.5)/dtxS[1];V3 floorColor = V3(TX(dtx,vec2((.5)/ dtxS[0],rY)).r,TX(dtx,vec2((1.5)/ dtxS[0],rY)).r,TX(dtx,vec2((2.5)/ dtxS[0],rY)).r);co = sadd(co,sdFloor(p,floorColor));if (uRndmArr[1]>0.25){p *= rotateY(uRndmArr[4]*uRndmArr[16]+uRndmArr[4]*uRndmArr[5]);co = sadd(co,sdWall_3(p,V3(0.1,10,0.1),V3(10,0,0),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,9,0.1),V3(9,0,0),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,8,0.1),V3(8,0,0),V3(1.),identity())); } if (uRndmArr[2]>0.25){p *= rotateY(uRndmArr[1]*uRndmArr[23]+uRndmArr[10]*uRndmArr[6]);co = sadd(co,sdWall_3(p,V3(0.1,10,0.1),V3(10,0,0),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,9,0.1),V3(9,0,0),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,8,0.1),V3(8,0,0),V3(1.),identity())); } if (uRndmArr[3]>0.75){p *= rotateY(uRndmArr[4]+uRndmArr[16]+uRndmArr[4]+uRndmArr[5]);co = sadd(co,sdWall_3(p,V3(0.1,10,0.1),V3(10,0,0),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,9,0.1),V3(9,0,0),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,8,0.1),V3(8,0,0),V3(1.),identity())); }if (uRndmArr[4]>0.45){p *= rotateY(uRndmArr[6]*uRndmArr[10]+uRndmArr[5]*uRndmArr[31]);co = sadd(co,sdWall_3(p,V3(0.1,8,0.1),V3(0,0,10),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,9,0.1),V3(0,0,9),V3(1.),identity())); co = sadd(co,sdWall_3(p,V3(0.1,10,0.1),V3(0,0,8),V3(1.),identity())); }co = cutWholeSceneWithThings(p,co);return co;}Srfc rayMarch(V3 ro,V3 rd,bool shadow) { FF depth = MIN_DIST;Srfc co;for(int i = 0; i < MAXMARCHINGSTEPSMAX; i++) {if(i > uMaxIter)break;V3 p = ro+depth*rd;co = sdScene(p,shadow);depth += co.sd+0.21;if(co.sd < 0.251*uRndmArr[(i+25)%49]*uRndmArr[i%49]*uRndmArr[(i-9)%49] || depth > MAX_DIST)break;}co.sd = depth;return co;}mat3 camera(V3 cameraPos,V3 lookAtPoint) {V3 cd = normalize(lookAtPoint-cameraPos);V3 cr = normalize(cross(V3(0,1,0),cd));V3 cu = normalize(cross(cd,cr));return mat3(-cr,cu,-cd);}V3 calcNormal(in V3 p,bool shadow) {vec2 e = vec2(1,-1)*EPSILON;return normalize(e.xyy*sdScene(p+e.xyy,shadow).sd+e.yyx*sdScene(p+e.yyx,shadow).sd+e.yxy*sdScene(p+e.yxy,shadow).sd+e.xxx*sdScene(p+e.xxx,shadow).sd);}V3 bC(V3 v,FF b,FF c) {return (v-0.5)*c+0.5+b;}const V3 sunCol = 3.5* V3(1.,0.95,0.94);V3 computeColor(V3 ro,V3 rd,FF sa) {V3 iterCol = V3(0.);V3 accCol = V3(0.);const FF epsilon = 0.0001; FF fdis = 0.;V3 colorMask = V3(1.0); FF rY = 5.5/dtxS[1];V3 lightPosition = V3(TX(dtx,vec2(3.5/ dtxS[0],rY)).r,TX(dtx,vec2(4.5/ dtxS[0],rY)).r,TX(dtx,vec2(5.5/ dtxS[0],rY)).r);for(int m = 0; m < COLORITER; m++) {if(m > uCi)break;rd = normalize(rd);Srfc co = rayMarch(ro,rd,false);if(co.sd > MAX_DIST) {break;} else if(co.sd < 4.*MIN_DIST) {return V3(-1.);} else {if(m == 0)fdis = co.sd;V3 p = ro+rd*co.sd;V3 normal = calcNormal(p,false);colorMask *= co.col;iterCol = V3(0.); FF dif = max(dot(lightPosition,normal),0.0);Srfc sunSha = Srfc(0.,V3(0.3));if(dif > 0.0001)sunSha = rayMarch(p+normal*epsilon*uICEK,lightPosition,true);iterCol += (sunCol*dif*sunSha.sd);accCol += iterCol*colorMask; FF isDif = 0.65;if(hash(sa+1.123+7.7* FF(m)) < isDif) {rd = cD(76.2+73.1* FF(m)+sa+17.7*uFrame,normal);} else { FF glossiness = 0.1;rd = normalize(reflect(rd,normal))+uniformVector(sa+111.123+65.2* FF(m))*glossiness;}ro = p;}}accCol *= exp(-0.1*fdis);return accCol;}void main() {uv = v_texcoord;vec2 uvTex0 = v_texcoord;uv = v_texcoord;uv.y /= aR;uvTex0 = .5*v_texcoord+.5; FF sa = hash(dot(uv,vec2(12.9898,78.233))+1113.1* FF(10.+10.*uFrame/1.));vec4 tI = TX(tex0,vec2(uvTex0.x,uvTex0.y));if(int(uFrame) == 0)tI = vec4(0.0);V3 col = V3(0);V3 lp = uLookAt;V3 camPos = uPosCam;V3 ro = V3(camPos[0],camPos[1],camPos[2]);V3 rd = camera(ro,lp)*normalize(V3(uv,-uCamFl));V3 cC = computeColor(ro,rd,sa);if (cC.x == -1.) {camPos.y *= 0.65;camPos.x *= 0.95;camPos.z *= 1.05;ro = V3(camPos[0],camPos[1],camPos[2]);rd = camera(ro,lp)*normalize(V3(uv,-uCamFl*0.65));cC = computeColor(ro,rd,sa);}col += cC;if(uBW == 1) { FF val = 0.75*col.r+0.52*col.g+0.13*col.y;col = V3(val);}outColor = (vec4(col,1.)+1.*tI);}\n",sh_vs="#version 300 es \nin vec2 a_position;\nout vec2 v_texcoord;\nvoid main() {\n v_texcoord = a_position;\n gl_Position = vec4(v_texcoord, 0, 1);\n}\n",sh_paint_fs="#version 300 es\n#define FF float\nprecision highp FF; out vec4 outColor; in vec2 v_texcoord; uniform vec2 uRes,tS; uniform sampler2D tex; uniform FF iter,u_pA,u_pB,u_pC; uniform int u_time,uF;FF rd(vec2 st) { return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123); }vec3 gB(sampler2D t, vec2 texUV, vec2 sS) { vec3 colOut = vec3(0.0); const int sC = 9; FF gW[sC]; gW[0] = 0.10855; gW[1] = 0.13135; gW[2] = 0.10406; gW[3] = 0.07216; gW[4] = 0.04380; gW[5] = 0.02328; gW[6] = 0.01083; gW[7] = 0.00441; gW[8] = 0.00157; FF gO[sC]; gO[0] = 0.66293; gO[1] = 2.47904; gO[2] = 4.46232; gO[3] = 6.44568; gO[4] = 8.42917; gO[5] = 10.41281; gO[6] = 12.39664; gO[7] = 14.38070; gO[8] = 16.36501; for(int i = 0; i < sC; i++) { vec2 tCO = gO[i] * sS; vec3 col = texture(t, texUV + tCO).xyz + texture(t, texUV - tCO).xyz; col *= gW[i]; colOut += col; } return colOut; }vec3 bC(vec3 v, FF b, FF c) { return (v - 0.5) * c + 0.5 + b; } void main() { vec2 uv= .5*v_texcoord+.5; outColor = texture(tex,uv);FF k1 = pow(FF(uF),0.025); FF rnd = rd(uv * iter); vec3 tN = vec3(0.5, 0.5, 0.5) * rnd; vec3 cOut; vec3 tI = outColor.rgb; vec2 u_dir = vec2(1.,-1.); FF u_br,u_con; u_br = -0.1*k1; u_con = .8759*k1; if(true) { vec3 b1 = gB(tex, uv, tS * u_dir); vec3 b2 = gB(tex, uv, tS*1.15 * vec2(u_dir.x, u_dir.x)); vec3 b3 = gB(tex, uv, tS *0.89* vec2((u_dir.y + u_dir.x) / 2., (u_dir.y + u_dir.x) / 2.)); b1 = 0.6 * b1 + 0.2 * b2 + 0.2 * b3; cOut = 0.75 * bC(tI * (b1 * u_pA + u_pB) + tN * u_pC + 0.03 * tN * (0.5 + b1), u_br, u_con); } else { cOut = 0.99 * tI + tN * u_pC; } outColor = vec4(cOut,1.);outColor = vec4(pow( outColor.rgb, vec3(0.654674545)*k1 ),1.); outColor = outColor*(outColor*2.5953+0.14)/(outColor*(outColor*1.1372+1.934)); outColor = clamp(outColor,vec4(0.),vec4(1.0));}",sh_paint_vs="#version 300 es\nin vec2 a_position;\nout vec2 v_texcoord; \nvoid main() {\n v_texcoord = a_position;\n gl_Position = vec4(v_texcoord, 0, 1);\n}";class Random{constructor(){this.uA=!1;let r=function(r){let e=parseInt(r.substr(0,8),16),t=parseInt(r.substr(8,8),16),o=parseInt(r.substr(16,8),16),a=parseInt(r.substr(24,8),16);return function(){var r=((e|=0)+(t|=0)|0)+(a|=0)|0;return a=a+1|0,e=t^t>>>9,t=(o|=0)+(o<<3)|0,o=(o=o<<21|o>>>11)+r|0,(r>>>0)/4294967296}};this.pA=new r(tD.hash.substr(2,32)),this.pB=new r(tD.hash.substr(34,32));for(let r=0;r<1e6;r+=2)this.pA(),this.pB()}rd(){return this.uA=!this.uA,this.uA?this.pA():this.pB()}rn(r,e){return r+(e-r)*this.rd()}ri(r,e){return Math.floor(this.rn(r,e+1))}rc(r){return r[this.ri(0,r.length-1)]}rmM(r){return this.rn(r[0],r[1])}rSign(){return(-1)**this.rc([0,1])}}let R=new Random;class color{constructor(r,e,t,o=1){this.r=r,this.g=e,this.b=t,this.a=o}}class aVector{constructor(r,e,t){this.x=r,this.y=e,this.z=t}}class aRect{constructor(r,e,t,o,a){this.a=r,this.b=e,this.c=t,this.d=o,this.recursionLevel=a,this.w=Math.abs(this.b.x-this.a.x),this.h=Math.abs(this.c.y-this.a.y),this.cP=cV((this.a.x+this.b.x+this.c.x+this.d.x)/4,(this.a.y+this.b.y+this.c.y+this.d.y)/4),this.ar=this.w*this.h,this.col=R.rc(pltArr)}divide(r,e){let t=this.a,o=this.b,a=this.c,i=this.d;return e>0?[new aRect(t,o,cV(a.x,t.y+this.h*r),cV(i.x,o.y+this.h*r),this.recursionLevel+1),new aRect(cV(a.x,t.y+this.h*r),cV(i.x,o.y+this.h*r),a,i,this.recursionLevel+1)]:[new aRect(t,cV(t.x+this.w*r,o.y),a,cV(a.x+this.w*r,i.y),this.recursionLevel+1),new aRect(cV(t.x+this.w*r,o.y),o,cV(a.x+this.w*r,i.y),i,this.recursionLevel+1)]}}function gC(r,e=255,t="rand",o=0,a=.1,i=!0,n=pltArr){pn=R.rc(r),tp=n[pn],cS="rand"==t?R.rc(tp):tp[o%tp.length];let d=new color(Number("0x"+cS[0]+cS[1])/255,Number("0x"+cS[2]+cS[3])/255,Number("0x"+cS[4]+cS[5])/255,Math.floor(e));return new color(d.r*(1+R.rn(-a,a)),d.g*(1+R.rn(-a,a)),d.b*(1+R.rn(-a,a)),e)}function gCwN(r,e,t){return color(red(r)*(1+R.rn(-e,e)),green(r)*(1+R.rn(-e,e)),blue(r)*(1+R.rn(-e,e)),t)}const pltArr={marine:["e63946","f1faee","a8dadc","457b9d","1d3557","e63946","f1faee","a8dadc","457b9d","1d3557"],gold:["ffdc73","ffcf40","ffbf00","bf9b30","a67c00","FFF9CB","ffdc73","ffcf40","ffbf00","bf9b30","a67c00","FFF9CB"],bw:["fefefe","100702","fefefe","100702","fefefe","100702","fefefe","100702","fefefe","100702","fefefe","100702"],"warm tones":["e53d00","f29300","f9be00","ffe900","fef47c","fcfff7","8fd0cc","21a0a0","046865"],"c-1":["256eff","46237a","3ddc97","9decca","fcfcfc","fea3ac","ff495c"],"c-2":["e6c229","f17105","d11149","6610f2","1a8fe3"],"c-3":["e6c229","f17105","d11111","274d70","0f803d","374007"],"c-4":["e6c229","fffbda","fff4cc","d11111","274d70","0f803d","374007","201510","e6c229","fffbda","fff4cc","d11111","274d70","0f803d","374007","201510"]},bgP={a:["303030","F0E9E1","f2df0b","eb5e28","fe4432","20de50","2D6DD2","CC6205"]};function qt(r,e,t,o,a,i=0,n=[.5]){if(0==t)return[r];if(e>t||R.rd()<a)return[r];let d=[],c=[];if(1==(c=r.divide(n,o)).length)return[r];for(let r=0;r<c.length;r++){let n=[];n=qt(c[r],e+1,t,-o,a,i),d.push(...n)}return d}function cV(r,e,t){return new aVector(r,e,t)}var baseR,dataTexture,dP={},baseGrid=[],objShapes=[],objSizesW=[],objSizesH=[],objColorsR=[],objColorsG=[],objColorsB=[],objPosX=[],objPosY=[],objPosZ=[],objSizes=[],objPos=[],objColors=[],objData=[];function sAP(){for(let r=0;r<100;r++)R.rd();let r;dP.globalResK=1,dP.pd=devicePixelRatio,dP.globalAspectRatio=.7,piAR=dP.globalAspectRatio,innerWidth/innerHeight<=piAR?(dP.sW=innerWidth,dP.sH=innerWidth/piAR):(dP.sH=innerHeight,dP.sW=innerHeight*piAR),dP.baseGridMaxIter=5,dP.baseGridProbSplit=.2325,dP.baseGridProbSkipThis=0,dP.objShapes=[0,1,2],dP.thePalettes=[R.rc(Object.keys(pltArr))],dP.colorSchemeType=R.rd()<.5?"rand":"index",dP.qtT=R.rc([.33,.5,.66]),dP.numRnd=50,baseR=new aRect(cV(0,0),cV(dP.sW,0),cV(0,dP.sH),cV(dP.sW,dP.sH),0),baseGrid=qt(baseR,0,dP.baseGridMaxIter,(-1)**R.rc([0,1]),dP.baseGridProbSplit,dP.baseGridProbSkipThis,dP.qtT),dP.dataTextureWidth=Math.max(dP.numRnd,3*baseGrid.length),dP.dataTextureHeight=6;let e=7+R.rn(-1.5,1.5),t=0*dP.sW/2,o=0;dataTexture=new Float32Array(dP.dataTextureWidth*dP.dataTextureHeight);let a=R.rn(2.25,3);for(let i=0;i<baseGrid.length;i++)objShapes.push(R.rc(dP.objShapes)),dataTexture[i]=R.rc(dP.objShapes),o=1,dataTexture[dP.dataTextureWidth*o+2*i]=(1+.5*R.rd())*baseGrid[i].w/dP.sW,dataTexture[dP.dataTextureWidth*o+2*i+1]=(1+.5*R.rd())*baseGrid[i].h/dP.sW,dataTexture[dP.dataTextureWidth*o+2*i+2]=(1+.5*R.rd())*baseGrid[i].h/dP.sW,r=gC(dP.thePalettes,255,dP.colorSchemeType,i,.1,!0),o=2,dataTexture[dP.dataTextureWidth*o+3*i]=r.r,dataTexture[dP.dataTextureWidth*o+3*i+1]=r.g,dataTexture[dP.dataTextureWidth*o+3*i+2]=r.b,o=3,dataTexture[dP.dataTextureWidth*o+3*i]=e*(baseGrid[i].cP.y-t)/dP.sW,dataTexture[dP.dataTextureWidth*o+3*i+1]=a,dataTexture[dP.dataTextureWidth*o+3*i+2]=e*(baseGrid[i].cP.x-t)/dP.sW,o=4,dataTexture[dP.dataTextureWidth*o+i]=R.rn(-1,1);o=5,r=gC(["a"],255,"rand",0,.1,!0,bgP),dP.debugBGcolor=r;let i=0;dataTexture[dP.dataTextureWidth*o+3*i]=r.r,dataTexture[dP.dataTextureWidth*o+3*i+1]=r.g,dataTexture[dP.dataTextureWidth*o+3*i+2]=r.b,i=1,dataTexture[dP.dataTextureWidth*o+3*i]=R.rSign()*R.rn(2,6),dataTexture[dP.dataTextureWidth*o+3*i+1]=R.rc([.75*a,R.rn(1.5,3)*a,R.rn(1.5,3)*a,R.rn(1.5,3)*a]),dataTexture[dP.dataTextureWidth*o+3*i+2]=R.rSign()*R.rn(2,6),dP.viewOffset=R.rn(-3,3),dP.camPos=[],dP.camPos[0]=cV(e/2+.1+dP.viewOffset,9.5,e/2+dP.viewOffset),dP.rndmArr=[];for(let r=0;r<50;r++)dP.rndmArr.push(R.rd());for(let r=50;r<97;r++)dP.rndmArr.push(R.rn(-1,1));dP.rndmArr.push(R.rc([0,0,1])),dP.rndmArr.push(R.rc([0,0,1])),dP.rndmArr.push(R.rc([0,1,1,1])),dP.uFrame=1,dP.uLookAt=cV(e/2+dP.viewOffset,0,e/2+dP.viewOffset),dP.uMaxIter=R.rc([32,64,96]),dP.uCi=7,dP.uVi=0,dP.uISLK=.15250521,dP.uICEK=.004842021,dP.uISEK=.131000000321,dP.uIVEK=.00196500000421,dP.uGCk=1,dP.uCamFl=1.47569015,dP.uBW=R.rd()<.15,dP.shTSK=1.5,dP.shA=1.095,dP.shB=.645,dP.shC=.4,dP.shDir=[R.rSign()*R.rn(1,3),R.rSign()*R.rn(1,3)],dP.nK=1e5*R.rd(),readURLParams()}const saveBlob=function(){const r=document.createElement("a");return document.body.appendChild(r),r.style.display="none",function(e,t){const o=window.URL.createObjectURL(e);r.href=o,r.download=t,r.click()}}();function createShader(r,e,t){var o=r.createShader(e);if(r.shaderSource(o,t),r.compileShader(o),r.getShaderParameter(o,r.COMPILE_STATUS))return o;r.deleteShader(o)}function createProgram(r,e,t){var o=r.createProgram();if(r.attachShader(o,e),r.attachShader(o,t),r.linkProgram(o),r.getProgramParameter(o,r.LINK_STATUS))return o;r.deleteProgram(o)}function setTexcoords(r){r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,0,1]),r.STATIC_DRAW)}var vertexShader,fragmentShader,program,program2,positionAttributeLocation,positionBuffer,positions,vao,imageLocation,uF,u_timeUnLoc,uFrameUnLoc,uCiUnLoc,uMaxIterUnLoc,flipYLocation,iterUnLoc,flipYLocation2,doSave=!1;function init1(){vertexShader=createShader(gl,gl.VERTEX_SHADER,sh_vs),fragmentShader=createShader(gl,gl.FRAGMENT_SHADER,sh_fs),program=createProgram(gl,vertexShader,fragmentShader),positionAttributeLocation=gl.getAttribLocation(program,"a_position"),texCoordAttributeLocation=gl.getAttribLocation(program,"a_texcoord"),positionBuffer=gl.createBuffer(),gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer),positions=[-1,-1,-1,1,1,-1,1,1],gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(positions),gl.STATIC_DRAW),vao=gl.createVertexArray(),gl.bindVertexArray(vao),gl.enableVertexAttribArray(positionAttributeLocation);var r=gl.FLOAT;gl.vertexAttribPointer(positionAttributeLocation,2,r,!1,0,0)}function init2(){vertexShader=createShader(gl,gl.VERTEX_SHADER,sh_paint_vs),fragmentShader=createShader(gl,gl.FRAGMENT_SHADER,sh_paint_fs),program2=createProgram(gl,vertexShader,fragmentShader),positionAttributeLocation=gl.getAttribLocation(program2,"a_position"),positionBuffer=gl.createBuffer(),gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer),positions=[-1,-1,-1,1,1,-1,1,1],gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(positions),gl.STATIC_DRAW),vao=gl.createVertexArray(),gl.bindVertexArray(vao),gl.enableVertexAttribArray(positionAttributeLocation);var r=gl.FLOAT;gl.vertexAttribPointer(positionAttributeLocation,2,r,!1,0,0)}function initDataTexture(){var r=gl.createTexture();gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,r);{const r=0,e=gl.R32F,t=dP.dataTextureWidth,o=dP.dataTextureHeight,a=0,i=gl.RED,n=gl.FLOAT;gl.pixelStorei(gl.UNPACK_ALIGNMENT,1),gl.texImage2D(gl.TEXTURE_2D,r,e,t,o,a,i,n,dataTexture),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE)}}function initDataTextureAsFrameBuffer(){var r=createAndSetupTexture(gl);gl.activeTexture(gl.TEXTURE0+0),gl.bindTexture(gl.TEXTURE_2D,r);var e=gl.R32F,t=gl.RED,o=gl.FLOAT;gl.pixelStorei(gl.UNPACK_ALIGNMENT,1),gl.texImage2D(gl.TEXTURE_2D,0,e,dP.dataTextureWidth,dP.dataTextureHeight,0,t,o,dataTexture);var a=gl.createFramebuffer();gl.bindFramebuffer(gl.FRAMEBUFFER,a);var i=gl.COLOR_ATTACHMENT0;gl.framebufferTexture2D(gl.READ_FRAMEBUFFER,i,gl.TEXTURE_2D,r,0)}function createAndSetupTexture(r){var e=r.createTexture();return r.bindTexture(r.TEXTURE_2D,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),e}function initRenderbuffer(){const r=gl.canvas.width,e=gl.canvas.height;gl.bindTexture(gl.TEXTURE_2D,targetTexture);{const t=0,o=gl.RGBA,a=0,i=gl.RGBA,n=gl.UNSIGNED_BYTE,d=null;gl.texImage2D(gl.TEXTURE_2D,t,o,r,e,a,i,n,d),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);const c=gl.createFramebuffer();gl.createFramebuffer();gl.bindFramebuffer(gl.FRAMEBUFFER,c);const s=gl.COLOR_ATTACHMENT0;gl.framebufferTexture2D(gl.FRAMEBUFFER,s,gl.TEXTURE_2D,targetTexture1,t)}}function initUniforms(){var r=gl.getUniformLocation(program,"u_numObjects"),e=gl.getUniformLocation(program,"uRndmArr");uFrameUnLoc=gl.getUniformLocation(program,"uFrame");var t=gl.getUniformLocation(program,"uPosCam"),o=gl.getUniformLocation(program,"uLookAt");uMaxIterUnLoc=gl.getUniformLocation(program,"uMaxIter");var a=gl.getUniformLocation(program,"uISLK"),i=gl.getUniformLocation(program,"uICEK"),n=gl.getUniformLocation(program,"uISEK"),d=gl.getUniformLocation(program,"uIVEK"),c=gl.getUniformLocation(program,"uGCk"),s=gl.getUniformLocation(program,"uCamFl"),u=gl.getUniformLocation(program,"uRes");uCiUnLoc=gl.getUniformLocation(program,"uCi");var l=gl.getUniformLocation(program,"uVi"),m=gl.getUniformLocation(program,"uBW");flipYLocation=gl.getUniformLocation(program,"flipY");var f=gl.getUniformLocation(program,"aR");imageLocation=gl.getUniformLocation(program,"tex0");var g=gl.getUniformLocation(program,"dtx"),h=gl.getUniformLocation(program,"dtxS");gl.uniform1i(r,objShapes.length),gl.uniform1fv(e,new Float32Array(dP.rndmArr)),gl.uniform1f(uFrameUnLoc,dP.uFrame),gl.uniform3f(t,dP.camPos[0].x,dP.camPos[0].y,dP.camPos[0].z),gl.uniform3f(o,dP.uLookAt.x,dP.uLookAt.y,dP.uLookAt.z),gl.uniform1i(uMaxIterUnLoc,dP.uMaxIter),gl.uniform1f(a,dP.uISLK),gl.uniform1f(i,dP.uICEK),gl.uniform1f(n,dP.uISEK),gl.uniform1f(d,dP.uIVEK),gl.uniform1f(c,dP.uGCk),gl.uniform1f(s,dP.uCamFl),gl.uniform2f(u,canvas.width,canvas.height),gl.uniform1i(uCiUnLoc,dP.uCi),gl.uniform1i(l,dP.uVi),gl.uniform1i(m,dP.uBW),gl.uniform2fv(h,new Float32Array([dP.dataTextureWidth,dP.dataTextureHeight])),gl.uniform1i(g,0),gl.uniform1f(f,dP.globalAspectRatio)}function initUniforms2(){var r=gl.getUniformLocation(program2,"uRes"),e=gl.getUniformLocation(program2,"u_pA"),t=gl.getUniformLocation(program2,"u_pB"),o=gl.getUniformLocation(program2,"u_pC"),a=gl.getUniformLocation(program2,"tS"),i=gl.getUniformLocation(program2,"u_dir");uF=gl.getUniformLocation(program2,"uF"),flipYLocation2=gl.getUniformLocation(program2,"u_flipY"),iterUnLoc=gl.getUniformLocation(program2,"iter"),u_timeUnLoc=gl.getUniformLocation(program2,"u_time"),gl.uniform2f(r,canvas.width,canvas.height),gl.uniform1f(e,dP.shA),gl.uniform1f(t,dP.shB),gl.uniform1f(o,dP.shC),gl.uniform2f(a,1*dP.shTSK/canvas.width,1*dP.shTSK/canvas.h
la caverna deals with the impossibility of seeing the absolute truth given our subjective minds and our subjective world. The title is a tribute to Plato’s allegory of the Cave, included in his work Republic. It does not only deal with the fact that what we perceive is affected by our senses and our mental state, which is a function of our genetic inheritance plus our life experiences, current and past, but it also is a reflection of today’s world, where a fabricated reality is no longer distinguishable from what it really is. What is reality today? The artwork creates a set of basic volumes, inspired in the platonic forms, which represent a potential ideal reality. It then presents a distorted view of that reality through several steps of distortion. The artwork also presents, in separate tokens, the undistorted reality and a representation of the layer that transforms that reality into what the observer can see in the first token. The two tokens that represent these other elements will be available to redeem for free at a later stage to collectors who own the first piece (this token) at the time of claiming the rest of the triptych. The three tokens are included in the price of the first token’s mint. The artwork allows to refine the view (simulating more light, creating stronger images) pressing "r". You can save the current image pressing "s". You can decrease/increase the resolution appending in live view the URL parameter ?globalResK=2 (for example). By default, globalResK is 1. You can go as high as your graphics card can handle. Made with vanilla javascript and glsl, no additional libraries or external dependencies. Thanks to @greggman @iquilezles @piterpasma for sharing knowledge about webgl and raymarching. I hope I know something someday to share that little bit. Tested to work fine on Chrome, Safari, Brave on macos, Chrome, Safari, Firefox iOS, Edge Windows. Firefox macos fails to render the image correctly. Please check before you purchase.
A collection of perspectives - many voices, one hi*story* Every piece of chronicles is a different voice, a different point of view, narrating the same history as we are living it. Chronicles are ephemeral, but consistent. They will always maintain their main properties, but every time you look at them, they will tell you about a different moment. Every individual chronicle is a collection composed by infinite variations itself. So each of them is not only a piece, but all the pieces that are written in that chronicle every second. That's about 31,536,000 different outputs each year. ### How does it work Chronicles uses two different RNGs. One of them is derived uniquely from the hash of the piece, and determines the main aesthetics such as accent color, density of characters, margins, type of core etc. The second is derived by a combination of current point in time and hash. This is so that every piece is different from each other when looked at in the same moment, and also continues to vary over time. So if you look at a chronicle now, and then after a few seconds refresh the page (or click on it), you will see the chronicle changed to reflect the newer point in time, but maintaining the aesthetical style.
class R{constructor(t){this.useA=false;let e=function(t){let e=parseInt(t.substr(0,8),16);let r=parseInt(t.substr(8,8),16);let s=parseInt(t.substr(16,8),16);let l=parseInt(t.substr(24,8),16);return function(){e|=0;r|=0;s|=0;l|=0;let t=(e+r|0)+l|0;l=l+1|0;e=r^r>>>9;r=s+(s<<3)|0;s=s<<21|s>>>11;s=s+t|0;return(t>>>0)/4294967296}};this.prngA=new e(t.substr(2,32));this.prngB=new e(t.substr(34,32));for(let t=0;t<1e6;t+=2){this.prngA();this.prngB()}}rD(){this.useA=!this.useA;return this.useA?this.prngA():this.prngB()}rB(t,e){return t+(e-t)*this.rD()}rI(t,e){return Math.floor(this.rB(t,e+1))}rC(t){return t[this.rI(0,t.length-1)]}}function pic(t,e,r,s,l){return abs((t-r)*(t-r))+abs((e-s)*(e-s))<=l*l/4}function gsft(t){let e=""+t.getUTCFullYear()+t.getUTCMonth()+t.getUTCDate()+t.getUTCHours()+t.getUTCMinutes()+t.getUTCSeconds()+tokenData.hash;console.log("timeSeed "+e);return e}let t=[{h:194,s:51},{h:4,s:100},{h:316,s:85},{h:235,s:91},{h:169,s:89},{h:113,s:95},{h:40,s:100},{h:20,s:100},{h:75,s:100},{h:266,s:70}];let r;const e=new R(tokenData.hash);let v=200;let F=50;let s=e.rC([.8,.9]);let f=e.rC([.7,.8,.9,.95,.99]);let o=e.rC([.7,.8,.9]);let l=1;let u=e.rC([.05,.1,.2]);let p=e.rC([.01,.02]);let a=p*2.5;let i=e.rC([.9,.95,.99]);let n=e.rC([0,1,2,5,10]);let g=e.rB(0,1)>.5;let B=e.rC(["h","v"]);let x=e.rB(0,1)>.5;let C=e.rC([.02,.05,.1]);let b=e.rB(0,1)>.5;let y=e.rI(40,100);let k=e.rB(0,1)>.5;let W=e.rC([.02,.05,.1]);let I=e.rB(0,1)>.5;let m=e.rB(0,1)>.5;let A=e.rB(0,1)>.5;let M=e.rC([.2,.3,.5]);let T=e.rC([.01,.015,.02,.03]);let D=e.rB(0,1)>.5;let H=e.rC(t);let S;let U;let q;let P;function setup(){if(windowHeight<=windowWidth/sqrt(2)){w=windowHeight*sqrt(2);h=windowHeight}else{w=windowWidth;h=windowWidth/sqrt(2)}colorMode(HSB);createCanvas(w,h);pixelDensity(5)}function draw(){wr();noLoop()}function wr(){d=new Date;r=new R(gsft(d));S=grs(r);U=gmp(r);q=gpd(r);P=gex(r);background(b?"#fafafa":"#0f0f0f");noStroke();noFill();if(x){c=color(H.h,H.s,b?90:10);fill(c)}else{c=color(0,0,b?10:90);stroke(c);strokeWeight(.002*h)}rect(S.startRectX*w,S.startRectY*h,S.rectW*w,S.rectH*h);if(m){c=color(H.h,H.s,y)}else{c=color(0,0,b?10:90)}if(A){c.setAlpha(M)}if(I&&!A){fill(c);noStroke()}else{noFill();stroke(c);strokeWeight(.002*h)}for(const t of U){circle(t.x*w,t.y*h,t.w*h)}noFill();for(let e=0;e<q.length;e++){stroke(q[e].ps[0].cl);strokeWeight(q[e].ps[0].w*w);beginShape();for(let t=0;t<q[e].ps.length;t++){if(D){curveVertex(q[e].ps[t].x*w,q[e].ps[t].y*h)}else{vertex(q[e].ps[t].x*w,q[e].ps[t].y*h)}}endShape();if(q[e].lineProb>s&&e<q.length-1){stroke(q[e].ps[q[e].ps.length-1].cl);strokeWeight(q[e].ps[q[e].ps.length-1].w*w);line(q[e].ps[q[e].ps.length-1].x*w,q[e].ps[q[e].ps.length-1].y*h,q[e+1].ps[0].x*w,q[e+1].ps[0].y*h)}}for(const e of P){stroke(e.cl);strokeWeight(e.sw*w);line(e.x1*w,e.y1*h,e.x2*w,e.y2*h)}}function gex(e){let r=[];let s;if(g){s=e.rC(q)}for(let t=0;t<n;t++){if(!g){s=e.rC(q)}let t=e.rC(q);r.push({x1:s.ps[s.ps.length-1].x,y1:s.ps[s.ps.length-1].y,x2:t.ps[0].x,y2:t.ps[0].y,cl:s.ps[0].cl,sw:s.ps[0].w})}return r}function gmp(e){let r=[];let t=[];let s=e.rB(.4,.6);let l=e.rB(.4,.6);let n=e.rB(0,TWO_PI);let o=e.rB(-1,1);let i=1;let h=0;let f=1;let c=0;for(let t=0;t<1e3;t++){r.push({x:s,y:l,w:T});if(t%100===0){o=e.rB(-1,1)}n+=o;s+=cos(n)*.004/sqrt(2);l+=sin(n)*.004;if(s<u||s>1-u||l<u||l>1-u){break}if(s<i){i=s}if(s>h){h=s}if(l<f){f=l}if(l>c){c=l}}if(A){for(const p of r){t.push({x:map(p.x,i,h,u,1-u),y:map(p.y,f,c,u,1-u),w:W})}return t}else{return r}}function grs(t){let e=t.rB(.9*u,1-1.1*u);let r=t.rB(.9*u,1-1.1*u);let s=t.rB(.9*u,1-1.1*u);let l=t.rB(.9*u,1-1.1*u);return{startRectX:Math.min(e,s),startRectY:Math.min(r,l),rectW:Math.abs(s-e),rectH:Math.abs(l-r)}}function gpd(o){let r=[];if(B==="h"){for(let e=u;e<=1-u+.001;e+=a){for(let t=u;t<=1-u+.001;t+=p){gp(t,e,l,r,o)}}}else{for(let e=u;e<=1-u+.001;e+=p){for(let t=u;t<=1-u+.001;t+=a){gp(e,t,l,r,o)}}}let t=[];for(const i of r){if(o.rB(0,1)>f){cl=color(H.h,H.s,i.br)}else{cl=color(0,0,b?10:90)}let e=[];let r=i.x;let s=i.y;let l=i.a;let n=i.ab;for(let t=0;t<i.s;t++){if(t%i.c===0){na=o.rB(-n,n)}l+=na;if(o.rB(0,1)>.5){e.push({x:r,y:s,w:i.w,cl:cl})}r+=cos(l)*i.step*i.w/sqrt(2);s+=sin(l)*i.step*i.w;if(r>i.x+.02||r<i.x-.02||s>i.y+.03||s<i.y-.03){break}}t.push({ps:e,lineProb:o.rB(0,1)})}return t}function gp(t,e,r,s,l){if(l.rB(0,1)>o){return}found=false;for(const n of U){if(pic(n.x,n.y,t,e,C)){found=true;break}}if(found){return}if(k){t+=l.rB(-p/4,p/4);e+=l.rB(-a/4,a/4)}if(l.rB(0,1)<i){neww=.001}else{neww=.003}s.push({x:t,y:e,a:l.rB(0,TWO_PI),ab:r,w:neww,s:300,c:50,title:false,br:y,step:.25})}function mousePressed(){wr()}
I'm sure you know what Suma is about. You could say it in English sum, and then it's an elementary arithmetical problem, the total amount of something that exists. Suma system is divided in two equal parts, displayed side by side. Symbolic surface areas are given the exact same quantity of resources, just look at the numbers. But they don't appear to be alike or identical. Differing points of advantage or disadvantage are highlighted by structural glowing barrier. Constant challenging movements are fixing the system, striving to achieve equilibrium. “Not everything that is faced can be changed. But nothing can be changed until it is faced.” ― James Baldwin _______ Suma is part of YOU TOPIA exhibition, presented by VerticalCrypto Art at The NFT Gallery in London and New York. Curated by Micol Ap.
p5.disableFriendlyErrors=!0,document.title="Suma";const urlSearchParams=new URLSearchParams(window.location.search),params=Object.fromEntries(urlSearchParams.entries());let hash=parseInt(tokenData.hash.slice(0,16),16);var R;let aspect,w,h,bg,horiz_gradient1,horiz_gradient2,tl,tr,bl,br,mode,lin,blender,shape,no_sh,sub_grid,b,posx,posy,r,rnd_s,boje=[],boje_tr=[],gradient=[],steps=25,sh=[],d=1,sum1=0,sum2=0,tx=0,ty=200,tz=0,tw=10;function setup(){aspect=.82,centerCanvas(),windowWidth<windowHeight*aspect?(w=windowWidth,h=Math.round(windowWidth/aspect),createCanvas(w,h)):(w=Math.round(windowHeight*aspect),h=windowHeight,createCanvas(w,h)),frameRate(60),R=new Random,strokeCap(SQUARE),noiseSeed(R.r(0,9999)),pixelDensity(2),shape=f_f(R.r(0,3)),mode=f_f(R.r(0,2)),no_sh=2*f_f(R.r(4,6)),sub_grid=f_f(R.r(3,8)),setup_boje();for(let e=0;e<no_sh;e++)sh[e]=createGraphics(w,h),sh[e].pixelDensity(2),reset_shapes(e)}function setup_boje(){0==mode?(bg=color(248,244,233),lin=color(60),blender=MULTIPLY):(bg=color(10,10,10),lin=color(220),blender=SCREEN),0==mode?(boje[0]="rgba(37, 47, 72, 0.25)",boje[1]="rgba(80, 80, 80, 0.25)",boje[2]="rgba(143, 156, 175, 0.25)",boje[3]="rgba(89, 83, 53, 0.25)",boje[4]="rgba(97, 83, 118, 0.25)",boje[5]="rgba(213, 67, 77, 0.25)",boje[6]="rgba(235, 111, 57, 0.25)",tl=boje[f_f(R.r(0,6))],bl=boje[f_f(R.r(0,6))],br=tl,boje_tr[0]="rgba(253, 143, 156, 0.25)",boje_tr[1]="rgba(231, 129, 166, 0.25)",boje_tr[2]="rgba(252, 158, 32, 0.25)",boje_tr[3]="rgba(254, 111, 97, 0.25)",boje_tr[4]="rgba(154, 151, 56, 0.25)",boje_tr[5]="rgba(122, 193, 211, 0.25)",boje_tr[6]="rgba(255, 208, 203, 0.25)",tr=boje_tr[f_f(R.r(0,7))]):(boje[0]="rgba(37, 47, 72, 0.25)",boje[1]="rgba(80, 80, 80, 0.25)",boje[2]="rgba(143, 156, 175, 0.25)",boje[3]="rgba(234, 70, 77, 0.25)",boje[4]="rgba(199, 190, 149, 0.25)",boje[5]="rgba(230, 97, 38, 0.25)",boje[6]="rgba(97, 83, 118, 0.25)",boje[7]="rgba(213, 67, 77, 0.25)",tl=boje[f_f(R.r(0,8))],bl=boje[f_f(R.r(0,8))],tr=boje[f_f(R.r(0,8))],br=tl),horiz_gradient1=[],horiz_gradient2=[];for(let e=0;e<steps+2;e++)gradient[e]=[];for(let e=0;e<steps+2;e++)horiz_gradient1[e]=lerpColor(color(tl),color(bl),e/(steps+1));for(let e=0;e<steps+2;e++)horiz_gradient2[e]=lerpColor(color(tr),color(br),e/(steps+1));for(let e=0;e<steps+2;e++)for(let r=0;r<steps+2;r++)gradient[r][e]=lerpColor(horiz_gradient1[e],horiz_gradient2[e],r/(steps+1))}function reset_shapes(e){sh[e].textSize(.012*w),sh[e].textStyle(ITALIC),sh[e].textAlign(CENTER,BOTTOM),sh[e].textFont("serif"),sh[e].blendMode(blender),sh[e].strokeWeight(5e-4*h),posx=.5,e%2==0&&(r=R.r(.05,.15)),0==shape?posy=R.r(.15+r,.85-r):1==shape?posy=R.r(.15+r,.8-r):2==shape&&(posy=R.r(.15+2*r,.85)),d*=-1;for(let t=3;t>=1;t-=R.r(.1,.8)){if(0==shape){b=sh[e].drawingContext.createLinearGradient(posx*w-d*t*h*r*.5,0,.5*w,0);let o=gradient[0][constrain(floor(map(posy*h,.2*h,.8*h,0,steps)),0,steps)];b.addColorStop(.5,o),b.addColorStop(.9,tr),sh[e].drawingContext.fillStyle=b,sh[e].drawingContext.strokeStyle=b,sh[e].arc(posx*w,posy*h,1.1*t*r*h,1.1*t*r*h,d*PI/2,(d+2)*PI/2)}else{b=sh[e].drawingContext.createLinearGradient(posx*w+d*t*h*r/2,0,w/2,0);let o=gradient[0][constrain(floor(map(posy*h,.2*h,.8*h,0,steps)),0,steps)];b.addColorStop(.5,o),b.addColorStop(.9,tr),sh[e].drawingContext.fillStyle=b,sh[e].drawingContext.strokeStyle=b,1==shape?sh[e].rect(posx*w,posy*h-t*h*r/3,d*t*h*r/2,t*h*r,0,2*t*h*r,0,2*t*h*r):sh[e].rect(posx*w,posy*h-t*h*r*.8,d*t*h*r/2,t*h*r,0,2*t*h*r,0,0)}3==t&&(sh[e].noStroke(),sh[e].fill(lin),sh[e].text(nf(1e3*r,0,2),w/2+.4*d*w,posy*h),sh[e].stroke(lin),e%2==0?sum1+=r:sum2+=r)}e==no_sh-1&&(sh[e].fill(lin),sh[e].noStroke(),sh[e].text("+",.08*w,.91*h),sh[e].text(nf(1e3*sum1,0,2),.1*w,.93*h),sh[e].text("+",.88*w,.91*h),sh[e].text(nf(1e3*sum2,0,2),.9*w,.93*h),sh[e].stroke(lin),sh[e].line(.87*w,floor(.915*h)+.5,.94*w,floor(.915*h)+.5),sh[e].line(.07*w,floor(.915*h)+.5,.14*w,floor(.915*h)+.5))}function draw(){let e;blendMode(BLEND),background(bg),stroke(red(tr),green(tr),blue(tr)),strokeWeight(15e-5*h),tx=0;for(let r=2;r<48;r++)e=map(noise(tx,ty),0,1,.05*-w,.05*w),tx+=.5,r%sub_grid==0?strokeWeight(4e-4*h):strokeWeight(15e-5*h),line(.03*w,floor(r*h/50+e)+.5,.97*w,floor(r*h/50+e)+.5),r<20&&line(floor(r*w/20+e)+.5,.03*w,floor(r*w/20+e)+.5,h-.03*w);ty+=.001,strokeWeight(.002*h),line(floor(w/2),0,floor(w/2),h),blendMode(blender),tz=0;for(let e=0;e<no_sh;e++)rnd_s=map(noise(tz,tw),0,1,.08*-w,.08*w),tz+=.1,image(sh[e],0,rnd_s,w,h);tw+=.004}function windowResized(){windowWidth<windowHeight*aspect?(w=windowWidth,h=Math.round(windowWidth/aspect),resizeCanvas(w,h)):(w=Math.round(windowHeight*aspect),h=windowHeight,resizeCanvas(w,h))}function f_s(e){return Math.sin(e)}function f_f(e){return Math.floor(e)}function f_fs(e){return Math.floor(e)+.5}function f_c(e){return Math.cos(e)}function keyPressed(){if("s"==key||"S"==key){let e=hour()+""+minute()+second();save("suma"+e+".png")}}function centerCanvas(){var e=document.body.style;e.display="flex",e.overflow="hidden",e.height="100vh",e.alignItems="center",e.justifyContent="center"}class Random{constructor(){this.useA=!1;let e=function(e){let r=parseInt(e.substr(0,8),16),t=parseInt(e.substr(8,8),16),o=parseInt(e.substr(16,8),16),s=parseInt(e.substr(24,8),16);return function(){r|=0,t|=0,o|=0,s|=0;let e=(r+t|0)+s|0;return s=s+1|0,r=t^t>>>9,t=o+(o<<3)|0,o=o<<21|o>>>11,o=o+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substr(2,32)),this.prngB=new e(tokenData.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}r(e,r){return e+(r-e)*this.random_dec()}}
I'm sure you know what Suma is about. You could say it in English sum, and then it's an elementary arithmetical problem, the total amount of something that exists. Suma system is divided in two equal parts, displayed side by side. Symbolic surface areas are given the exact same quantity of resources, just look at the numbers. But they don't appear to be alike or identical. Differing points of advantage or disadvantage are highlighted by structural glowing barrier. Constant challenging movements are fixing the system, striving to achieve equilibrium. “Not everything that is faced can be changed. But nothing can be changed until it is faced.” ― James Baldwin
“Spacetime grips mass, telling it how to move... Mass grips spacetime, telling it how to curve.” – John Archibald Wheeler Spatial Curvatures captures the powerful and mysterious essence of the universe, depicting the phenomena of gravitational lensing, the spacetime continuum, and the space fabric. The main focus of this piece is the visualization of the warping, bending, and fracturing of light and space fabric caused by gravity. The viewer can see how the fabric of spacetime is affected by the presence of matter and energy, and how this in turn affects the motion of objects within the universe. In creating this artwork, a particle system was utilized to create the spacetime fabric, and various shaders were used to visualize how gravity can warp, bend, and fracture the fabric and light. To obtain higher resolution output, you can press the 's' key in live view. Alternatively you can right-click and save the preview image. Due to differences in how shaders operate in different engines, there may be slight differences between the preview image and the live-rendered output. Made with p5js and custom glsl shaders. DistCollective, February 2023
var styles=` html, body { width: 100%; height: 100%; margin: 0; padding: 0; } body { overflow: hidden; touch-action: none; background: #252525; } main { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } canvas { width: auto !important; height: auto !important; max-width: 100% !important; max-height: 100% !important; /* box-shadow: 0px 0px 40px #000000;*/ } `,styleSheet=document.createElement("style");styleSheet.innerText=styles,document.head.appendChild(styleSheet);let particles=[],particles2=[],particles3=[],particles4=[],particles5=[],particles6=[],particles7=[],particles8=[],particles9=[],mult=.03,vec,vec2,vec3,vec4,vec5,vec6,vec7,vec8,vec9,hash=tokenData.hash,id=tokenData.tokenId;console.log(hash),console.log(id);let rSeed,nSeed,nSeed1,nSeed2,nSeed3,progress1,progress2,progress3,progress,rSeed1=12.49414,rSeed2=78.233,rSeed3=43758.5453123,strokesSc,blurSc,drawAngle,uSqr,stC,uRand,uRand2,speed,sek,counter=0,sw,flag1=!1,flag2=!1,flag3=!1,flag4=!1,bolBol=!1,colPic,colPic2,colPic3,yatayChooser,yataStr,bol1,bol2,bol3,fr,pg,blurBg,blurShader,c=0,c2=0,noiseRandom1,noiseRandom2,noiseRandom3,xoff1=0,xoff2=0,xoff3=0,uvChooser,uvChooser2,intensityC,roundnessC,angleC,radC,darkC,denC,sinC,max,wi,fbmShader,strokeShader,strokePg,fbmPg,uRoundness,uAngleC,shaderC,pgPg,dirR,randRan,dirCr,noiseC,soloChooser,rotateC,rotCh,angleC2,radC2,dirR2,col1,col2,col3,colV1,colV2,colV3,col1Smin,col1Smax,col2Smin,col2Smax,col3Smin,col3Smax,col1Bmin,col1Bmax,col2Bmin,col2Bmax,col3Bmin,col3Bmax,colV1Bmin,colV1Bmax,colV2Bmin,colV2Bmax,colV3Bmin,colV3Bmax,colV1Smin,colV1Smax,colV2Smin,colV2Smax,colV3Smin,colV3Smax,briMult,briMult2,uniRand1,uniRand2,fbmC,pix=2,kalCh,combinationC,combName,granPg,dirdir,fig,genel,stars=[],fvertexsh=` attribute vec3 aPosition; attribute vec2 aTexCoord; varying vec2 vTexCoord; void main() { vTexCoord = aTexCoord; vec4 positionVec4 = vec4(aPosition, 1.0); positionVec4.xy = positionVec4.xy * 2.0 - 1.0; gl_Position = positionVec4; }`,ffragsh=` precision mediump float; #define PI 3.14159265359 varying vec2 vTexCoord; uniform sampler2D uTexture0; uniform float u_time; uniform vec2 uResolution; uniform float u_amp; uniform float u_octave; uniform float u_fbmAmp; uniform float uvChooser; uniform float u_intensity; uniform float u_roundness; uniform float u_angleC; uniform float u_sqr; uniform float u_darkC; uniform float u_fbmC; const float PHI = 1.61803398874989484820459; const float SEED1 = 12.0; const float SEED2 = 78.0; const float SEED3 = 437.0; float random (in vec2 st) { return fract(sin(dot(st.xy, vec2(SEED1,SEED2)))*SEED3); } float noise (in vec2 st) { vec2 i = floor(st); vec2 fu = fract(st); float a = random(i); float b = random(i + vec2(1.0, u_sqr));//1.0 float c = random(i + vec2(0.0, 1.0)); float d = random(i + vec2(1.0, 1.0)); vec2 u = fu * fu * (3.0 - 2.0 * fu); return mix(a, b, u.x) +(c - a)* u.y * (1.0 - u.x) +(d - b) * u.x * u.y; } #define OCTAVES 24 float fbm (in vec2 st) { float value = 0.0; float amplitude = 0.2;//u_amp;//0.1,0.24 float frequency = 0.1; for (int i = 0; i < OCTAVES; i++) { value += amplitude * noise(st); st *= u_octave; amplitude *= .45; } return value; } float fbm6( in vec2 p ) { vec2 q = vec2( fbm( p + vec2(0.0,0.0) ), fbm( p + vec2(0.0,2.0) ) ); vec2 r = vec2( fbm( p + 4.0*q + vec2(4.0,3.0)), fbm( p + 4.0*q + vec2(0.0,0.0))); return fbm( p + 1.0 * r ); // 2.0, 6.0 } void main() { vec2 st = gl_FragCoord.xy/uResolution.xy; vec2 uv = vTexCoord; uv.y = 1.0 - uv.y; vec2 texelSize = 1.0 / uResolution; vec2 offset; float scale = 0.1; float offset2 = 0.1; float angle; angle = noise(st / uv * 0.2) * PI * 1.0; float radius = offset2; st *= scale; offset = texelSize * vec2(0.0,0.0) - fbm6(uv) + 0.15; vec4 color = vec4(0.0); float div; float mult = 1.0; color += texture2D(uTexture0, uv + vec2(offset.x, offset.y)); if(u_fbmC < 0.65){ color += texture2D(uTexture0, uv + vec2(offset.x, offset.y) * 4.0); mult = 2.0; } color += fbm(uv*2.0); div = 1.1*mult; color /= div; color += vec4(0.0,-0.01,-0.02,0.0); gl_FragColor = color; } `,bvertexsh=` attribute vec3 aPosition; attribute vec2 aTexCoord; varying vec2 vTexCoord; void main() { vTexCoord = aTexCoord; vec4 positionVec4 = vec4(aPosition, 1.0); positionVec4.xy = positionVec4.xy * 2.0 - 1.0; gl_Position = positionVec4; }`,bfragsh=` precision mediump float; #define PI 3.14159265359 varying vec2 vTexCoord; uniform sampler2D uTexture0; uniform float u_time; uniform vec2 uResolution; uniform vec2 uScale; uniform float u_rand; uniform vec2 u_mouse; uniform float u_blurSel1; uniform float u_blurSel2; uniform float uvChooser; uniform float uvChooser2; uniform float u_intensity; uniform float u_roundness; uniform float u_angleC; uniform float u_radC; uniform float u_darkC; uniform float u_dirR; uniform float u_noiseC; uniform float u_blurSc; uniform float u_random; uniform float u_rSeed1; uniform float u_rSeed2; uniform float u_rSeed3; uniform float u_angleC2; uniform float u_radC2; uniform float u_dirR2; const float PHI = 1.61803398874989484820459; const float SEED = 43758.0; float random(in vec2 st) { return fract(tan(distance(st*PHI*1.0, st * PI*1.0)*SEED)*st.x); } float noise (in vec2 st) { vec2 i = floor(st); vec2 fu = fract(st); float a = random(i); float b = random(i + vec2(1.0, 0.0)); float c = random(i + vec2(0.0, 1.0)); float d = random(i + vec2(1.0, 1.0)); vec2 u = fu * fu * (3.0 - 2.0 * fu); return mix(a, b, u.x) +(c - a)* u.y * (1.0 - u.x) + (d - b) * u.x * u.y; } void main() { vec2 st = gl_FragCoord.xy/uResolution.xy; vec2 uv = vTexCoord; if(uvChooser > 0.60){ uv.y = 1.0 - uv.y; } vec2 texelSize = 1.0 / uResolution; vec2 offset; float scale = u_intensity; float offset2 = u_roundness; float angle; if(u_angleC > 0.90){ angle = noise(st / uv * u_random) * PI * 1.0; }else if(u_angleC > 0.65){ angle = noise(st + uv * u_random) * PI * 1.0; }else if(u_angleC > 0.40){ angle = noise(st - uv * u_random) * PI * 1.0; }else{ angle = noise(st / mod(uv, st) * u_random) * PI * 1.0; } float radius = offset2; st *= scale; if(u_radC > 0.90){ st *= radius * vec2(fract(angle * st.x), fract(angle / st.y)); }else if(u_radC > 0.70){ st *= radius * vec2(fract(angle / st.x), fract(angle / st.y)); }else if(u_radC > 0.45){ st *= radius * vec2(tan(angle * st.x), fract(angle / st.y)); }else if(u_radC > 0.25){ st *= radius * vec2(sin(angle * mod(st.x,st.y)), sin(angle / st.y *sin(st.x))); }else{ st *= radius * noise(vec2(sin(angle), cos(angle)) / st * fract(uv)); } if(u_radC2 < 0.50){ st *= radius * vec2(tan(angle/st.x) * cos(angle * st.x), sin(angle * st.y) + fract(st.y/angle)); }else{ } vec4 color = vec4(0.0); float div; if(u_dirR > 0.90){ color += texture2D(uTexture0, uv + vec2(-st.y,st.x));//"Sağ" }else if(u_dirR > 0.70){ color += texture2D(uTexture0, uv + vec2(-st.y,-st.x));//"Sağ2" }else if(u_dirR > 0.65){ color += texture2D(uTexture0, uv + vec2(st.y,st.x));//"Norm" }else if(u_dirR > 0.50){ color += texture2D(uTexture0, uv + vec2(st.y,-st.x));//"Norm2" }else if(u_dirR > 0.30){ color += texture2D(uTexture0, uv + vec2(st.y*uv.y, st.x));//"SinsizUst" }else{ color += texture2D(uTexture0, uv + vec2(st.x,uv.y));// "AlttanTarama" } color -= texture2D(uTexture0, uv + noise(vec2(st.x, st.y) / random(uv))); div = 0.40; color /= div; color += vec4(0.12,0.12,0.12,1.0); gl_FragColor = color; } `;function setup(){let e=16/9;createCanvas(1e3,1e3*e),pg=createGraphics(1e3,1e3*e),fbmPg=createGraphics(1e3,1e3*e,WEBGL),blurBg=createGraphics(1e3,1e3*e,WEBGL),granPg=createGraphics(1e3,1e3*e),fbmShader=fbmPg.createShader(fvertexsh,ffragsh),blurShader=blurBg.createShader(bvertexsh,bfragsh),pixelDensity(pix),colorMode(HSB,360,100,100,1),background(20,10,80),rectMode(CENTER),pg.pixelDensity(pix),pg.colorMode(HSB,360,100,100,1),pg.background(20,10,80),pg.rectMode(CENTER),blurBg.pixelDensity(pix),blurBg.colorMode(HSB,360,100,100,1),blurBg.background(20,10,80),blurBg.rectMode(CENTER),fbmPg.pixelDensity(pix),fbmPg.colorMode(HSB,360,100,100,1),fbmPg.background(20,10,80),fbmPg.rectMode(CENTER),granPg.pixelDensity(pix),granPg.colorMode(HSB,360,100,100,1),granPg.rectMode(CENTER);let $=new Random;rSeed=999999*$.random_dec(),nSeed=999999*$.random_dec(),nSeed1=1874915*$.random_dec(),nSeed2=158719*$.random_dec(),nSeed3=527915*$.random_dec(),randomSeed(rSeed),noiseSeed(nSeed);for(let t=0;t<13e3;t++)granPg.stroke(0,0,random(40,80),random(.7)),granPg.strokeWeight(random(.5)),granPg.point(random(width),random(height));colPic=random(1);let r=random(1);colPic>.6?r<.4?(col1=190,col2=10,col3=30):(col1=30,col2=190,col3=10):colPic>.2?(col1=220,col2=20,col3=180):(col1=20,col2=220,col3=180),briMult=1,briMult2=1,sw=1.5*map(pix,1,7,2,2.35),yatayChooser=random(1),shaderC=random(1),soloChooser=random(1),noiseRandom1=random(45,55),noiseRandom2=random(45,55),noiseRandom3=random(45,55),wi=random(15,20),drawAngle=random(1),colPic2=random(1),uvChooser=random([0,1,1]),uvChooser2=random([0,0,0,1]),rotCh=random([0,1,2,3,0,0]),randRan=random(1),denC=random(1),sinC=random(1),dirCr=random(1),uAmp=random(.15,.24),uOctave=random(2.1,5),uFbmAmp=random(1,4),uRoundness=random(1),uAngleC=random(1),uSqr=0,stC=random(1),uRand=random(1),uRand2=random(1),rotateC=random(1),strokesSc=random([.5,1,1]),blurSc=random([.5,1,1]),uniRand1=round(random(.2,.4),2),uniRand2=round(random(.1,.4),2),fbmC=random(1),noiseC=1,kalCh=random(1),angleC=random(1),radC=random(1),dirR=random(1),angleC2=random(1),radC2=random(1),dirR2=random(1),intensityC=round(random(.1,2),4),roundnessC=round(random(.05,.16),4),"Eye"==(combName=(combinationC=random(1))>.93?"Eye":combinationC>.8?"LeftEye":combinationC>.7?"LightSaber":combinationC>.64?"AltSaber":combinationC>.55?"Relief":combinationC>.51?"Fractured":combinationC>.47?"BigBend":combinationC>.35?"Tim":combinationC>.28?"Mag":combinationC>.2?"Tim2":combinationC>.1?"RectDrift":"Rect")&&(angleC=.66,radC=.46,dirR=0,radC2=1,intensityC=round(random(.9,1.35),4),roundnessC=round(random(.05,.22),4),soloChooser=random([1,1,0]),kalCh=random([0,0,1,1,0]),0==soloChooser&&1==kalCh&&(drawAngle=1,sinC=1),uvChooser=1,yatayChooser=0,fbmC=0),"LeftEye"==combName&&(angleC=.41,radC=.46,dirR=0,radC2=random([1,1,0]),intensityC=round(random(1,1.75),4),roundnessC=round(random(.05,.22),4),soloChooser=random([1,1,0,1]),kalCh=random([0,0,1]),0==soloChooser&&1==kalCh&&(drawAngle=1,sinC=1),intensityC=1,yatayChooser=0,fbmC=0),"LightSaber"==combName&&(angleC=.66,radC=.46,dirR=0,radC2=1,intensityC=round(random(.1,.4),4),roundnessC=round(random(.05,.16),4),yatayChooser=0,fbmC=random([0,0,1])),"AltSaber"==combName&&(angleC=.66,radC=.95,dirR=0,radC2=1,intensityC=round(random(.1,2),4),roundnessC=round(random(.05,.16),4),yatayChooser=0,fbmC=random([0,0,1])),"Relief"==combName&&(angleC=.41,radC=random([.26,.56,.96]),radC2=0,dirR=0,intensityC=round(random(1.8,2),4),roundnessC=round(random(.11,.16),4),uniRand1=.3,yatayChooser=0,soloChooser=random([1,0,1]),kalCh=0,uvChooser=random([0,1]),fbmC=0),"Fractured"==combName&&(angleC=.41,radC=.26,dirR=random([0,0,.71,0]),radC2=1,intensityC=round(random(1.5,2),4),roundnessC=round(random(.05,.16),4),yatayChooser=0,uvChooser=0,fbmC=0),"BigBend"==combName&&(angleC=.66,radC=.46,dirR=random([.91,.51,.66,.71]),radC2=random([1,1,0]),intensityC=round(random(.7,1.2),4),roundnessC=round(random(.05,.14),4),yatayChooser=1,shaderC=0,fbmC=0),"Tim"==combName&&(angleC=.41,radC=.46,dirR=.71,radC2=1,intensityC=round(random(1.5,2),4),roundnessC=round(random(.05,.14),4),uvChooser=random([0,0,1]),yatayChooser=0,0==(soloChooser=random([0,1,1]))&&(kalCh=0),fbmC=random([0,0,1])),"Mag"==combName&&(angleC=.41,radC=.46,dirR=.71,radC2=1,intensityC=round(random(.8,1.1),4),roundnessC=round(random(.1,.16),4),yatayChooser=0,soloChooser=random([1,1,0]),kalCh=random([0,0,1]),0==soloChooser&&1==kalCh&&(drawAngle=1,sinC=1),uvChooser=0,fbmC=random([0,1])),"Tim2"==combName&&(angleC=.66,radC=.46,dirR=.51,radC2=1,intensityC=round(random(1,1.5),4),roundnessC=round(random(.05,.16),4),yatayChooser=0,uvChooser=0,soloChooser=1,fbmC=0),"RectDrift"==combName&&(angleC=.91,radC=.46,dirR=0,radC2=random([0,1,1]),intensityC=round(random(1.5,2),4),roundnessC=round(random(.05,.16),4),0==(uvChooser=random([0,1,1,0]))&&(yatayChooser=random([0,1,0])),1==uvChooser&&(yatayChooser=random([0,1,0]),rotCh=0),1==yatayChooser&&(shaderC=0,fbmC=0,kalCh=1),fbmC=0),"Rect"==combName&&(angleC=.91,radC=.46,dirR=.71,radC2=1,intensityC=round(random(1.5,3.2),4),roundnessC=round(random(.05,.16),4),yatayChooser=0,uvChooser=0,fbmC=0),shaderC="fbm",yataStr=0==yatayChooser?"ver":"hor",darkC=0,soloChooser<.5?(soloChooser="Solo","hor"==yataStr&&(soloChooser="Triplet")):soloChooser="Triplet",max=drawAngle<.8?random(.1,.3):PI/2,placements(),console.log(combName);for(var o=0;o<1800;o++){let l=random(1);stars[o]=new Star(l)}}function draw(){noStroke(),pg.noStroke();let e,$,t;frameRate(60),"ver"==yataStr&&(sek=0),"hor"==yataStr&&(sek=-PI/2),sinC<.7?(noiseSeed(nSeed1),e=map(noise(xoff1/noiseRandom1,frameCount/noiseRandom1/1),0,1,-max,max),noiseSeed(nSeed2),$=map(noise(xoff1/noiseRandom2,frameCount/noiseRandom2/1),0,1,-max,max),noiseSeed(nSeed3),t=map(noise(xoff1/noiseRandom3,frameCount/noiseRandom3/1),0,1,-max,max)):(noiseSeed(nSeed1),e=map(sin(frameCount/50),-1,1,-max,max),noiseSeed(nSeed2),$=map(sin(frameCount/75),-1,1,-max,max),noiseSeed(nSeed3),t=map(sin(frameCount/noiseRandom3),-1,1,-max,max)),xoff1+=.1,xoff2+=.2,xoff3+=.3;let r=e,o=e,l=e,a=$,s=$,i=$,_=t,n=t,u=t;counter+=1,noiseSeed(nSeed1);let f=2.5*map(noise(frameCount/(1e3/random(.8,1.1))/.5),0,1,.1,.7),d=2.5*map(noise(frameCount/(1050/random(.9,1.2))/.5),0,1,.1,.7),m=2.5*map(noise(frameCount/(950/random(.8,1.2))/.5),0,1,.1,.7);noiseSeed(nSeed2);let p=2.5*map(noise(frameCount/(950/random(.9,1.2))/.5),0,1,.1,.7),C=2.5*map(noise(frameCount/(1050/random(.8,1.2))/.5),0,1,.1,.7),h=2.5*map(noise(frameCount/(1e3/random(.8,1.1))/.5),0,1,.1,.7);noiseSeed(nSeed3);let g=2.5*map(noise(frameCount/(1050/random(.9,1.2))/.5),0,1,.1,.7),v=2.5*map(noise(frameCount/(1e3/random(.8,1.2))/.5),0,1,.1,.7),b=2.5*map(noise(frameCount/(950/random(.8,1.1))/.5),0,1,.1,.7);noiseSeed(nSeed),pg.push();for(let y=0;y<particles.length;y+=1){let x=map(sin(particles[y].y*mult/particles[y].x*mult),0,1,-sek,sek),S=map(sin(particles2[y].y*mult/particles2[y].x*mult),0,1,-sek,sek),w=map(sin(particles3[y].y*mult/particles3[y].x*mult),0,1,-sek,sek);x+=r,S+=o,w+=l,vec=createVector(sin(1*x),cos(x)),vec2=createVector(sin(1*S),cos(S)),vec3=createVector(sin(1*w),cos(w)),vec.setMag(f*(sw/2)),vec2.setMag(d*(sw/2)),vec3.setMag(m*(sw/2)),particles[y].add(vec),particles2[y].add(vec2),particles3[y].add(vec3);let R=map(noise(particles[y].x*mult,particles[y].y*mult*100,frameCount*mult*20),0,1,0,1),k=map(noise(particles2[y].x*mult,particles2[y].y*mult*92,frameCount*mult*20),0,1,0,1),P=map(noise(particles3[y].x*mult,particles3[y].y*mult*92,frameCount*mult*20),0,1,0,1);if("ver"==yataStr&&(bol1=particles[y].y<height&&particles[y].y>0,bol2=particles2[y].y<height&&particles2[y].y>0,bol3=particles3[y].y<height&&particles3[y].y>0),"hor"==yataStr&&(bol1=particles[y].x<width&&particles[y].x>0,bol2=particles2[y].x<width&&particles2[y].x>0,bol3=particles3[y].x<width&&particles3[y].x>0),bol1&&(pg.fill(col1,random(60,80),random(30,50)*briMult,R),pg.ellipse(particles[y].x+5*R*random(-1,1),particles[y].y,sw)),bol2&&(pg.fill(col2,random(10,40)*briMult,random(5,20)*briMult2,k),pg.ellipse(particles2[y].x,particles2[y].y,sw)),bol3&&(pg.fill(col3,random(60,80),random(40,80),P),"ver"==yataStr&&particles3[y].y>=height-5&&(flag1=!0,fr=frameCount),"hor"==yataStr&&particles3[y].x>=width-5&&(flag1=!0,fr=frameCount),pg.ellipse(particles3[y].x,particles3[y].y,1*sw)),0==yatayChooser){let T=min(particles[y].y,particles2[y].y),U=min(particles2[y].y,particles3[y].y);progress=min(T,U)}else{let B=min(particles[y].x,particles2[y].x),M=min(particles2[y].x,particles3[y].x);progress=min(B,M)}}if("Triplet"==soloChooser){for(let D=0;D<particles4.length;D+=1){let V=map(sin(particles4[D].y*mult/particles4[D].x*mult),0,1,-sek,sek),A=map(sin(particles5[D].y*mult/particles5[D].x*mult),0,1,-sek,sek),E=map(sin(particles6[D].y*mult/particles6[D].x*mult),0,1,-sek,sek);V+=a,A+=s,E+=i,vec4=createVector(sin(1*V),cos(V)),vec5=createVector(sin(1*A),cos(A)),vec6=createVector(sin(1*E),cos(E)),vec4.setMag(p*(sw/2)),vec5.setMag(C*(sw/2)),vec6.setMag(h*(sw/2)),particles4[D].add(vec4),particles5[D].add(vec5),particles6[D].add(vec6);let z=map(noise(particles4[D].x*mult,particles4[D].y*mult*100,frameCount*mult*20),0,1,0,1),N=map(noise(particles5[D].x*mult,particles5[D].y*mult*92,frameCount*mult*20),0,1,0,1),I=map(noise(particles6[D].x*mult,particles6[D].y*mult*92,frameCount*mult*20),0,1,0,1);if("ver"==yataStr&&(bol1=particles4[D].y<height&&particles4[D].y>0,bol2=particles5[D].y<height&&particles5[D].y>0,bol3=particles6[D].y<height&&particles6[D].y>0),"hor"==yataStr&&(bol1=particles4[D].x<width&&particles4[D].x>0,bol2=particles5[D].x<width&&particles5[D].x>0,bol3=particles6[D].x<width&&particles6[D].x>0),bol1&&(pg.fill(col1,random(60,80),random(30,50)*briMult,z),pg.ellipse(particles4[D].x+5*z*random(-1,1),particles4[D].y,sw)),bol2&&(pg.fill(col2,random(10,40)*briMult,random(5,20)*briMult2,N),pg.ellipse(particles5[D].x,particles5[D].y,sw)),bol3&&(pg.fill(col3,random(60,80),random(40,80),I),"ver"==yataStr&&particles6[D].y>=height-5&&(flag2=!0,fr=frameCount),"hor"==yataStr&&particles6[D].x>=width-5&&(flag2=!0,fr=frameCount),pg.ellipse(particles6[D].x,particles6[D].y,1*sw)),0==yatayChooser){let q=min(particles4[D].y,particles5[D].y);progress2=min(q,particles6[D].y)}else{let F=min(particles4[D].x,particles5[D].x);progress2=min(F,particles6[D].x)}}for(let L=0;L<particles7.length;L+=1){let H=map(sin(particles7[L].y*mult/particles7[L].x*mult),0,1,-sek,sek),O=map(sin(particles8[L].y*mult/particles8[L].x*mult),0,1,-sek,sek),j=map(sin(particles9[L].y*mult/particles9[L].x*mult),0,1,-sek,sek);H+=_,O+=n,j+=u,vec7=createVector(sin(1*H),cos(H)),vec8=createVector(sin(1*O),cos(O)),vec9=createVector(sin(1*j),cos(j)),vec7.setMag(g*(sw/2)),vec8.setMag(v*(sw/2)),vec9.setMag(b*(sw/2)),particles7[L].add(vec7),particles8[L].add(vec8),particles9[L].add(vec9);let G=map(noise(particles7[L].x*mult,particles7[L].y*mult*100,frameCount*mult*20),0,1,0,1),W=map(noise(particles8[L].x*mult,particles8[L].y*mult*92,frameCount*mult*20),0,1,0,1),J=map(noise(particles9[L].x*mult,particles9[L].y*mult*92,frameCount*mult*20),0,1,0,1);if("ver"==yataStr&&(bol1=particles7[L].y<height&&particles7[L].y>0,bol2=particles8[L].y<height&&particles8[L].y>0,bol3=particles9[L].y<height&&particles9[L].y>0),"hor"==yataStr&&(bol1=particles7[L].x<width&&particles7[L].x>0,bol2=particles8[L].x<width&&particles8[L].x>0,bol3=particles9[L].x<width&&particles9[L].x>0),bol1&&(pg.fill(col1,random(60,80),random(30,50)*briMult,G),pg.ellipse(particles7[L].x+5*G*random(-1,1),particles7[L].y,sw)),bol2&&(pg.fill(col2,random(10,40)*briMult,random(5,20)*briMult2,W),pg.ellipse(particles8[L].x,particles8[L].y,sw)),bol3&&(pg.fill(col3,random(60,80),random(40,80),J),"ver"==yataStr&&particles9[L].y>=height-5&&(flag3=!0,fr=frameCount),"hor"==yataStr&&particles9[L].x>=width-5&&(flag3=!0,fr=frameCount),pg.ellipse(particles9[L].x,particles9[L].y,1*sw)),0==yatayChooser){let K=min(particles7[L].y,particles8[L].y);progress3=min(K,particles9[L].y)}else{let Q=min(particles7[L].x,particles8[L].x);progress3=min(Q,particles9[L].x)}}}if(pg.pop(),push(),background(0,0,10,.5),"Triplet"==soloChooser){let X=min(progress,progress2);progress=min(X,progress3)}let Y;Y=0==yatayChooser?height:width;let Z=floor(map(progress,0,Y,0,100));fill(0,0,80),noStroke(),textSize(25),textAlign(CENTER,CENTER),text("%"+Z,width/2,height/2),speed=progress/50,translate(width/2,height/2);for(var ee=0;ee<stars.length;ee++)stars[ee].update(),stars[ee].show();if(translate(-width/2,-height/2),image(granPg,0,0),pop(),bolBol="Triplet"==soloChooser?flag1&&flag2&&flag3:flag1){fbmShader.setUniform("uTexture0",pg),fbmShader.setUniform("u_time",millis()/1e3),fbmShader.setUniform("u_middle",[mouseX,mouseY]),fbmShader.setUniform("u_amp",uAmp),fbmShader.setUniform("uResolution",[width,height]),fbmShader.setUniform("uPla",[width,height]),fbmShader.setUniform("u_octave",uOctave),fbmShader.setUniform("u_fbmAmp",uFbmAmp),fbmShader.setUniform("u_roundness",uRoundness),fbmShader.setUniform("u_angleC",uAngleC),fbmShader.setUniform("u_sqr",uSqr),fbmShader.setUniform("u_fbmC",fbmC),fbmPg.noStroke(),fbmPg.shader(fbmShader),fbmPg.rect(0,0,width,height),frameRate(1);for(let e$=0;e$<125;e$++){let et=random(1);et>.66?pg.fill(col3,random(60,80)/1,random(40,80),1):et>.33?pg.fill(col2,random(10,40)/1,random(0,20),1):pg.fill(col1,random(60,80)/1,random(30,50),1),el(random(width),random(height),randomGaussian(2,7),e$)}(c+=1)>2&&(flag4=!0,frameRate(60))}if(flag4&&(blurShader.setUniform("uTexture0",fbmPg),blurShader.setUniform("u_time",millis()/1e3),blurShader.setUniform("uScale",[4,4]),blurShader.setUniform("u_middle",[mouseX,mouseY]),blurShader.setUniform("u_rand",random(0,2)),blurShader.setUniform("uResolution",[width,height]),blurShader.setUniform("uPla",[width,height]),blurShader.setUniform("uvChooser",uvChooser),blurShader.setUniform("uvChooser2",uvChooser2),blurShader.setUniform("u_intensity",intensityC),blurShader.setUniform("u_roundness",roundnessC),blurShader.setUniform("u_angleC",angleC),blurShader.setUniform("u_radC",radC),blurShader.setUniform("u_darkC",darkC),blurShader.setUniform("u_dirR",dirR),blurShader.setUniform("u_noiseC",noiseC),blurShader.setUniform("u_blurSc",blurSc),blurShader.setUniform("u_random",uniRand1),blurShader.setUniform("u_rSeed1",rSeed1),blurShader.setUniform("u_rSeed2",rSeed2),blurShader.setUniform("u_rSeed3",rSeed3),blurShader.setUniform("u_angleC2",angleC2),blurShader.setUniform("u_radC2",radC2),blurShader.setUniform("u_dirR2",dirR2),blurBg.noStroke(),blurBg.shader(blurShader),blurBg.rect(0,0,width,height),push(),0==rotCh?(translate(0,0),scale(1,1)):1==rotCh?(translate(width,0),scale(-1,1)):2==rotCh?(translate(width,height),scale(-1,-1)):3==rotCh&&(translate(0,height),scale(1,-1)),image(blurBg,0,0),pop(),(c2+=1)>2)){for(let er=0;er<150;er++){let eo=random(1);eo>.66?fill(col3,random(60,80)/2,random(40,80),1):eo>.33?fill(col2,random(10,40)/2,random(0,20),1):fill(col1,random(60,80)/2,random(30,50),1),elN(random(width),random(height),random(2,7),er)}granulate(25),frame(),noLoop()}}function frame(){push(),rectMode(CORNER),fill(0,0,87),beginShape(),vertex(0,0);for(let e=0;e<width/wi;e++)vertex(e*wi+random(-wi/10,wi/10),wi+random(-wi/10,wi/10));vertex(width,wi),vertex(width,0),endShape(),beginShape(),vertex(0,0);for(let $=0;$<height/wi;$++)vertex(wi+random(-wi/10,wi/10),$*wi+random(-wi/10,wi/10));vertex(wi,height),vertex(0,height),endShape(),beginShape(),vertex(0,height-wi);for(let t=0;t<width/wi;t++)vertex(t*wi+random(-wi/10,wi/10),height-wi+random(-wi/10,wi/10));vertex(width,height),vertex(0,height),endShape(),beginShape(),vertex(width-wi,0);for(let r=0;r<height/wi;r++)vertex(width-wi+random(-wi/10,wi/10),r*wi+random(-wi/10,wi/10));vertex(width,height),vertex(width,0),endShape(),pop()}function el(e,$,t,r){pg.beginShape();for(let o=0;o<TAU;o+=PI/60){let l=map(noise(1*o,1*r),0,1,0,7),a=e+cos(o)*t/1.5+l,s=$+sin(o)*t/1.5+l;pg.vertex(a,s)}pg.endShape(CLOSE)}function elN(e,$,t,r){beginShape();for(let o=0;o<TAU;o+=PI/60){let l=map(noise(1*o,1*r),0,1,0,7),a=e+cos(o)*t/1.5+l,s=$+sin(o)*t/1.5+l;vertex(a,s)}endShape(CLOSE)}function placements(){if("ver"==yataStr){let e=random([200,100,100,200,500]),$=200,t=400,r=200,o=700;"Solo"==soloChooser&&(kalCh<.25?(t=200,r=600):(t=400,r=200));let l=2-e/5,a=2-e/5,s=2-e/5;for(let i=t;i<t+r;i+=2){let _=l+noise(.04*i,.02*frameCount)*e,n=createVector(i,_);particles.push(n)}for(let u=t;u<t+r;u+=2){let f=l+noise(.08*u,.03*frameCount)*e,d=createVector(u,f);particles2.push(d)}for(let m=t;m<t+r;m+=2){let p=l+noise(.038*m,.01*frameCount)*e,C=createVector(m,p);particles3.push(C)}for(let h=$;h<$+100;h+=2){let g=a+noise(.034*h,.097*frameCount)*e,v=createVector(h,g);particles4.push(v)}for(let b=$;b<$+100;b+=2){let y=a+noise(.045*b,.034*frameCount)*e,x=createVector(b,y);particles5.push(x)}for(let S=$;S<$+100;S+=2){let w=a+noise(.042*S,.046*frameCount)*e,R=createVector(S,w);particles6.push(R)}for(let k=o;k<o+100;k+=2){let P=s+noise(.04*k,.02*frameCount)*e,T=createVector(k,P);particles7.push(T)}for(let U=o;U<o+100;U+=2){let B=s+noise(.027*U,.067*frameCount)*e,M=createVector(U,B);particles8.push(M)}for(let D=o;D<o+100;D+=2){let V=s+noise(.045*D,.08*frameCount)*e,A=createVector(D,V);particles9.push(A)}}if("hor"==yataStr){let E=random([200,100,100,200,500]),z=200,N=400,I=200,q=700,F=1e3,L=1200,H=1500;kalCh<.2?(N=200,I=600,L=976):(N=400,I=200,L=1200);for(let O=N;O<N+I;O+=2){let j=5+noise(.04*O,.02*frameCount)*E,G=createVector(j,O);particles.push(G)}for(let W=N;W<N+I;W+=2){let J=5+noise(.08*W,.03*frameCount)*E,K=createVector(J,W);particles2.push(K)}for(let Q=N;Q<N+I;Q+=2){let X=5+noise(.038*Q,.08*frameCount)*E,Y=createVector(X,Q);particles3.push(Y)}for(let Z=z;Z<z+100;Z+=2){let ee=5+noise(.04*Z,.02*frameCount)*E,e$=createVector(ee,Z);particles4.push(e$)}for(let et=z;et<z+100;et+=2){let er=5+noise(.08*et,.03*frameCount)*E,eo=createVector(er,et);particles5.push(eo)}for(let ea=z;ea<z+100;ea+=2){let es=5+noise(.038*ea,.08*frameCount)*E,ei=createVector(es,ea);particles6.push(ei)}for(let e_=q;e_<q+100;e_+=2){let en=5+noise(.04*e_,.02*frameCount)*E,ec=createVector(en,e_);particles7.push(ec)}for(let eu=q;eu<q+100;eu+=2){let e0=5+noise(.08*eu,.03*frameCount)*E,ef=createVector(e0,eu);particles8.push(ef)}for(let ed=q;ed<q+100;ed+=2){let em=5+noise(.038*ed,.08*frameCount)*E,ep=createVector(em,ed);particles9.push(ep)}for(let eC=L;eC<L+I;eC+=2){let eh=5+noise(.04*eC,.02*frameCount)*E,eg=createVector(eh,eC);particles.push(eg)}for(let ev=L;ev<L+I;ev+=2){let eb=5+noise(.08*ev,.03*frameCount)*E,ey=createVector(eb,ev);particles2.push(ey)}for(let ex=L;ex<L+I;ex+=2){let e3=5+noise(.038*ex,.08*frameCount)*E,e2=createVector(e3,ex);particles3.push(e2)}for(let eS=F;eS<F+100;eS+=2){let e1=5+noise(.04*eS,.02*frameCount)*E,e4=createVector(e1,eS);particles4.push(e4)}for(let e6=F;e6<F+100;e6+=2){let e8=5+noise(.08*e6,.03*frameCount)*E,e7=createVector(e8,e6);particles5.push(e7)}for(let ew=F;ew<F+100;ew+=2){let eR=5+noise(.038*ew,.08*frameCount)*E,e5=createVector(eR,ew);particles6.push(e5)}for(let ek=H;ek<H+100;ek+=2){let eP=5+noise(.04*ek,.02*frameCount)*E+10,eT=createVector(eP,ek);particles7.push(eT)}for(let eU=H;eU<H+100;eU+=2){let eB=5+noise(.08*eU,.03*frameCount)*E+10,eM=createVector(eB,eU);particles8.push(eM)}for(let eD=H;eD<H+100;eD+=2){let eV=5+noise(.038*eD,.08*frameCount)*E+10,eA=createVector(eV,eD);particles9.push(eA)}}}function granulate(e){loadPixels();let $=pixelDensity(),t=4*(width*$)*(height*$);for(let r=0;r<t;r+=4){let o=random(-e,e);pixels[r]=pixels[r]+o,pixels[r+1]=pixels[r+1]+o,pixels[r+2]=pixels[r+2]+o}updatePixels()}function granulateGran(e){granPg.loadPixels();let $=pixelDensity(),t=4*(width*$)*(height*$);for(let r=0;r<t;r+=4){let o=random(-e,e);pixels[r]=pixels[r]+o,pixels[r+1]=pixels[r+1]+o,pixels[r+2]=pixels[r+2]+o}granPg.updatePixels()}function keyPressed(){("s"==key||"S"==key)&&saveCanvas("DistCollective_SpatialCurvatures","png")}class Random{constructor(){this.useA=!1;let e=function(e){let $=parseInt(e.substr(0,8),16),t=parseInt(e.substr(8,8),16),r=parseInt(e.substr(16,8),16),o=parseInt(e.substr(24,8),16);return function(){r|=0;let e=(($|=0)+(t|=0)|0)+(o|=0)|0;return o=o+1|0,$=t^t>>>9,t=r+(r<<3)|0,r=(r=r<<21|r>>>11)+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substr(2,32)),this.prngB=new e(tokenData.hash.substr(34,32));for(let $=0;$<1e6;$+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}}class Star{constructor(e){this.x=random(-width,width),this.y=random(-height,height),this.z=random(width),this.pz=this.z,this.co=e}update(){this.z=this.z-speed,this.z<1&&(this.z=width,this.x=random(-width,width),this.y=random(-height,height),this.pz=this.z)}show(){this.co>.66?fill(col3,random(60,80)/1,random(40,80),1):this.co>.33?fill(col2,random(10,40)/1,random(50,60),1):fill(col1,random(60,80)/1,random(30,50),1),noStroke();var e=map(this.x/this.z,0,1,0,width),$=map(this.y/this.z,0,1,0,height),t=map(this.z,0,width,16,0);ellipse(e,$,t,t);var r=map(this.x/this.pz,0,1,0,width),o=map(this.y/this.pz,0,1,0,height);this.pz=this.z,this.co>.66?stroke(col3,random(60,80)/1,random(40,80),1):this.co>.33?stroke(col2,random(10,40)/1,random(50,60),1):stroke(col1,random(60,80)/1,random(30,50),1),line(r,o,e,$)}}
(()=>{"use strict";{const n=t=>new Float32Array(t),o=2*Math.PI,c=Math.cos,f=Math.sin,l=Math.pow,s=Math.sqrt,u=Math.floor,v=Math.abs,b=Math.min,h=Math.max;class A{constructor(t,e,r,a,i,n,o,c=!1){this.x=t,this.y=e,this.z=r,this.frac=a,this.s=i,this.angle=n,this.frac2=1,this.frac4=1,this.fc=0,this.active=c,this.done=!1}}const p={init(t){this.r=this.alea(t),this.p=this.bp(this.r),this.perm=new Uint8Array(512),this.p12=new Uint8Array(512);for(var e=0;e<512;e++)this.perm[e]=this.p[255&e],this.p12[e]=this.perm[e]%12},bp(t){var e,r=new Uint8Array(256);for(e=0;e<256;e++)r[e]=e;for(e=0;e<255;e++){var a=e+~~(t()*(256-e)),i=r[e];r[e]=r[a],r[a]=i}return r},masher(){var t=4022871197;return function(e){e=e.toString();for(var r=0;r<e.length;r++){var a=.02519603282416938*(t+=e.charCodeAt(r));a-=t=a>>>0,t=(a*=t)>>>0,t+=4294967296*(a-=t)}return 2.3283064365386963e-10*(t>>>0)}},alea(){var t=0,e=0,r=0,a=1,i=this.masher();t=i(" "),e=i(" "),r=i(" ");for(var n=0;n<arguments.length;n++)(t-=i(arguments[n]))<0&&(t+=1),(e-=i(arguments[n]))<0&&(e+=1),(r-=i(arguments[n]))<0&&(r+=1);return i=null,function(){var i=2091639*t+2.3283064365386963e-10*a;return t=e,e=r,r=i-(a=0|i)}}},x=(a=[[3546,3490,3456,1364,0],[3822,4095,3549,2457,4095],[0,4095,3549,0],[18,375,1688,4041,3619],[0,679,120,3324,341,50,34],[3892,3106,2050,1536,768,512],[618,72,38,19,18,2],[3171,2131,3478,4023,4093,2455,546,308,18],[4095,3985,2541,715,869,18],[19,1110,2218,2505,3290,3943],[3838,3021,1675,1145,600,54,2],[2115,3685,3990,4041,3547,3566],[1589,3977,2749,89,36],[3021,682,120,86,2236,4044,3805,3959,4072,4023,546],[2982,2710,2728,3511,3780,3800,2728,1638,1124,2184,1638,0,105,71,0,1024,1856,2144,1600,2144,1888,2692],[4042,3447,2425,1111,563,2748],[0,291,4001,3822,4095,869,1465],[785,1552,4090,2624,3459,4090,120],[3994,3976,514,3419,4015,1338,514,787,3766],[512,1794,3141,3957,3989,3635],[3654,4054,218,395,52],[311,2815,3920,4095,0],[0,4095,190,106,3936],[4078,2988,70,154,2543,3567,138,4060],[3685,4084,2507,1450,3822,530,1604]],i=[],{g:function(t){t<0&&(t*=-1),t%=1;let e=i.length,r=u(e*t),a=(r+1)%e,n=e*t-r,o=i[r],c=i[a],f=1-n,s=1/2.2;return[l(l(c[0],s)*n+f*l(o[0],s),2.2),l(l(c[1],s)*n+f*l(o[1],s),2.2),l(l(c[2],s)*n+f*l(o[2],s),2.2)]},i:function(t,e){for(var r=0;r<a[t].length;++r){let n=a[t][r];console.log(n);let o=(15&n)/16,c=(n>>4&15)/16,f=(n>>8&15)/16;e&&(o=h(0,b(1,o+.05*Y()-.025)),c=h(0,b(1,c+.05*Y()-.025)),f=h(0,b(1,f+.05*Y()-.025))),i.push([f,c,o])}}}),m=document.createElement("canvas");m.style="position:absolute;top:0;left:0;right:0;bottom:0;margin:0 auto;",document.body.prepend(m);const d=m.getContext("webgl",{alpha:!1}),E=d.getExtension("ANGLE_instanced_arrays"),g=d.TRIANGLES,_=d.FRAMEBUFFER,y=d.FLOAT,D=d.UNSIGNED_BYTE,T=d.RGBA,R=d.TEXTURE_2D,F=d.COLOR_ATTACHMENT0,w=d.COLOR_BUFFER_BIT|d.DEPTH_BUFFER_BIT,P=d.ARRAY_BUFFER,B=d.STATIC_DRAW,N=d.DYNAMIC_DRAW,L=d.ONE,M=d.ONE_MINUS_SRC_ALPHA,G=d.SRC_ALPHA,U=(t,e,r)=>t.getAttribLocation(e,r),S=(t,e,r)=>t.getUniformLocation(e,r),I=()=>d.createBuffer();let C,H,z,V,O,k,W=[],X=[],q=[];tokenData.tokenId,p.init(tokenData.hash);let Y=p.r,j=2+u(23*Y()),J=Y()>.9,K=Y()>.5,Q=Y()>.7,Z=Y()>.9,$=u(4*Y()),tt=.5+1.2*l(Y(),2),et=Y()>.5,rt=Y()>.9,at=Y()>.7,it=.25+.5*Y(),nt=.1+.7*Y(),ot=Y();x.i(j,J);let ct=[];for(var t=0;t<30;++t){let ve=t/30,be=x.g(ve);ct.push(be[0],be[1],be[2],1)}let ft=200,lt=[];for(t=0;t<ft;++t){let he=t/ft,Ae=x.g(ot+he);lt.push(.6+.4*Ae[0],.6+.4*Ae[1],.6+.4*Ae[2])}x.i(K?1:0);let st=[];for(t=0;t<30;++t){let pe=t/30,xe=x.g(pe);st.push(xe[0],xe[1],xe[2],1)}let ut=window.innerWidth,vt=window.innerHeight,bt=16/9,ht=ut*bt;vt>ht?vt=ht:ut=vt/bt,m.width=ut,m.height=vt;const At=m.clientWidth,pt=m.clientHeight;let xt=Math.min(At,pt),mt=At,dt=pt,Et=[],gt=100,_t=180;for(t=0;t<gt*_t;++t)Et.push([]);function yt(t,e,r){let a=u((t+1)/2*gt),i=u((e+bt)/(2*bt)*_t);a>=0&&a<gt&&i>=0&&i<_t&&Et[a*_t+i].push(r)}function Dt(t,e,r=-1){let a=[],i=u((t+1)/2*gt),n=u((e+bt)/(2*bt)*_t),o=h(0,i-5),c=h(0,n-5),f=b(gt-1,i+5),l=b(_t-1,n+5);for(var s=o;s<=f;++s)for(var v=c;v<=l;++v)for(var A=0;A<Et[s*_t+v].length;++A)a.push(Et[s*_t+v][A]);let p=-1,x=81;for(A=0;A<a.length;++A){let i=a[A];if(i!=r&&0==ee[i].done){let r=ee[i].x,a=ee[i].y,n=(t-r)*(t-r)+(e-a)*(e-a);n<x&&(x=n,p=i)}}return p}function Tt(t,e,r,a){if(v(t)>1||v(e)>bt)return!1;let i=[],n=u((t+1)/2*gt),o=u((e+bt)/(2*bt)*_t),c=h(0,n-2),f=h(0,o-2),l=b(gt-1,n+2),A=b(_t-1,o+2);for(var p=c;p<=l;++p)for(var x=f;x<=A;++x)for(var m=0;m<Et[p*_t+x].length;++m)i.push(Et[p*_t+x][m]);for(m=0;m<i.length;++m){let n=i[m];if(n!=a){let a=ee[n].x,i=ee[n].y,o=ee[n].s;if(s((t-a)*(t-a)+(e-i)*(e-i))-r-o<0)return!1}}return!0}function Rt(){let t=d.createTexture();d.bindTexture(R,t),d.texImage2D(R,0,T,O,k,0,T,D,null),d.texParameteri(R,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(R,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(R,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(R,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);let e=d.createFramebuffer();d.bindFramebuffer(_,e),d.framebufferTexture2D(_,F,R,t,0);const r=d.createRenderbuffer();return d.bindRenderbuffer(d.RENDERBUFFER,r),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,O,k),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,r),d.checkFramebufferStatus(d.FRAMEBUFFER),[t,e]}class Ft{constructor(t,e,r,a=[],i=[]){let n=wt(t,t.VERTEX_SHADER,e),o=wt(t,t.FRAGMENT_SHADER,r);this.p=t.createProgram(),t.attachShader(this.p,n),t.attachShader(this.p,o),t.linkProgram(this.p),this.a=[];for(var c=0;c<a.length;++c)this.a[a[c]]=U(t,this.p,a[c]);for(this.u=[],c=0;c<i.length;++c)this.u[i[c]]=S(t,this.p,i[c])}}function wt(t,e,r){let a=t.createShader(e);return t.shaderSource(a,r),t.compileShader(a),a}function Pt(t,e){d.disable(d.DEPTH_TEST),d.bindBuffer(P,Ht),d.bufferData(P,n(lt),N),d.useProgram(Lt.p),d.bindBuffer(P,Jt),d.enableVertexAttribArray(Lt.a.ap),d.vertexAttribPointer(Lt.a.ap,2,y,!1,0,0),d.bindBuffer(P,Ht),d.enableVertexAttribArray(Lt.a.c0),d.vertexAttribPointer(Lt.a.c0,3,y,!1,0,0),E.vertexAttribDivisorANGLE(Lt.a.c0,1),d.uniform1f(Lt.u.b,t),d.uniform1f(Lt.u.l,e);let r=[];for(var a=0;a<ft;++a){let t=(a+.5)/ft;r.push(2*t-1,1.1/ft)}d.bindBuffer(P,It),d.bufferData(P,n(r),N),d.enableVertexAttribArray(Lt.a.as),d.vertexAttribPointer(Lt.a.as,2,y,!1,0,0),E.vertexAttribDivisorANGLE(Lt.a.as,1),E.drawArraysInstancedANGLE(g,0,6,ft),E.vertexAttribDivisorANGLE(Lt.a.ap,0),E.vertexAttribDivisorANGLE(Lt.a.c0,0),E.vertexAttribDivisorANGLE(Lt.a.as,0)}function Bt(t){d.clear(d.DEPTH_BUFFER_BIT),d.enable(d.DEPTH_TEST),d.useProgram(Nt.p),d.bindBuffer(P,Ut),d.bufferData(P,t?qt:Xt,N),d.enableVertexAttribArray(Nt.a.ap),d.vertexAttribPointer(Nt.a.ap,4,y,!1,0,0),d.bindBuffer(P,St),d.bufferData(P,$t,N),d.enableVertexAttribArray(Nt.a.ac),d.vertexAttribPointer(Nt.a.ac,4,y,!1,0,0),E.vertexAttribDivisorANGLE(Nt.a.ac,1),d.bindBuffer(P,It),d.bufferData(P,Qt,N),d.enableVertexAttribArray(Nt.a.as),d.vertexAttribPointer(Nt.a.as,4,y,!1,0,0),E.vertexAttribDivisorANGLE(Nt.a.as,1),d.bindBuffer(P,Ct),d.bufferData(P,Zt,N),d.enableVertexAttribArray(Nt.a.al),d.vertexAttribPointer(Nt.a.al,2,y,!1,0,0),E.vertexAttribDivisorANGLE(Nt.a.al,1),d.uniform4fv(Nt.u.cols,ct),d.uniform4fv(Nt.u.cols2,st),d.uniform2f(Nt.u.d,mt/xt,dt/xt),E.drawArraysInstancedANGLE(g,0,t?Wt:kt,ie),E.vertexAttribDivisorANGLE(Nt.a.ap,0),E.vertexAttribDivisorANGLE(Nt.a.as,0),E.vertexAttribDivisorANGLE(Nt.a.ac,0),E.vertexAttribDivisorANGLE(Nt.a.al,0)}var e="precision highp float;varying vec4 vc;void main(){gl_FragColor=vc;}";const Nt=new Ft(d,"precision highp float;attribute vec4 ap;attribute vec4 ac;attribute vec4 as;attribute vec2 al;varying vec4 vc;uniform vec2 d;uniform vec4 cols[30];uniform vec4 cols2[30];vec4 get(float l,float m){l=30.0*l;float i0=(mod(l,30.0));int i1=int(mod(i0+1.0,30.0));float f=fract(l);vec4 col0=cols[int(i0)];vec4 col1=cols[i1];if(m>0.5){col0=cols2[int(i0)];col1=cols2[i1];} return mix(col0, col1,f);}vec3 so(vec3 c){float l=0.4122214708*c.r+0.5363325363*c.g+0.0514459929*c.b;float m=0.2119034982*c.r+0.6806995451*c.g+0.1073969566*c.b;float s=0.0883024619*c.r+0.2817188376*c.g+0.6299787005*c.b;float l_=pow(l,1.0/3.0);float m_=pow(m,1.0/3.0);float s_=pow(s,1.0/3.0);return vec3(0.2104542553*l_+0.7936177850*m_-0.0040720468*s_,1.9779984951*l_-2.4285922050*m_+0.4505937099*s_,0.0259040371*l_+0.7827717662*m_-0.8086757660*s_);}vec3 os(vec3 c){float l_=c.x+0.3963377774*c.y+0.2158037573*c.z;float m_=c.x-0.1055613458*c.y-0.0638541728*c.z;float s_=c.x-0.0894841775*c.y-1.2914855480*c.z;float l=l_*l_*l_;float m=m_*m_*m_;float s =s_*s_*s_;return vec3(4.0767416621*l-3.3077115913*m+0.2309699292*s,-1.2684380046*l+2.6097574011*m-0.3413193965*s,-0.0041960863*l-0.7034186147*m+1.7076147010*s);}void main(){vec4 c=get(fract(ac.x+ap.z*ac.z),al.y);vec3 w=so(c.xyz);vc.xyz=os(vec3(w.r*al.x,w.gb));vc.a=ac.w;mat2 rot=mat2(cos(ac.y),sin(ac.y),-sin(ac.y),cos(ac.y));vec2 pos = rot*ap.xy;gl_Position=vec4((as.w*pos.x+as.x)/d.x,(as.w*pos.y+as.y)/d.y,as.z,1.0);}",e,["ap","ac","as","al"],["d","cols","cols2"]),Lt=new Ft(d,"attribute vec2 ap;attribute vec3 c0;attribute vec2 as;uniform float b;uniform float l;varying vec4 vc;void main(){ vc=vec4(c0,b);gl_Position=vec4(ap.x*l,(ap.y*as.y+as.x)*l,1.0,1.0);}",e,["ap","c0","as"],["b","l"]),Mt=new Ft(d,"precision highp float;attribute vec4 ap;attribute vec2 at;varying vec2 t;void main(){ gl_Position=vec4(ap.xyz,1.0);t=at;}","precision highp float;varying vec2 t;uniform sampler2D u;uniform vec4 d;uniform float b;void main(){float l=length(t.xy-d.zw);float h=d.x*b*l;float v=d.y*b*l;vec4 s=vec4(0.0);s+=texture2D(u,vec2(t.x-4.0*h,t.y-4.0*v))*0.016216;s+=texture2D(u,vec2(t.x-3.0*h,t.y-3.0*v))*0.054054;s+=texture2D(u,vec2(t.x-2.0*h,t.y-2.0*v))*0.121621;s+=texture2D(u,vec2(t.x-1.0*h,t.y-1.0*v))*0.194594;s+=texture2D(u,vec2(t.x,t.y))*0.227027;s+=texture2D(u,vec2(t.x+1.0*h,t.y+1.0*v))*0.194594;s+=texture2D(u,vec2(t.x+2.0*h,t.y+2.0*v))*0.121621;s+=texture2D(u,vec2(t.x+3.0*h,t.y+3.0*v))*0.054054;s+=texture2D(u,vec2(t.x+4.0*h,t.y+4.0*v))*0.016216;gl_FragColor=clamp(s,0.,1.);}",["ap","at"],["d","b"]),Gt=new Ft(d,"precision highp float;attribute vec2 ap;attribute vec2 at;varying vec2 v;void main(){ gl_Position=vec4(ap,0.0,1.0);v=at;}","precision highp float;varying vec2 v;uniform sampler2D t;void main(){ gl_FragColor=texture2D(t,v);}",["ap","at"]),Ut=I(),St=I(),It=I(),Ct=I(),Ht=I();O=2*mt,k=2*dt,[C,H]=Rt(),[z,V]=Rt();let zt=[],Vt=[],Ot=Q?4:60,kt=3*Ot,Wt=6*Ot;for(t=0;t<Ot;++t){let me=t/Ot*o,de=2*t/Ot;de>1&&(de=2-de);let Ee=2*(t+1)/Ot;Ee>1&&(Ee=2-Ee);let ge=(t+1)/Ot*o;zt.push(0,0,0,0,c(me),f(me),de,de,c(ge),f(ge),Ee,Ee),Vt.push(c(me),f(me),de,de,c(ge),f(ge),Ee,Ee,.8*c(ge),.8*f(ge),Ee,Ee,c(me),f(me),de,de,.8*c(ge),.8*f(ge),Ee,Ee,.8*c(me),.8*f(me),de,de)}let Xt=n(zt),qt=n(Vt);const Yt=I();d.bindBuffer(P,Yt);const jt=n([-1,-1,-1,1,1,-1,1,1,-1,1,1,-1]);d.bufferData(P,jt,B);const Jt=I();d.bindBuffer(P,Jt),d.bufferData(P,jt,B);const Kt=I();d.bindBuffer(P,Kt),d.bufferData(P,n([0,0,0,1,1,0,1,1,0,1,1,0]),B),X=[],q=[],W=[];let Qt=n(X),Zt=n(q),$t=n(W),te=0,ee=[];d.clearColor(1,1,1,1),d.clear(w),d.enable(d.BLEND),d.blendFuncSeparate(G,M,L,M);let re=0,ae=15e4,ie=0,ne=.1+Y()*Y()*.1,oe=0,ce=0,fe=20+30*Y();for(t=0;t<fe;++t){let _e=1.6*(Y()-.5),ye=(Y()-.5)*(2*bt-.4);Y()>.5&&(_e=oe,ye=ce),oe=_e,ce=ye;let De=Y()>.5?2:1,Te=.004,Re=Te,Fe=Y(),we=Y()*o,Pe=.1*(Y()-.5),Be=200+500*Y();for(r=0;r<Be;++r){let Ne=new A(_e,ye,.001,.5,Re,Y(),1);yt(_e,ye,ie),ie++,_e+=c(we)*Te*1.2,ye+=f(we)*Te*1.2,Ne.done=!0,Z?Y()>.99&&(we+=50*Pe*Y()):we+=Pe*Y(),Re*=.995,Ne.frac=Fe+1-.001*r,Ne.frac2=.041,Ne.frac4=De,ee.push(Ne)}}for(t=0;t<ae;++t){let Le=1.8*(Y()-.5),Me=(Y()-.5)*(2*bt-.2),Ge=.0021,Ue=new A(Le,Me,.11,.5,Ge,Y(),1);Ue.frac=Me/4*tt+2+Y()*ne,1==$?Ue.frac+=v(Le)/4:2==$?Ue.frac+=Le/4:3==$&&(Ue.frac+=1-Le/4),Ue.frac2=.05+.1*Y();let Se=Ge;at&&Y()>.5&&(Se*=2+u(3*Y())),Ue.s=Se,Tt(Le,Me,Se,ie-1)&&(ee.push(Ue),Ue.frac4=.9,yt(Le,Me,ie),ie++)}let le=20+40*Y();for(var r=0;r<le;++r){let Ie=[],Ce=Dt(Y()-.5,2.3*(Y()-.5));if(0==r&&(Ce=Dt(2*it-1,nt*bt)),-1==Ce)continue;Ie.push(Ce);let He=r/le;ee[Ce].frac=He,ee[Ce].frac2=.5,ee[Ce].done=!0,ae=1e3+Y()*Y()*4e3;let ze=l(Y(),3.5),Ve=(.002*Y()+5e-4)*(.1+.9*Y()),Oe=0,ke=Y()>.6?1.05+Y()*Y()*.06:1;et&&Y()>.5&&(Oe=.2+.6*Y(),ke=1);let We=Y()>.5;for(We&&(ee[Ce].fc=1),t=0;t<ae;++t){let Xe=u(l(Y(),ze)*(Ie.length-1));if(Ie[Xe],Ce=Ie[Xe],ee[Ce].x,ee[Ce].y,ee[Ce].frac,Ce=Dt(ee[Ce].x,ee[Ce].y,Ce),-1==Ce)break;ee[Ce].x,ee[Ce].y,Y()>Oe&&(ee[Ce].frac=(He+3-t*Ve)%1),ee[Ce].frac2=.8,ee[Ce].frac4=ke,ee[Ce].done=!0,We&&(ee[Ce].fc=1),Ie.push(Ce)}}for(t=0;t<5e3;++t){let qe=u(Y()*ee.length);ee[qe].frac+=.05*Y()}for(t=0;t<50;++t){let Ye=1.6*(Y()-.5),je=(Y()-.5)*(2*bt-.4),Je=new A(Ye,je,.01,.5,.02+.18*Y(),Y(),1);Je.frac=je/4*tt+2+Y()*ne,Je.frac2=.015,Je.frac4=.95,ee.push(Je)}let se=!0;function ue(t){requestAnimationFrame(ue),te+=b(.001*(t-re),.0333),re=t,X=[],q=[],W=[],d.bindFramebuffer(_,H),d.viewport(0,0,O,k),d.clear(d.DEPTH_BUFFER_BIT),se&&Pt(1,1),se=!1;let e=8*xt/1e3;d.bindFramebuffer(_,V),d.viewport(0,0,O,k),d.clear(w),d.useProgram(Mt.p),d.bindTexture(R,C),d.bindBuffer(P,Yt),d.vertexAttribPointer(Mt.a.ap,2,y,!1,0,0),d.enableVertexAttribArray(Mt.a.ap),d.enableVertexAttribArray(Mt.a.at),d.bindBuffer(P,Kt),d.vertexAttribPointer(Mt.a.at,2,y,!1,0,0),d.uniform4f(Mt.u.d,.5/O,0,it,.5*nt+.5),d.uniform1f(Mt.u.b,e),d.drawArrays(g,0,6),d.bindFramebuffer(_,H),d.viewport(0,0,O,k),d.clear(w),d.bindTexture(R,z),d.uniform4f(Mt.u.d,0,.5/k,it,.5*nt+.5),d.drawArrays(g,0,6);for(let t=0;t<ee.length;++t){let e=ee[t];W.push((e.frac+.01*te)%1,e.angle,0,e.frac2),X.push(e.x,e.y,e.z,e.s),q.push(e.frac4,e.fc)}ie=X.length/4,Qt=n(X),$t=n(W),Zt=n(q),Bt(rt),d.bindFramebuffer(_,null),d.viewport(0,0,d.canvas.width,d.canvas.height),d.useProgram(Gt.p),d.bindTexture(R,C),d.enableVertexAttribArray(Gt.a.ap),d.bindBuffer(P,Yt),d.vertexAttribPointer(Gt.a.ap,2,y,!1,0,0),d.enableVertexAttribArray(Gt.a.at),d.bindBuffer(P,Kt),d.vertexAttribPointer(Gt.a.at,2,y,!1,0,0),d.disable(d.BLEND),d.drawArrays(g,0,6),d.enable(d.BLEND)}window.requestAnimationFrame(ue)}var a,i})();
When one pays homage to the _departed_, what unfolds? "Décorés" - a French word meaning "awarded" or "gilded" - delves into the realm of fleeting beings who are bestowed with the precious metals of gold and silver. Through a fortuitous yet deliberate interplay, figurative entities emerge, bearing organic characteristics that defy all sense of proportion. From extraterrestrial beings to minuscule cellular organisms, this collection encompasses both the monumental and the infinitesimal.
1-50 of 87