memoscan
← all memos

Memo 0xb5f125e8…4489ab on Ethereum

<!DOCTYPE html><html> <head> <title>Cirque de lumières</title> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/> <meta charset=utf-8> </head> <body> </body> <script language="javascript" src="https://npmcdn.com/regl@2.1.0/dist/regl.min.js"></script> <script>const seed="{{hash}}";window.METADATA=art(createREGL({attributes:{powerPreference:"high-performance"}}),seedAsArray(seed),window.onImageRendered).metadata;function seedAsArray(s){s.startsWith("0x")&&(s=s.slice(2));const t=[];for(let e=0;e<s.length;e+=2)t.push(parseInt(s.slice(e,e+2),16));return t}function art(t,o,e){const a=RNG(o),f=a()<.05,i=Math.ceil(3-f*(1+a()));let n=Array(i).fill(.5);const p=3-i;if(p>0){for(let t=0;t<p;t++)n.push(0);n=n.map(t=>[t,a()]).sort((t,o)=>t[1]-o[1]).map(t=>t[0]*(1+a()))}const s=[.3+.5*a()*(.5-a()),.4+.5*a()*a()*a(),.5+.5*a()*(.5-a())];let r,l="";a()<.2?(r="0.5",l="Dark"):a()<.4?(n[2]=.75,r="0.4,0.5,0.6",l="Cold"):(n[0]=.6,r="0.7,0.5,0.45",l="Hot");const c=`vec3(${n.map(t=>t.toFixed(1).toUpperCase()).join(",")})`;if(f){l=`#${n.map(t=>Math.round(15*t).toString(16).toUpperCase()).join("")}`}let v=Math.max(0,1.3*a()*a()-.1);const x=.01+6*a()*a(),h=.5+8*Math.pow(a()*a(),2),u=a(),m=a(),d=a(),$=a(),b=(.12+2*$).toFixed(3),F=.05+.18*a(),y=a()<.2,g=a()<.8,M=(1+50*a()).toFixed(3),z=(.05+.15*a()).toFixed(3),w=.03*a(),T=a();let P=0,R=0,j=0,H=0;const C=[];function I(){const t=(.5*a()*a()).toFixed(3),o=(.5*a()*a()).toFixed(3),e=(6.3*a()).toFixed(3);return`tr(p,${a()<.8?t:`${t}+${(.2*(a()-.5)).toFixed(3)}*sin(t${Math.ceil(3*a())})`},${a()<.8?o:`${o}+${(.2*(a()-.5)).toFixed(3)}*cos(t${Math.ceil(3*a())})`},${a()<.9?e:`${e}+t${Math.ceil(3*a())}`})`}let N=Math.floor(20+30*a());for(let t=0;t<N;t++){const t=a();if(t<.03)C.push({tr:"o"});else if(t<.1)P++,C.push({op:`pmp(p,${Math.ceil(2+40*a()*a()*a()).toFixed(1)})`});else if(t<.15)R++,C.push({op:`pmm1(p.x,${(.2+a()).toFixed(3)})`});else if(t<.2)R++,C.push({op:`pmm1(p.y,${(.2+a()).toFixed(3)})`});else if(t<.24)j++,C.push({tr:I(),shape:`sf(p,${Math.ceil(2+100*a()*a())}.,${(.02*a()*a()).toFixed(3)},${a().toFixed(3)},${(2*a()).toFixed(3)})`});else{H++,a()<.5&&C.push({tr:"pres"});const t=`vec2(${(.02+.3*a()*a()*a()).toFixed(3)},${(.02+.05*a()+.2*a()*a()).toFixed(3)})`;C.push({tr:I(),shape:`box(p,${t})`})}}y&&a()<.4&&C.push({shape:`box(o,vec2(.02,${(3*a()).toFixed(2)}))`}),y&&a()<.4&&C.push({shape:`box(o,vec2(${(3*a()).toFixed(2)},.02))`}),(y||g)&&H<30&&(v=Math.max(.4,2*v)),C.unshift({shape:`.3+length(p)-${v.toFixed(3)}*fbm9(${x.toFixed(3)}*p+80.*s3+${h.toFixed(3)}*fbm(vec2(fbm(${x.toFixed(3)}*p+80.*s1),fbm(2.*p+80.*s2))))+${w.toFixed(3)}*cos(3.*T)`});const S=1+2*a()*Math.min(1,(j+H)/50);const U=` precision highp float;varying vec2 uv;uniform vec2 R;uniform float T; #define PI ${Math.PI} const float s1=${u.toFixed(4)},s2=${m.toFixed(4)},s3=${d.toFixed(4)}; float vmax(vec2 v){return max(v.x,v.y);} float box(vec2 p,vec2 b){vec2 d=abs(p)-b;return length(max(d,vec2(0.)))+vmax(min(d,vec2(0.)));} float U(float a,float b,float r){vec2 u=max(vec2(r-a,r-b),vec2(0.));return max(r,min(a,b))-length(u);} float hash(float p){p=fract(p*.1031);p*=p+33.33;p*=p+p;return fract(p);} float hash(vec2 p){vec3 p3=fract(vec3(p.xyx)*.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);} float noise(float x){float i=floor(x);float f=fract(x);float u=f*f*(3.-2.*f);return mix(hash(i),hash(i+1.),u);} float noise(vec2 x){vec2 i=floor(x);vec2 f=fract(x);float a=hash(i);float b=hash(i+vec2(1.,0.));float c=hash(i+vec2(0.,1.));float d=hash(i+vec2(1.));vec2 u=f*f*(3.-2.*f);return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;}const mat2 m2=mat2(.6,.8,-.8,.6); float fbm(vec2 x){float f=2.;float s=.55;float a=0.;float b=.5;for(int i=0;i<5;i++){float n=noise(x);a+=b*n;b*=s;x=f*x;}return a;} float fbm9(vec2 x){float f=2.;float s=.55;float a=0.;float b=.5;for(int i=0;i<9;i++){float n=noise(x);a+=b*n;b*=s;x=f*x;}return a;} vec3 palette(float t,vec3 a,vec3 b,vec3 c,vec3 d){return a+b*cos(6.28318*(c*t+d));} vec3 pal(float t){return palette(t,${c},vec3(${s.map(t=>t.toFixed(2)).join(",")}),vec3(1.),vec3(${r}));} float pmi1(inout float p,float size,float start,float stop){float halfsize=size/2.;float c=floor((p+halfsize)/size);p=mod(p+halfsize,size)-halfsize;if(c>stop){p+=size*(c-stop);c=stop;}if(c<start){p+=size*(c - start);c=start;}return c;} vec2 tr(vec2 p,float dx,float dy,float a){p.x+=dx;p.y+=dy;return cos(a)*p + sin(a)*vec2(p.y,-p.x);} float sf(vec2 p,float s,float lw,float w,float h){s-=1.;p.y+=h/2.;pmi1(p.y,h/s,0.,s);return box(p,vec2(w/2.,lw/2.));} float pmm1(inout float p,float s){float halfs=s/2.;float c=floor((p+halfs)/s);p=mod(p+halfs,s)-halfs;p*=mod(c,2.)*2.-1.;return c;} float pmp(inout vec2 p,float rep){float an=2.*PI/rep;float a=atan(p.y,p.x)+an/2.;float r=length(p);float c=floor(a/an);a=mod(a,an)-an/2.;p=vec2(cos(a),sin(a))*r;if(abs(c)>=rep/2.)c=abs(c);return c;} vec3 scene(vec2 p){ vec2 q=vec2(fbm(30.*p),fbm(8.*p+vec2(6.6,-.1*T))); vec2 r=vec2(fbm(100.*q),fbm(88.*s1+p+${M}*(q+vec2(0.04*T)))); float v=fbm(${(.05+a()*a()).toFixed(3)}*p+${z}*r+s2); float t1=.4*T;float t2=t1/2.;float t3=t2/2.; p*=${S.toFixed(3)}; vec2 o=p;${y?"p.y=abs(p.y);":""}${g?"p.x=abs(p.x);":""}vec2 pres=p; float k=${F.toFixed(3)}; float s=99.;${C.flatMap(t=>{const o=[];return t.op&&o.push(`${t.op};`),t.tr&&o.push(`p=${t.tr};`),t.shape&&o.push(`s=U(s,${t.shape},k);`),o}).join(" ")} s=max(s,-${b}-s); s+=${(.1*(1-T)).toFixed(3)}; float d=smoothstep(0.,.2,s); v=mix(v,.5,smoothstep(.01,0.,s)); v-=.5*pow(d,.05+.5*abs(uv.y-.5)); return pal(v)+smoothstep(.0,-.2,s);} void main(){gl_FragColor=vec4(scene((uv-0.5)*R/min(R.x,R.y)),1.);}`,k=t({frag:U,vert:"precision mediump float;attribute vec2 p;varying vec2 uv;void main(){uv=p;gl_Position=vec4(2.*p-1.,0,1);}",attributes:{p:[-2,0,0,-2,2,2]},uniforms:{T:t.prop("T"),R:({viewportWidth:t,viewportHeight:o})=>[t,o]},count:3});let q=e;return t.frame(({time:t})=>{k({T:t}),q&&(q(),q=null)}),{destroy:()=>t.destroy(),metadata:{Palette:l,Symmetry:y&&g?"Both":y?"Vertical":g?"Horizontal":"None","Polar Ops":P,"Mirror Ops":R,"Stripe Primitives":j,"Rectangle Primitives":H,"Blob Factor":(A=Math.max(0,h*(v-.2)),Math.floor(100*A)/100),"Laser Intensity":T<.5?"Low":T<.8?"Medium":T<.9?"High":"Very High",Border:$<.2?$<.1?"Small":"Large":"None"}};var A}function RNG(t){null==t&&(t=(new Date).getTime());let o=624,e=397,a=2567483615,f=2147483648,i=2147483647,n=new Array(o),p=o+1;function s(t){for(n[0]=t>>>0,p=1;p<o;p++){let t=n[p-1]^n[p-1]>>>30;n[p]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+p,n[p]>>>=0}}return"object"==typeof t?function(t,e){var a,f,i;for(s(19650218),a=1,f=0,i=o>e?o:e;i;i--){var p=n[a-1]^n[a-1]>>>30;n[a]=(n[a]^(1664525*((4294901760&p)>>>16)<<16)+1664525*(65535&p))+t[f]+f,n[a]>>>=0,f++,++a>=o&&(n[0]=n[o-1],a=1),f>=e&&(f=0)}for(i=o-1;i;i--){var p=n[a-1]^n[a-1]>>>30;n[a]=(n[a]^(1566083941*((4294901760&p)>>>16)<<16)+1566083941*(65535&p))-a,n[a]>>>=0,++a>=o&&(n[0]=n[o-1],a=1)}n[0]=2147483648}(t,t.length):s(t),()=>(function(){var t,r=new Array(0,a);if(p>=o){var l;for(p==o+1&&s(5489),l=0;l<o-e;l++)t=n[l]&f|n[l+1]&i,n[l]=n[l+e]^t>>>1^r[1&t];for(;l<o-1;l++)t=n[l]&f|n[l+1]&i,n[l]=n[l+(e-o)]^t>>>1^r[1&t];t=n[o-1]&f|n[0]&i,n[o-1]=n[e-1]^t>>>1^r[1&t],p=0}return t=n[p++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0})()*(1/4294967296)}</script></html>webGL