0x06dc…f7ce

All memos sent from and to 0x06dc…f7ce.

function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,i]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,n=.412165612*s+.536275208*e@214575653*i,r=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*h,1.9779984951*o- ,h=4.0767245293*f-3.307!COMPILE_STATUS)?i:(alert("can'!t.VERTEX_SHADER, URL(window.locaH,ecdd1e2423def0969c6dd$Ybody.appendChild%xw=[3,3,9][b],g=[4,6,1 P *A,y=A<.02?.96:1,_x=R/3*2,E=["#e03a0Aa :[{sId:B,tfm:Y 5PI,d=i<0,m=(-n-r)?1let l=d?m:n*i,p=r -l-p:m`$ u=e+(d?1-f:f);?,"#version 300 es\npreci`at;\nin vec4 pos *@) t + cross( U* 3.141592654).xy!Loc=t.getAttrib }registerShape)s[e]/D var j=BigI $ ];s+=i.x*n.y-n ;B>0?(L=o,B--):(!ext("webgl2",{pre",(d-1)*f(b,g,D/A+i)},(P ,`${s}_${S4?9z Id??0)%1e3
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,i]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,n=.412165612*s+.536275208*e@214575653*i,r=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*h,1.9779984951*o- ,h=4.0767245293*f-3.307!COMPILE_STATUS)?i:(alert("can'!t.VERTEX_SHADER, URL(window.locaH,eed")||tokenData?.hash||var s!@ s<32;s++)t+body.appendChild%"%cM(' by Lars W$s,Ow=[3,3,9][b],g=[4,6,1 P *A,y=A<.02?.96:1,_x=R/3*2,E=["#e03a0Aap0 ETf :[{sId:B,tfm:Y 5PI,d=i<0,m=(-n-r)?1let l=d?m:n*i,p=r -l-p:m`$ I=e+(d?1-f:f);?,"#version 300 es\npreci`at;\nin vec4 pos *@) t + cross( U* 3.141592654).xy!Loc=t.getAttrib }registerShape)s[e]/D var j=BigI $ ];s+=i.x*n.y-n ;B>0?(L=o,B--):(!ext("webgl2",{pre",(d-1)*f(b,g,D/A+i)},(P ,`${s}_${S4?9z Id??0)%1e3
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,n]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,r=.412165612*s+.536275208*e@214575653*n,i=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*h,1.9779984951*a- 808675 *h]}class eruct"6 t,s){this.x=t,`COMPILE_STATUS)?n:(ale!t.VERTEX_SHADER, ?t*(1-e)+s*e%#!~ /4294967296}}cF@URL(window.locaFecdd1e2423def0969c6dd8854c52fb7b","font-weight: bold;%3),p=[3,3,9][I],b=[4,6,1 P v=-1*g,A=g<.02?.96:1,D_=y/3*2,R=["#e03a0Ad :[{sId:F,tfm:N 5PI,d=n<0,m=(-r-i)?1let l=d?m:r*n,u=i -l-u:m`$ p=e+(d?1-f:f);?n floor(p),0!==e,"#version 300 es\npreci`at;\n\nin vec4 pos *@+ t + cross( W* 3.141592654).xy!@4 1.291485548CR@4Loc=t.getAttrib valu"K Array(u).fill(Nps:n,ind f s:r,subs:i$ ];s+=n.x*r.y-r xt("webgl2",{pre"P0,(I-1)*i(g,A,R/:P?7Z Id??0)%1e3}@k
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,n]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,r=.412165612*s+.536275208*e@214575653*n,i=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*h,1.9779984951*a- 808675 *h]}class eruct"6 t,s){this.x=t,`COMPILE_STATUS)?n:(ale!t.VERTEX_SHADER, ?t*(1-e)+s*e%#!~ /4294967296}}cF@URL(window.locaFeed")||tokenData?.hash|| ;for(var s!@ s<32;s++)t+","font-weight: bold;%3),p=[3,3,9][I],b=[4,6,1 P v=-1*g,A=g<.02?.96:1,D_=y/3*2,R=["#e03a0Ad :[{sId:F,tfm:N 5PI,d=n<0,m=(-r-i)?1let l=d?m:r*n,u=i -l-u:m`$ p=e+(d?1-f:f);?n floor(p),0!==e,"#version 300 es\npreci`at;\n\nin vec4 pos *@+ t + cross( W* 3.141592654).xy!@4 1.291485548CR@4Loc=t.getAttrib .9);"e'r nst[s,e]of `4valu"K Array(u).fill(Nos:n,ind f s:r,subs:i$ ];s+=n.x*r.y-r xt("webgl2",{pre"P0,(I-1)*i(g,A,R/:O?7Z Id??0)%1e3}@k
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,n]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,i=.412165612*e+.536275208*n@N14575653*r,f=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*c,1.9779984951*o-!808675 *c]}class nruct"9 t,s){this.x=t,`getContext("webgl2",{preserveDraBuffer:!0,antialias ei(s.UNPACK_ALIGNMENT,1),s;ale!COMPILE_STATUS)?n:(eed")||tokenData?.hash|| body.appendChild&s3),S=[3,3,9][x],L=[4,6,1 W B=-1*M,E=M<.02?.96:1,Tk=U/3*2,C=["#e03a0Ak :[{sId:O,tfm:Z 5},et="#version 300 es\npreci`v *@+ t + cross( W* 3.141592654).xy!@4 1.291485548CU@4zdydC D ";class rt{hructor(){this.q=n+(t,s,e,n,r,i,f,a)PI,d=n<0,m=(-r-i)*n;le"!-l-u:m`$ p=e+(d?1-f:' ,r=l;l=-o*(u-I Loc=t.getAttrib valu"N Array(_).fill(ER$ ];s+=n.x*r.y-r 0,(l-1)*c(b,y,S/x)Id??0)%1e3}}))},dt();
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,n]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,i=.412165612*e+.536275208*n@N14575653*r,f=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*c,1.9779984951*o-!808675 *c]}class nruct"9 t,s){this.x=t,`getContext("webgl2",{preserveDraBuffer:!0,antialias ei(s.UNPACK_ALIGNMENT,1),s;ale!COMPILE_STATUS)?n:(eed")||tokenData?.hash|| body.appendChild&s3),S=[3,3,9][x],L=[4,6,1 W B=-1*M,E=M<.02?.96:1,Tk=U/3*2,C=["#e03a0Ak :[{sId:O,tfm:Z 5},et="#version 300 es\npreci`v *@+ t + cross( W* 3.141592654).xy!@4 1.291485548CU@4zdydC D ";class rt{hructor(){this.q=n+(t,s,e,n,r,i,f,a)PI,d=n<0,m=(-r-i)*n;le"!-l-u:m`$ p=e+(d?1-f:' ,r=l;l=-o*(u-I Loc=t.getAttrib valu"N Array(_).fill(ER$ ];s+=n.x*r.y-r 0,(l-1)*c(b,y,S/x)Id??0)%1e3}}))},dt();
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,n]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,i=.412165612*e+.536275208*n@N14575653*r,f=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*c,1.9779984951*o-!808675 *c]}class nruct"9 t,s){this.x=t,`getContext("webgl2",{preserveDraBuffer:!0,antialias ei(s.UNPACK_ALIGNMENT,1),s;ale!COMPILE_STATUS)?n:(eed")||tokenData?.hash|| body.appendChild&s3),S=[3,3,9][x],F=[4,6,1 W B=-1*M,E=M<.02?.96:1,TC=U/3*2,k=["#e03a0Ak :[{sId:O,tfm:Z 5},et="#version 300 es\npreci`v *@+ t + cross( W* 3.141592654).xy!@4 1.291485548CU@4zdydC D ";class rt{hructor(){this.q=n+(t,s,e,n,r,i,f,a)PI,d=n<0,m=(-r-i)*n;le"!-l-u:m`$ p=e+(d?1-f:' ,r=l;l=-o*(u-I Loc=t.getAttrib valu"N Array(_).fill(ER$ ];s+=n.x*r.y-r 0,(l-1)*c(b,D,S/x)
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,n]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,i=.412165612*e+.536275208*n@N14575653*r,f=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*c,1.9779984951*o-!808675 *c]}class nruct"9 t,s){this.x=t,`getContext("webgl2",{preserveDraBuffer:!0,antialias ei(s.UNPACK_ALIGNMENT,1),s;ale!COMPILE_STATUS)?n:(eed")||tokenData?.hash|| body.appendChild&s3),S=[3,3,9][x],F=[4,6,1 W B=-1*M,E=M<.02?.96:1,TC=U/3*2,k=["#e03a0Ac :[{sId:O,tfm:Z 5},et="#version 300 es\npreci`v *@+ t + cross( W* 3.141592654).xy!@4 1.291485548CU@4zdydC D ";class rt{hructor(){this.q=n+(t,s,e,n,r,i,f,a)PI,d=n<0,m=(-r-i)*n;le"!-l-u:m`$ p=e+(d?1-f:' ,r=l;l=-o*(u-I Loc=t.getAttrib valu"N Array(_).fill(ER$ ];s+=n.x*r.y-r 0,(l-1)*c(b,D,S/x)
The while true (fabric) collection contains four jacquard fabric panels, crafted from an artist-selected hash code, produced to reflect the rich variety of while true. The fabric is paired with a digital artwork, selected by the artist, to correspond with it. while true is a meditation on the meaning of unboundedness. Infinity is a strange and paradoxical concept: nothing real can be “infinite”, yet the math and physics we use to describe and understand our universe is built on the concept of its existence. Take away infinity and the groundwork that ties together calculus, probability theory, differential equations and countless more fields begins to crumble. Throughout history, many philosophers have raised issues in including infinity in our metaphysical and mathematical reasoning: Brouwer and his school of intuitionism strongly rejected the idea of using impossible concepts in mathematics, arguing that math should be constructible. Aristotle rejected the idea of “actual” infinity, seeing it as something impossible. Kronecker, who famously said “God made the integers, all else is the work of man”, objected to the use of infinity and transfinite numbers in math. There is clearly truth to the fact that any infinite object is too large or impossible for our minds to truly comprehend, but infinity has clearly shown its undeniable effectiveness in helping construct models of reality. All this leaves the question: how do we explain the infinite?
while true is a meditation on the meaning of unboundedness. Infinity is a strange and paradoxical concept: nothing real can be “infinite”, yet the math and physics we use to describe and understand our universe is built on the concept of its existence. Take away infinity and the groundwork that ties together calculus, probability theory, differential equations and countless more fields begins to crumble. Throughout history, many philosophers have raised issues in including infinity in our metaphysical and mathematical reasoning: Brouwer and his school of intuitionism strongly rejected the idea of using impossible concepts in mathematics, arguing that math should be constructible. Aristotle rejected the idea of “actual” infinity, seeing it as something impossible. Kronecker, who famously said “God made the integers, all else is the work of man”, objected to the use of infinity and transfinite numbers in math. There is clearly truth to the fact that any infinite object is too large or impossible for our minds to truly comprehend, but infinity has clearly shown its undeniable effectiveness in helping construct models of reality. All this leaves the question: how do we explain the infinite?
Lars mainnet upload 100% B7 while true is a meditation on the meaning of unboundedness. Infinity is a strange and paradoxical concept: nothing real can be “infinite”, yet the math and physics we use to describe and understand our universe is built on the concept of its existence. Take away infinity and the groundwork that ties together calculus, probability theory, differential equations and countless more fields begins to crumble. Throughout history, many philosophers have raised issues in including infinity in our metaphysical and mathematical reasoning: Brouwer and his school of intuitionism strongly rejected the idea of using impossible concepts in mathematics, arguing that math should be constructible. Aristotle rejected the idea of “actual” infinity, seeing it as something impossible. Kronecker, who famously said “God made the integers, all else is the work of man”, objected to the use of infinity and transfinite numbers in math. There is clearly truth to the fact that any infinite object is too large or impossible for our minds to truly comprehend, but infinity has clearly shown its undeniable effectiveness in helping construct models of reality. All this leaves the question: how do we explain the infinite? while true is a meditation on the meaning of unboundedness. Infinity is a strange and paradoxical concept: nothing real can be “infinite”, yet the math and physics we use to describe and understand our universe is built on the concept of its existence. Take away infinity and the groundwork that ties together calculus, probability theory, differential equations and countless more fields begins to crumble. Throughout history, many philosophers have raised issues in including infinity in our metaphysical and mathematical reasoning: Brouwer and his school of intuitionism strongly rejected the idea of using impossible concepts in mathematics, arguing that math should be constructible. Aristotle rejected the idea of “actual” infinity, seeing it as something impossible. Kronecker, who famously said “God made the integers, all else is the work of man”, objected to the use of infinity and transfinite numbers in math. There is clearly truth to the fact that any infinite object is too large or impossible for our minds to truly comprehend, but infinity has clearly shown its undeniable effectiveness in helping construct models of reality. All this leaves the question: how do we explain the infinite? Turn on screen reader support To enable screen reader support, press Ctrl+Alt+Z To learn about keyboard shortcuts, press Ctrl+slash
function t(t){if("string"==typeo=t[0]?t=t.slice(1): tartsWith("0x")&&(.length){const[s,e,n]=t;t=`${s}throw new Error(`Expected e er 3 or 6 digit hex ,16)}return[t>>16&255, <=.04045?t/12.92:Math.pow .,i=.412165612*e+.536275208*n@N14575653*r,f=.211859107@) 6807189584@* 281847417`* 6302613616 +720468*c,1.9779984951*o-!808675 *c]}class nruct"9 t,s){this.x=t,`getContext("webgl2",{preserveDraBuffer:!0,antialias ei(s.UNPACK_ALIGNMENT,1),s;ale!COMPILE_STATUS)?n:(eed")||tokenData?.hash|| body.appendChild&s7],B=-1*M,T=M<.02?.96:1,CSIZE:x,MIN_COLOR_REPEATS:E,MAXsqrt(3),k=U/3*2,P=["#e03a0!},nt="#version 300 es\npreci`;\n\nin vec4 ?x f@z RT3 = sqr+:v *@+ t + cross( W* 3.141592654).xy!@4 1.291485548CU@4zdydC D ";class it{hructor(){this.q=n+(t,s,e,n,r,i,f,a)PI,d=n<0,m=(-r-i)*n;le"!-l-u:m`$ p=e+(d?1-f:' ,r=l;l=-o*(u-I Loc=t.getAttrib valu"N Array(x).fill(ER$ ];s+=n.x*r.y-r -# ===t?.1:.02A60,(l-1)*c(b,R,L/E)0,F $ ),Y&&N?(r=XpadSta'Q 5,"0")}`).then/9/,!
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eElkIjoiNTE4MmY5MGItZmU3MC00OTdiLTljYTYtYWIxNmQ2MmI4YmFkIiwiaWF0IjoxNzAwMjU0OTg1LCJpc3MiOiJwYXBlci54eXoifQ.7Yka3_1sMkKn5OX5AWpN1Du4dRUF9P6H2wf4rsVNuAY
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eElkIjoiNmRiMDlhODMtYzFhMC00MmI1LWFmYTctMWZmYzc2Y2M5MmMyIiwiaWF0IjoxNjkyOTg5ODU3LCJpc3MiOiJwYXBlci54eXoifQ.K-lmUmE1qMlGqI8C-UMGQjiWo7eipdj1nxAwc7rUvh0
function t(t){return new URL(window.location.href).searchParams.get(t)}console.log("Made by Lars Wander https://larswander.com"),console.log("Licensed under CC BY-NC-SA 4.0");const e=t("hash")??tokenData.hash,r=window.devicePixelRatio??1;console.log(tokenData.hash);class n{constructor(){this.useA=!1;let t=function(t){let e=parseInt(t.substring(0,8),16),r=parseInt(t.substring(8,16),16),n=parseInt(t.substring(16,24),16),i=parseInt(t.substring(24,32),16);return function(){e|=0,r|=0,n|=0,i|=0;let t=(e+r|0)+i|0;return i=i+1|0,e=r^r>>>9,r=n+(n<<3)|0,n=n<<21|n>>>11,n=n+t|0,(t>>>0)/4294967296}};this.prngA=new t(e.substring(2,34)),this.prngB=new t(e.substring(34,66));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}}const i=new n,o=()=>i.random();function s(t,e){null==e&&(e=t,t=0),null==e&&(e=1);const r=e-t;return o()*r+t}function l(t){return null==t&&(t=.5),o()<t}const a=[.01,.1312,1.5806,7.7489,19.1068,27.2789,40.2367,43.3749,35.6146,22.4668,9.3318,1.7627,.4155,4.0426,12.3338,25.4684,39.3398,55.1236,70.52,84.6489,97.1482,99.1948,101.167,92.3319,75.0964,53.9294,36.1246,21.4712,12.2407,6.6892,3.2018,1.3875,.6874,.342,.1355,.0699,.0375,.0191],u=[0,.0164,.1655,.8051,1.9994,3.3546,6.5121,10.4722,15.1035,21.2723,29.3981,36.8978,50.3903,65.4035,79.829,94.2494,100.4376,103.1928,99.73,92.057,83.2302,68.9442,59.2511,47.3083,34.9129,23.6123,15.0491,8.6109,4.8369,2.6164,1.2447,.5369,.265,.1338,.0493,.028,.015,.0064],c=[.035,.5738,7.1169,35.6246,90.8624,134.661,206.3009,233.4076,205.6291,151.3409,89.5041,45.1892,23.8938,12.0738,6.3608,3.2845,1.4303,.4162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=a.length,h=s(),d=s(),x=s(),_=s(),m=s(),v=l(.1)&&m>.4,y=s(),p=s(),w=s(),T=s(),g=s(),A=8,b=4,E=lt(.01,.07,h),R=E*lt(.1,.6,d),S=lt(.18,.3,_),M=180*lt(1,.7,_),z=lt(-.4,.14,m),P=lt(.01,.15,g),L=3/f,N=.02,I=lt(.09,lt(.13,.11,x),y),U=0,$=.16,F=t=>Math.pow(t,.25),B=lt(.21,.45,p),D=lt(.4,.55,p),X=Math.round(lt(20,38,x)),C=2,k=1,O=lt(.75,lt(.55,.59,y),w),G=.85,Y=.75,q=lt(3.5,4.5,T),H=Number(t("Dpx")??500),W=(t("T")??"1,1").split(",").map((t=>Number(t))),V=(t("i")??"0,0").split(",").map((t=>Number(t)));console.table({RAY_EXTEND_T:h,RAY_NORMAL_T:d,SPECTRAL_SEPARATION_T:_,SPECTRAL_BIAS_T:m,SKEW_Z_T:T,SPECTRAL_LIGHT_SPREAD_T:g,SPHERE_COUNT:X,SPHERE_COUNT_T:x,MAX_SPHERE_SIZE_T:y,SECONDARY_RADIUS_MAX:I,DESAT_T:p,ZOOM_T:w});const Z="#version 300 es\nprecision highp float;\n\nin vec2 a_coord;\n\nout vec2 v_tex;\n\nvoid main() {\n vec2 pos = (a_coord * 2.0) - 1.0;\n gl_Position = vec4(pos, 0.0, 1.0);\n v_tex = a_coord;\n}\n";function K(t){const e=t.getContext("webgl2",{preserveDrawingBuffer:!0});if(e){if(e.getExtension("EXT_color_buffer_float"))return e.pixelStorei(e.UNPACK_ALIGNMENT,1),e;alert("Unable to render to F16 buffer")}else alert("Unable to create webgl context")}function j(t,e,r){const n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),n}function J(t,e,r){const n=t.createProgram();return t.attachShader(n,e),t.attachShader(n,r),t.linkProgram(n),n}function Q(t){const e=Array(t[0].length*t.length);for(let r=0;r<t[0].length;r++)for(let n=0;n<t.length;n++)e[r*t.length+n]=t[n][r];return e}class tt{constructor(t,e,r,n){this.gl=t,this.width=e,this.height=r,this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA16F,e,r,0,t.RGBA,t.FLOAT,n),this.framebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}read(){return this.texture}write(){return this.framebuffer}}class et{constructor(t,e){this.pool=t,this.id=e}read(){return this.pool.getRead(this.id).read()}write(){return this.pool.getWrite(this.id).write()}flip(){this.pool.flip()}}class rt{constructor(t,e,r){this.gl=t,this.width=e,this.height=r,this.buffers=[new tt(t,e,r,null)],this.writeIndex=0,this.owners=[],this.onLease=-1}add(t){return this.buffers.push(new tt(this.gl,this.width,this.height,t)),this.owners.push(this.buffers.length-1),new et(this,this.owners.length-1)}getRead(t){return this.buffers[this.owners[t]]}getWrite(t){if(this.onLease>=0)throw new Error(`Illegal state: already on lease to ${this.onLease}`);return this.onLease=t,this.buffers[this.writeIndex]}flip(){if(this.onLease<0)throw new Error("Can't flip: no lease open");const t=this.owners[this.onLease];this.owners[this.onLease]=this.writeIndex,this.writeIndex=t,this.onLease=-1}}function nt(t,e,r,n){const{vertShader:i,width:o,height:s,coordBuffer:l}=n,a=J(t,i,j(t,t.FRAGMENT_SHADER,e)),u=t.createVertexArray();t.bindVertexArray(u);const c=t.getAttribLocation(a,"a_coord"),f=l;t.bindBuffer(t.ARRAY_BUFFER,f),t.enableVertexAttribArray(c);var h=t.FLOAT;t.vertexAttribPointer(c,2,h,!1,0,0);const d={program:a,width:o,height:s,vertexArray:u};for(const e of r)d[e]=t.getUniformLocation(a,e);return d}function it(t,e,r,n,i){const o=j(t,t.VERTEX_SHADER,Z),s=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,s),t.bufferData(t.ARRAY_BUFFER,new Float32Array([n.x,n.y,i.x,n.y,n.x,i.y,n.x,i.y,i.x,n.y,i.x,i.y]),t.STATIC_DRAW),{vertShader:o,width:e,height:r,coordBuffer:s}}function ot(t,e,r,n,i){t.bindFramebuffer(t.FRAMEBUFFER,n),t.viewport(0,0,e.width,e.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(e.program),t.bindVertexArray(e.vertexArray),t.uniform2f(e.u_r,e.width,e.height),t.uniform1i(e.u_S0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,r),i&&i(),t.drawArrays(t.TRIANGLES,0,6)}function st(t,e,r){return Math.max(t,Math.min(e,r))}function lt(t,e,r){return"number"==typeof t?t*(1-r)+e*r:t.lerpT(e,r)}function at(t,e=2){const r=10**e;return Math.round(t*r)/r}class ut{constructor(t,e){isNaN(t)?null==t&&(this.x=0,this.y=0):(this.x=t,this.y=e)}dot(t){return this.x*t.x+this.y*t.y}lerpT(t,e){return this.mul(1-e).add(t.mul(e))}add(t){return new ut(this.x+t.x,this.y+t.y)}sub(t){return new ut(this.x-t.x,this.y-t.y)}mul(t){return new ut(this.x*t,this.y*t)}div(t){return new ut(this.x/t,this.y/t)}floor(){return new ut(Math.floor(this.x),Math.floor(this.y))}dist(t){if(null==t)return Math.sqrt(this.x*this.x+this.y*this.y);{const e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)}}normalize(){const t=Math.sqrt(this.dot(this));return new ut(this.x/t,this.y/t)}}function ct(t=null,e=null,n="main"){var i=document.createElement("canvas");return i.id=n,i.width=t*r,i.height=e*r,i.style.width=t,i.style.height=e,document.body.appendChild(i),i}function ft(t,e="download"){const r=document.createElement("a");r.setAttribute("download",e),t.toBlob((function(t){r.setAttribute("href",URL.createObjectURL(t)),r.click()}))}class ht{constructor(t,e,r){this.x=t,this.y=e,this.z=r}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){return new ht(this.y*t.z-this.z*t.y,this.x*t.z-this.z*t.x,this.x*t.y-this.y*t.x)}lerpT(t,e){return this.mul(1-e).add(t.mul(e))}add(t){return new ht(this.x+t.x,this.y+t.y,this.z+t.z)}sub(t){return new ht(this.x-t.x,this.y-t.y,this.z-t.z)}mul(t){return new ht(this.x*t,this.y*t,this.z*t)}mul3(t){return new ht(this.x*t.x,this.y*t.y,this.z*t.z)}div(t){return new ht(this.x/t,this.y/t,this.z/t)}rotateX(t){const e=Math.cos(t),r=Math.sin(t);return new ht(this.x,this.y*e-this.z*r,this.y*r+this.z*e)}rotateY(t){const e=Math.cos(t),r=Math.sin(t);return new ht(this.x*e+this.z*r,this.y,-this.x*r+this.z*e)}rotateZ(t){const e=Math.cos(t),r=Math.sin(t);return new ht(this.x*e-this.y*r,this.x*r+this.z*e,this.z)}dist(t){if(null==t)return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);{const e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+r*r+n*n)}}normalize(){const t=this.dist();return 0===t?new ht(0,0,0):this.div(t)}toString(){return`(${at(this.x)}, ${at(this.y)}, ${at(this.z)})`}}const dt=Q([a,u,c]),xt=new ht(0,0,-2);let _t=!0,mt=!1,vt=Number(t("N")??130);const yt=`#version 300 es\nprecision highp float; uniform sampler2D u_S0; uniform vec2 u_r; in vec2 v_tex; out vec4 o_col; vec3 aces_film(vec3 x) { float a = 2.4; float b = 0.03; float c = 2.4; float d = 0.59; float e = 0.14f; return clamp((x*(a*x+b))/(x*(c*x+d)+e), 0.0, 1.0); } vec3 desat(vec3 c, float t) { float avg = dot(c, vec3(1.0)) / 3.0; return mix(c, vec3(avg), t); } void main(void) { vec3 c = texture(u_S0, v_tex).xyz; float mag = length(aces_film(c)) / sqrt(3.0); float sat = mix(float(${B}), float(${D}), mag); o_col = vec4(aces_film(desat(c, sat)), 1.0); }\n`,pt=` const mat3 C = mat3( 3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252) / 2323.8695; const float N_AIR = 1.0; const float N_GLASS = 2.0; const float MAX_T = 10000.0; uniform sampler2D u_S0; uniform vec2 u_r; uniform vec3 u_obs[${f}]; uniform vec2 u_Ts; uniform vec2 u_Ti; uniform float u_st; uniform float u_t; uniform float u_s; uniform vec2 u_sxy; uniform vec3 u_eye; uniform float u_fov; uniform vec3 u_s_c[${X}]; uniform float u_s_r[${X}]; uniform vec4 u_ls[${C}]; in vec2 v_tex; out vec4 o_col; float PHI = 1.61803398; float PI = 3.14159265; float GN(in vec2 xy, in float seed) { return fract(tan(distance(xy * PHI, xy) * seed) * xy.x); } float N(in vec2 xy, inout float seed) { xy += u_sxy; xy *= u_r; seed = GN(xy, seed); return GN(xy, seed); } vec2 N2(in vec2 xy, inout float seed) { return vec2(N(xy, seed), N(xy, seed)); } vec3 col(in float S[${f}]) { vec3 T[${f}]; for (int f = 0; f < ${f}; f++) { T[f] = S[f] * u_obs[f]; } vec3 res = vec3(0.0); for (int f = 0; f < ${f} - 1; f++) { res += T[f] + T[f + 1]; } return res * C; } float cbp(float c, float w, float x) { x = abs(x - c); if (x > w) { return 0.0; } x /= w; return 1.0 - x * x * (3.0 - 2.0 * x); } vec2 sr(in vec3 ro, in vec3 rd, in vec3 ce, in float ra) { vec3 oc = ro - ce; float b = dot(oc, rd); float c = dot(oc, oc) - ra * ra; float h = b * b - c; if (h < 0.0) { return vec2(-1.0); } h = sqrt(h); return vec2(-b - h, -b + h); } vec3 sn(in vec3 p, in vec3 ce) { return normalize(p - ce); } vec2 gv() { return (u_Ti + v_tex) / u_Ts; } vec2 gm() { float a = float(0.75); float sd = float(0.85); vec2 ideal; if (u_r.x > u_r.y * a) { ideal = vec2(u_r.y * a, u_r.y); } else { ideal = vec2(u_r.x, u_r.x / a); } ideal *= sd; return (u_r - ideal) / 2.0; } void rord(in vec2 tex, out vec3 ro, out vec3 rd, out vec2 res) { ro = u_eye; res = u_r; float fov = u_fov; float scale = min(u_r.x, u_r.y); vec2 disp = tex * vec2(u_r.x / scale, u_r.y / scale); disp -= vec2(u_r.x / scale, u_r.y / scale) * 0.5; float z = 1.0 / tan(fov * 0.5); rd = vec3(disp, z); } float pr(in vec3 ro, in vec3 rd, in vec4 p) { return -(dot(ro, p.xyz) + p.w) / dot(rd, p.xyz); } vec3 pn(in vec4 p) { return p.xyz; } `,wt=`#version 300 es\nprecision highp float; ${pt} float ss(in vec2 v) { if (v.x >= 0.0) { return v.x; } else { return v.y; } } float its(in vec3 ro, in vec3 rd, in vec3 lpt, out vec3 pt, out vec3 norm, out float mat) { float mt = MAX_T; for (int i = 0; i < ${X}; i++) { float r = u_s_r[i]; if (r < 0.0) { break; } vec3 ce = u_s_c[i]; float it = ss(sr(ro, rd, ce, r)); if (it > 0.0 && it < mt) { mt = it; norm = sn(lpt, ce); mat = 1.0 + float(i); } } for (int i = 0; i < ${C}; i++) { vec4 l = u_ls[i]; if (length(l) == 0.0) { break; } float it = pr(ro, rd, l); if (it > 0.0 && it < mt) { mt = it; norm = pn(l); mat = -1.0; } } pt = ro + rd * mt; return mt; } float gior(in vec3 pt) { for (int i = ${X} - 1; i >= 0; i--) { float r = u_s_r[i]; if (r < 0.0) { break; } vec3 ce = u_s_c[i]; if (length(ce - pt) < r) { return N_GLASS + float(i); } } return N_AIR; } float cast_ray(in vec3 ro, in vec3 rd, in float nm, inout vec3 lpt) { float ior = N_AIR; for (int i = 0; i < 8; i++) { rd = normalize(rd); ro = ro + float(${E}) * rd; float mat; vec3 norm; vec3 pt; float d = its(ro, rd, lpt, pt, norm, mat); if (d >= MAX_T || d < 0.0) { return 0.0; } if (mat < 0.0) { float A = max(0.0, dot(norm, rd)); float c = 1.0 * float(i) / float(8); float lt = mat / -float(${C} - 1); float light_c = A + mix(-float(${P}), float(${P}), lt); return cbp(light_c, float(${S}), nm + float(${z}) + c) * A; } ro = pt; lpt = pt; float nior = gior(pt + 0.001 * rd); vec3 nrd = refract(rd, norm, ior / nior); if (dot(nrd, nrd) != 0.0) { rd = nrd; } ro = ro + float(${R}) * norm; ior = nior; } return 0.0; } void main(void) { float S[${f}]; for (int c = 0; c < ${f}; c++) { S[c] = 0.0; } vec3 ro; vec3 rd; vec2 res; vec2 tex = gv(); vec2 px = tex * u_r; vec2 margin = gm(); vec2 to_edge = vec2(min(u_r.x - px.x, px.x), min(u_r.y - px.y, px.y)) - margin; if (to_edge.x < 0.0 || to_edge.y < 0.0) { o_col = vec4(100.0, 100.0, 100.0, 1.0); return; } rord(tex, ro, rd, res); float seed = u_s; int casts = 4; float w = float(${M}) / float(casts); vec3 lp = vec3(0.0); for (int i = 0; i < casts; i++) { vec2 aa = N2(tex, seed) / (u_r * u_Ts); vec3 trd = normalize(rd + vec3(aa, 0.0)); float nm = N(tex, seed); float A = cast_ray(ro, trd, nm, lp) * w; for (int c = 0; c < ${f}; c++) { float t = (float(c) + 0.5) / float(${f}); S[c] += cbp(${v?"1.0 - nm":"nm"}, float(${L}), t) * A; } } vec4 l_col = texture(u_S0, v_tex); vec4 n_col = vec4(col(S), 1.0); float t = 1.0 / u_st; o_col = l_col * (1.0 - t) + max(n_col * t, 0.0); }\n`;function Tt(t,e,r,n,i,o){t.fillStyle="white",t.fillRect(0,0,e,r),t.font="9pt Arial";const s=new ut(Math.sqrt(3)/2,.5).normalize(),l=new ut(0,-1).normalize(),a=new ut(-Math.sqrt(3)/2,.5).normalize(),u=r/4,c=new ut(e/2,r/2);let f=t=>s.mul(t.x).add(l.mul(t.y)).add(a.mul(t.z)).mul(u).add(c);const h=f(new ht(0,0,0)),d=[f(new ht(1.1,0,0)),f(new ht(0,1.1,0)),f(new ht(0,0,1.1))],x=["X","Y","Z"];for(let e=0;e<d.length;e++){const r=d[e],n=x[e];t.beginPath(),t.strokeStyle="#aaa",t.moveTo(r.x,r.y),t.lineTo(h.x,h.y),t.stroke(),t.fillStyle="#777",t.textBaseline="middle";const i=h.lerpT(r,1.15);let o=t.measureText(n).width;t.fillText(n,i.x-o/2,i.y)}const _=f(xt);t.fillStyle="red",t.fillRect(_.x-2,_.y-2,4,4);let m=t.measureText(xt.toString()).width;t.textBaseline="top",t.fillText(xt.toString(),_.x-m/2,_.y+6);const v=Math.min(o.x,o.y),y=o.div(v).mul(.5),p=1/Math.tan(.5*O),w=new ht(y.x,y.y,p).normalize(),T=Math.abs(xt.z/w.z),g=f(new ht(w.x,w.y,0).mul(T)),A=f(new ht(-w.x,w.y,0).mul(T)),b=f(new ht(-w.x,-w.y,0).mul(T)),E=f(new ht(w.x,-w.y,0).mul(T));t.fillStyle="#ee7777";for(const e of[g,A,b,E])t.fillRect(e.x-2,e.y-2,4,4);let R=!0;t.beginPath(),t.strokeStyle="#ee9999",t.lineWidth=1;for(const e of[g,A,b,E])R?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),R=!1;t.closePath(),t.stroke();for(let e=0;e<n.length;e++){const{center:r,radius:i}=n[e],o=f(r),s=i*u;t.beginPath(),t.strokeStyle="black",t.arc(o.x,o.y,s,0,2*Math.PI),t.stroke()}for(let e=0;e<i.length;e++){const{norm:r}=i[e],n=f(r.mul(1.1));t.fillStyle="blue",t.fillRect(n.x-2,n.y-2,4,4);const o=r.toString(),s=t.measureText(o);m=s.width;const l=s.fontBoundingBoxAscent+s.fontBoundingBoxDescent;t.fillStyle="#ffffff99",t.fillRect(n.x-m/2,n.y+3,m,l),t.textBaseline="top",t.fillStyle="blue",t.fillText(o,n.x-m/2,n.y+6)}t.textBaseline="top",t.fillStyle="red",t.fillText("EYE",10,4),t.fillRect(4,7,4,4),t.fillStyle="blue",t.fillText("LIGHTS",10,18),t.fillRect(4,21,4,4),t.fillStyle="black",t.fillText("OPTICS",10,32),t.fillRect(4,35,4,4),t.fillStyle="#ee9999",t.fillText("VIEWPORT",10,46),t.fillRect(4,49,4,4)}function gt(t,e,r){const n=it(t,e,r,new ut,new ut(1,1)),i=new rt(t,e,r),o=i.add();return{spectralShader:nt(t,wt,["u_r","u_obs","u_S0","u_st","u_t","u_s","u_sxy","u_s_r","u_s_c","u_eye","u_fov","u_ls","u_Ts","u_Ti"],n,!0),displayShader:nt(t,yt,["u_r","u_S0"],n,!0),bufferPool:i,buffer:o,width:e,height:r}}function At(t,e,r,n,i,o){const l=i.map((t=>[t.center.x,t.center.y,t.center.z])).flat(),a=i.map((t=>t.radius));a.length<X&&a.push(-1);const u=o.map((t=>[t.norm.x,t.norm.y,t.norm.z,t.offset])).flat();for(;u.length<4*C;)u.push(0);ot(t,e,r.read(),r.write(),(()=>{t.uniform3fv(e.u_obs,dt),t.uniform1f(e.u_st,n),t.uniform1f(e.u_t,n/vt),t.uniform1f(e.u_s,s(-1,1)),t.uniform2f(e.u_sxy,s(-1,1),s(-1,1)),t.uniform3fv(e.u_s_c,l),t.uniform1fv(e.u_s_r,a),t.uniform3f(e.u_eye,xt.x,xt.y,xt.z),t.uniform1f(e.u_fov,O),t.uniform4fv(e.u_ls,u),t.uniform2f(e.u_Ts,W[1],W[0]),t.uniform2f(e.u_Ti,V[1],W[0]-V[0]-1)}))}function bt(t,e,r,n,i){t.canvas.width=e.width,t.canvas.height=e.height,At(t,e.spectralShader,e.buffer,r,n,i),e.buffer.flip(),ot(t,e.displayShader,e.buffer.read(),null,null)}class Et{constructor(t,e,r=3,n=[]){this.gen=t,this.rank=e,this.N=r,this.samples=n}sample(){let t=Number.MAX_VALUE,e=null;for(let r=0;r<this.N;r++){const r=this.gen(),n=this.samples.map((t=>this.rank(t,r))).reduce(((t,e)=>t+e),0);n<t&&(t=n,e=r)}return this.samples.push(e),e}}class Rt{constructor(t,e,r=[]){this.gen=t,this.filter=e,this.samples=r}sample(){let t=!1,e=null;for(;!t;)e=this.gen(),t=this.filter(e)&&this.samples.every((t=>this.filter(e,t)));return this.samples.push(e),e}}function St(){let n=window.innerWidth,i=window.innerHeight;new ut(0,0);const o=new ut(n,i).floor(),[a,u]=[o.x,o.y],c=ct(a,u,"display"),f=K(c);if(!f)return;const h=gt(f,a*r,u*r);let d=null,x=null;d=ct(H,H,"scene"),d.style.position="absolute",d.style.top="0",d.style.left="0",x=d.getContext("2d");let _=t("v")??!1;const m=()=>{d.style.zIndex=_?"10":"-10"};m();new ht(0,1,0).cross(xt.normalize());const v=new ht(1,1.5,q),y=[{radius:1,center:(t=>{let e=s(.2,1),r=s(.2,1);const n=1*e/30*Math.PI*(l()?-1:1),i=1*r/15*Math.PI*(l()?-1:1);return new ht(0,0,t).rotateY(n).rotateX(i)})(.001)}],p=new Et((()=>{const t=y.length/(X-1),e=lt(I,N,(r=t,Math.pow(r,.25)));var r;const n=(t=>{let e=s(),r=s();const n=e*Math.PI*2,i=r*Math.PI*2;return new ht(0,0,t).rotateY(n).rotateX(i)})(lt(0,$-e,Math.sqrt(s()))).mul3(v);return{center:n,radius:e}}),((t,e)=>{const r=t.center.x-e.center.x,n=t.center.y-e.center.y;return-1*(r*r+n*n)}),Math.floor(s(6,10)),[]);for(;y.length<X;)y.push(p.sample());const w=[xt.normalize()],T=new Rt((()=>new ht(0,0,1).rotateX(s(2*Math.PI)).rotateY(s(2*Math.PI))),((t,e)=>null==e?t.z<.49:t.dot(e)<.8),w),g=Array(C).fill(null).map((()=>({norm:T.sample().rotateX(0),offset:-50})));Tt(x,H,H,y,g,o);let A=1;!function t(){A>=vt+1?document.title="FULL_SPECTRUM":(bt(f,h,A,y,g),A++,document.title=`FULL_SPECTRUM (${at(A/vt*100,1)}%)`,window.requestAnimationFrame(t))}(),window.addEventListener("keydown",(t=>{if("v"==t.key)_=!_,m();else if("d"==t.key){const t=V[0].toString().padStart(2,"0"),r=V[1].toString().padStart(2,"0");ft(c,`FULL_SPECTRUM_${e}_${t}x${r}`)}}))}St();
2tMPIoRxv2bJYL48tscOyuyYXMF1DQ==YlZAEJq8QDhuyAYHR4yrQg==U3eWvVQdf9KH/KpEE88vC+ggJtUcfA==hPVWFiPkyPnttBFd7XlopQ==nt5fpCmfplQqF7zi1jRxMtVtD9WD1Q==PNLePfp70C1tbLrOuUTBfQ==LddhfTc0yXwrVC160IFVVrOGmT4geg==2m6W+fSYocn2HEwum/ONMg==7/UPUxhqT3Ok//Af3O9LX1MSR5RjiQ==p8OyCwMA5bedTq44313MfA==uxlQtLaUUHR1FOOg9H5RbHIvISjTQg==HyAiZM9PHVkzBq4XY0Fngw==AoA3w8Fx1x4RHHQDk/4f+8LmMkFvQQ==0Vb9+skthD/RILkzBj1BJQ==iArqkYKbgNk0ClhHWzdzdxaQY0THCQ==T1qbWXCDmJdeU3g9obCJzQ==PTmRFyRmJQLqHWjdBR5sFKgPX9gH/w==/mNXaVMJWr8Ks2y8Trce+w==F/n0qYP1WU0Tjcp7WWMds3ajx/SuWg==vl7WnmzmT7Rwx0y7QAXLXw==B6RTrcrPR9UqSxsmg5ZGaw1SGcGSEA==uoNQgCA+YP4zHrXPoQPc/w==cls7B+UGbYvsPmwsnlqXU3nJ4BNrHw==aBnNzrolTAxDPqwIYtwrkA==D67N9NeTYJQ0s6JvbT9JDtd70ZlIMQ==LoagSjXhdnITp50dH8PJGQ==2iTrqEJcVv1P2oRHqdS0lagNQyi4eg==eCQkiFAZ6ljbN1Y0/uPNcw==
function t(t){return new URL(window.location.href).searchParams.get(t)}console.log("Made by Lars Wander https://larswander.com"),console.log("Licensed under CC BY-NC-SA 4.0");const e=tokenData.hash;console.log(tokenData.hash);class r{constructor(){this.useA=!1;let t=function(t){let e=parseInt(t.substring(0,8),16),r=parseInt(t.substring(8,16),16),n=parseInt(t.substring(16,24),16),i=parseInt(t.substring(24,32),16);return function(){e|=0,r|=0,n|=0,i|=0;let t=(e+r|0)+i|0;return i=i+1|0,e=r^r>>>9,r=n+(n<<3)|0,n=n<<21|n>>>11,n=n+t|0,(t>>>0)/4294967296}};this.prngA=new t(e.substring(2,34)),this.prngB=new t(e.substring(34,66));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}}const n=new r,i=()=>n.random();function o(t,e){null==e&&(e=t,t=0),null==e&&(e=1);const r=e-t;return i()*r+t}function s(t){return null==t&&(t=.5),i()<t}const l=[.01,.1312,1.5806,7.7489,19.1068,27.2789,40.2367,43.3749,35.6146,22.4668,9.3318,1.7627,.4155,4.0426,12.3338,25.4684,39.3398,55.1236,70.52,84.6489,97.1482,99.1948,101.167,92.3319,75.0964,53.9294,36.1246,21.4712,12.2407,6.6892,3.2018,1.3875,.6874,.342,.1355,.0699,.0375,.0191],a=[0,.0164,.1655,.8051,1.9994,3.3546,6.5121,10.4722,15.1035,21.2723,29.3981,36.8978,50.3903,65.4035,79.829,94.2494,100.4376,103.1928,99.73,92.057,83.2302,68.9442,59.2511,47.3083,34.9129,23.6123,15.0491,8.6109,4.8369,2.6164,1.2447,.5369,.265,.1338,.0493,.028,.015,.0064],u=[.035,.5738,7.1169,35.6246,90.8624,134.661,206.3009,233.4076,205.6291,151.3409,89.5041,45.1892,23.8938,12.0738,6.3608,3.2845,1.4303,.4162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=l.length,f=o(),h=o(),d=o(),x=o(),_=o(),m=s(.1)&&_>.4,v=o(),y=o(),p=o(),w=o(),T=o(),g=8,b=4,A=st(.01,.07,f),E=A*st(.1,.6,h),R=st(.18,.3,x),S=180*st(1,.7,x),M=st(-.4,.14,_),z=st(.01,.15,T),P=3/c,N=.02,L=st(.09,st(.13,.11,d),v),I=0,U=.16,$=t=>Math.pow(t,.25),F=st(.21,.45,y),B=st(.4,.55,y),D=Math.round(st(20,38,d)),X=2,C=1,k=st(.75,st(.52,.56,v),p),O=.85,G=.75,Y=st(3.5,4.5,w),H=Number(t("Dpx")??500),q=(t("T")??"1,1").split(",").map((t=>Number(t))),W=(t("i")??"0,0").split(",").map((t=>Number(t)));console.table({RAY_EXTEND_T:f,RAY_NORMAL_T:h,SPECTRAL_SEPARATION_T:x,SPECTRAL_BIAS_T:_,SKEW_Z_T:w,SPECTRAL_LIGHT_SPREAD_T:T,SPHERE_COUNT:D,SPHERE_COUNT_T:d,MAX_SPHERE_SIZE_T:v,SECONDARY_RADIUS_MAX:L,DESAT_T:y,ZOOM_T:p});const V="#version 300 es\nprecision highp float;\n\nin vec2 a_coord;\n\nout vec2 v_tex;\n\nvoid main() {\n vec2 pos = (a_coord * 2.0) - 1.0;\n gl_Position = vec4(pos, 0.0, 1.0);\n v_tex = a_coord;\n}\n";function Z(t){const e=t.getContext("webgl2",{preserveDrawingBuffer:!0});if(e){if(e.getExtension("EXT_color_buffer_float"))return e.pixelStorei(e.UNPACK_ALIGNMENT,1),e;alert("Unable to render to F16 buffer")}else alert("Unable to create webgl context")}function K(t,e,r){const n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),n}function j(t,e,r){const n=t.createProgram();return t.attachShader(n,e),t.attachShader(n,r),t.linkProgram(n),n}function J(t){const e=Array(t[0].length*t.length);for(let r=0;r<t[0].length;r++)for(let n=0;n<t.length;n++)e[r*t.length+n]=t[n][r];return e}class Q{constructor(t,e,r,n){this.gl=t,this.width=e,this.height=r,this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA16F,e,r,0,t.RGBA,t.FLOAT,n),this.framebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}read(){return this.texture}write(){return this.framebuffer}}class tt{constructor(t,e){this.pool=t,this.id=e}read(){return this.pool.getRead(this.id).read()}write(){return this.pool.getWrite(this.id).write()}flip(){this.pool.flip()}}class et{constructor(t,e,r){this.gl=t,this.width=e,this.height=r,this.buffers=[new Q(t,e,r,null)],this.writeIndex=0,this.owners=[],this.onLease=-1}add(t){return this.buffers.push(new Q(this.gl,this.width,this.height,t)),this.owners.push(this.buffers.length-1),new tt(this,this.owners.length-1)}getRead(t){return this.buffers[this.owners[t]]}getWrite(t){return this.onLease=t,this.buffers[this.writeIndex]}flip(){const t=this.owners[this.onLease];this.owners[this.onLease]=this.writeIndex,this.writeIndex=t,this.onLease=-1}}function rt(t,e,r,n){const{vertShader:i,width:o,height:s,coordBuffer:l}=n,a=j(t,i,K(t,t.FRAGMENT_SHADER,e)),u=t.createVertexArray();t.bindVertexArray(u);const c=t.getAttribLocation(a,"a_coord"),f=l;t.bindBuffer(t.ARRAY_BUFFER,f),t.enableVertexAttribArray(c);var h=t.FLOAT;t.vertexAttribPointer(c,2,h,!1,0,0);const d={program:a,width:o,height:s,vertexArray:u};for(const e of r)d[e]=t.getUniformLocation(a,e);return d}function nt(t,e,r,n,i){const o=K(t,t.VERTEX_SHADER,V),s=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,s),t.bufferData(t.ARRAY_BUFFER,new Float32Array([n.x,n.y,i.x,n.y,n.x,i.y,n.x,i.y,i.x,n.y,i.x,i.y]),t.STATIC_DRAW),{vertShader:o,width:e,height:r,coordBuffer:s}}function it(t,e,r,n,i){t.bindFramebuffer(t.FRAMEBUFFER,n),t.viewport(0,0,e.width,e.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(e.program),t.bindVertexArray(e.vertexArray),t.uniform2f(e.u_r,e.width,e.height),t.uniform1i(e.u_S0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,r),i&&i(),t.drawArrays(t.TRIANGLES,0,6)}function ot(t,e,r){return Math.max(t,Math.min(e,r))}function st(t,e,r){return"number"==typeof t?t*(1-r)+e*r:t.lerpT(e,r)}function lt(t,e=2){const r=10**e;return Math.round(t*r)/r}class at{constructor(t,e){isNaN(t)?null==t&&(this.x=0,this.y=0):(this.x=t,this.y=e)}dot(t){return this.x*t.x+this.y*t.y}lerpT(t,e){return this.mul(1-e).add(t.mul(e))}add(t){return new at(this.x+t.x,this.y+t.y)}sub(t){return new at(this.x-t.x,this.y-t.y)}mul(t){return new at(this.x*t,this.y*t)}div(t){return new at(this.x/t,this.y/t)}floor(){return new at(Math.floor(this.x),Math.floor(this.y))}dist(t){if(null==t)return Math.sqrt(this.x*this.x+this.y*this.y);{const e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)}}normalize(){const t=Math.sqrt(this.dot(this));return new at(this.x/t,this.y/t)}}function ut(t=null,e=null,r="main"){window.innerWidth,window.innerHeight;var n=document.createElement("canvas");return n.id=r,n.width=t,n.height=e,n.style.width=t,n.style.height=e,document.body.appendChild(n),n}function ct(t,e){const r=document.createElement("a");r.setAttribute("download",e),t.toBlob((function(t){r.setAttribute("href",URL.createObjectURL(t)),r.click()}))}class ft{constructor(t,e,r){this.x=t,this.y=e,this.z=r}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){return new ft(this.y*t.z-this.z*t.y,this.x*t.z-this.z*t.x,this.x*t.y-this.y*t.x)}lerpT(t,e){return this.mul(1-e).add(t.mul(e))}add(t){return new ft(this.x+t.x,this.y+t.y,this.z+t.z)}sub(t){return new ft(this.x-t.x,this.y-t.y,this.z-t.z)}mul(t){return new ft(this.x*t,this.y*t,this.z*t)}mul3(t){return new ft(this.x*t.x,this.y*t.y,this.z*t.z)}div(t){return new ft(this.x/t,this.y/t,this.z/t)}rotateX(t){const e=Math.cos(t),r=Math.sin(t);return new ft(this.x,this.y*e-this.z*r,this.y*r+this.z*e)}rotateY(t){const e=Math.cos(t),r=Math.sin(t);return new ft(this.x*e+this.z*r,this.y,-this.x*r+this.z*e)}rotateZ(t){const e=Math.cos(t),r=Math.sin(t);return new ft(this.x*e-this.y*r,this.x*r+this.z*e,this.z)}dist(t){if(null==t)return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);{const e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+r*r+n*n)}}normalize(){const t=this.dist();return 0===t?new ft(0,0,0):this.div(t)}toString(){return`(${lt(this.x)}, ${lt(this.y)}, ${lt(this.z)})`}}const ht=J([l,a,u]),dt=new ft(0,0,-2);let xt=!0,_t=!1,mt=Number(t("N")??130);const vt=`#version 300 es\nprecision highp float; uniform sampler2D u_S0; uniform vec2 u_r; in vec2 v_tex; out vec4 o_col; vec3 aces_film(vec3 x) { float a = 2.4; float b = 0.03; float c = 2.4; float d = 0.59; float e = 0.14f; return clamp((x*(a*x+b))/(x*(c*x+d)+e), 0.0, 1.0); } vec3 desat(vec3 c, float t) { float avg = dot(c, vec3(1.0)) / 3.0; return mix(c, vec3(avg), t); } void main(void) { vec3 c = texture(u_S0, v_tex).xyz; float mag = length(aces_film(c)) / sqrt(3.0); float sat = mix(float(${F}), float(${B}), mag); o_col = vec4(aces_film(desat(c, sat)), 1.0); }\n`,yt=` const mat3 C = mat3( 3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252) / 2323.8695; const float N_AIR = 1.0; const float N_GLASS = 2.0; const float MAX_T = 10000.0; uniform sampler2D u_S0; uniform vec2 u_r; uniform vec3 u_obs[${c}]; uniform vec2 u_Ts; uniform vec2 u_Ti; uniform float u_st; uniform float u_t; uniform float u_s; uniform vec2 u_sxy; uniform vec3 u_eye; uniform float u_fov; uniform vec3 u_s_c[${D}]; uniform float u_s_r[${D}]; uniform vec4 u_ls[${X}]; in vec2 v_tex; out vec4 o_col; float PHI = 1.61803398; float PI = 3.14159265; float GN(in vec2 xy, in float seed) { return fract(tan(distance(xy * PHI, xy) * seed) * xy.x); } float N(in vec2 xy, inout float seed) { xy += u_sxy; xy *= u_r; seed = GN(xy, seed); return GN(xy, seed); } vec2 N2(in vec2 xy, inout float seed) { return vec2(N(xy, seed), N(xy, seed)); } vec3 col(in float S[${c}]) { vec3 T[${c}]; for (int f = 0; f < ${c}; f++) { T[f] = S[f] * u_obs[f]; } vec3 res = vec3(0.0); for (int f = 0; f < ${c} - 1; f++) { res += T[f] + T[f + 1]; } return res * C; } float cbp(float c, float w, float x) { x = abs(x - c); if (x > w) { return 0.0; } x /= w; return 1.0 - x * x * (3.0 - 2.0 * x); } vec2 sr(in vec3 ro, in vec3 rd, in vec3 ce, in float ra) { vec3 oc = ro - ce; float b = dot(oc, rd); float c = dot(oc, oc) - ra * ra; float h = b * b - c; if (h < 0.0) { return vec2(-1.0); } h = sqrt(h); return vec2(-b - h, -b + h); } vec3 sn(in vec3 p, in vec3 ce) { return normalize(p - ce); } vec2 gv() { return (u_Ti + v_tex) / u_Ts; } vec2 gm() { float a = float(0.75); float sd = float(0.85); vec2 ideal; if (u_r.x > u_r.y * a) { ideal = vec2(u_r.y * a, u_r.y); } else { ideal = vec2(u_r.x, u_r.x / a); } ideal *= sd; return (u_r - ideal) / 2.0; } void rord(in vec2 tex, out vec3 ro, out vec3 rd, out vec2 res) { ro = u_eye; res = u_r; float fov = u_fov; float scale = min(u_r.x, u_r.y); vec2 disp = tex * vec2(u_r.x / scale, u_r.y / scale); disp -= vec2(u_r.x / scale, u_r.y / scale) * 0.5; float z = 1.0 / tan(fov * 0.5); rd = vec3(disp, z); } float pr(in vec3 ro, in vec3 rd, in vec4 p) { return -(dot(ro, p.xyz) + p.w) / dot(rd, p.xyz); } vec3 pn(in vec4 p) { return p.xyz; } `,pt=`#version 300 es\nprecision highp float; ${yt} float ss(in vec2 v) { if (v.x >= 0.0) { return v.x; } else { return v.y; } } float its(in vec3 ro, in vec3 rd, in vec3 lpt, out vec3 pt, out vec3 norm, out float mat) { float mt = MAX_T; for (int i = 0; i < ${D}; i++) { float r = u_s_r[i]; if (r < 0.0) { break; } vec3 ce = u_s_c[i]; float it = ss(sr(ro, rd, ce, r)); if (it > 0.0 && it < mt) { mt = it; norm = sn(lpt, ce); mat = 1.0 + float(i); } } for (int i = 0; i < ${X}; i++) { vec4 l = u_ls[i]; if (length(l) == 0.0) { break; } float it = pr(ro, rd, l); if (it > 0.0 && it < mt) { mt = it; norm = pn(l); mat = -1.0; } } pt = ro + rd * mt; return mt; } float gior(in vec3 pt) { for (int i = ${D} - 1; i >= 0; i--) { float r = u_s_r[i]; if (r < 0.0) { break; } vec3 ce = u_s_c[i]; if (length(ce - pt) < r) { return N_GLASS + float(i); } } return N_AIR; } float cast_ray(in vec3 ro, in vec3 rd, in float nm, inout vec3 lpt) { float ior = N_AIR; for (int i = 0; i < 8; i++) { rd = normalize(rd); ro = ro + float(${A}) * rd; float mat; vec3 norm; vec3 pt; float d = its(ro, rd, lpt, pt, norm, mat); if (d >= MAX_T || d < 0.0) { return 0.0; } if (mat < 0.0) { float A = max(0.0, dot(norm, rd)); float c = 1.0 * float(i) / float(8); float lt = mat / -float(${X} - 1); float light_c = A + mix(-float(${z}), float(${z}), lt); return cbp(light_c, float(${R}), nm + float(${M}) + c) * A; } ro = pt; lpt = pt; float nior = gior(pt + 0.001 * rd); vec3 nrd = refract(rd, norm, ior / nior); if (dot(nrd, nrd) != 0.0) { rd = nrd; } ro = ro + float(${E}) * norm; ior = nior; } return 0.0; } void main(void) { float S[${c}]; for (int c = 0; c < ${c}; c++) { S[c] = 0.0; } vec3 ro; vec3 rd; vec2 res; vec2 tex = gv(); vec2 px = tex * u_r; vec2 margin = gm(); vec2 to_edge = vec2(min(u_r.x - px.x, px.x), min(u_r.y - px.y, px.y)) - margin; if (to_edge.x < 0.0 || to_edge.y < 0.0) { o_col = vec4(100.0, 100.0, 100.0, 1.0); return; } rord(tex, ro, rd, res); float seed = u_s; int casts = 4; float w = float(${S}) / float(casts); vec3 lp = vec3(0.0); for (int i = 0; i < casts; i++) { vec2 aa = N2(tex, seed) / (u_r * u_Ts); vec3 trd = normalize(rd + vec3(aa, 0.0)); float nm = N(tex, seed); float A = cast_ray(ro, trd, nm, lp) * w; for (int c = 0; c < ${c}; c++) { float t = (float(c) + 0.5) / float(${c}); S[c] += cbp(${m?"1.0 - nm":"nm"}, float(${P}), t) * A; } } vec4 l_col = texture(u_S0, v_tex); vec4 n_col = vec4(col(S), 1.0); float t = 1.0 / u_st; o_col = l_col * (1.0 - t) + max(n_col * t, 0.0); }\n`;function wt(t,e,r,n,i,o){t.fillStyle="white",t.fillRect(0,0,e,r),t.font="9pt Arial";const s=new at(Math.sqrt(3)/2,.5).normalize(),l=new at(0,-1).normalize(),a=new at(-Math.sqrt(3)/2,.5).normalize(),u=r/4,c=new at(e/2,r/2);let f=t=>s.mul(t.x).add(l.mul(t.y)).add(a.mul(t.z)).mul(u).add(c);const h=f(new ft(0,0,0)),d=[f(new ft(1.1,0,0)),f(new ft(0,1.1,0)),f(new ft(0,0,1.1))],x=["X","Y","Z"];for(let e=0;e<d.length;e++){const r=d[e],n=x[e];t.beginPath(),t.strokeStyle="#aaa",t.moveTo(r.x,r.y),t.lineTo(h.x,h.y),t.stroke(),t.fillStyle="#777",t.textBaseline="middle";const i=h.lerpT(r,1.15);let o=t.measureText(n).width;t.fillText(n,i.x-o/2,i.y)}const _=f(dt);t.fillStyle="red",t.fillRect(_.x-2,_.y-2,4,4);let m=t.measureText(dt.toString()).width;t.textBaseline="top",t.fillText(dt.toString(),_.x-m/2,_.y+6);const v=Math.min(o.x,o.y),y=o.div(v).mul(.5),p=1/Math.tan(.5*k),w=new ft(y.x,y.y,p).normalize(),T=Math.abs(dt.z/w.z),g=f(new ft(w.x,w.y,0).mul(T)),b=f(new ft(-w.x,w.y,0).mul(T)),A=f(new ft(-w.x,-w.y,0).mul(T)),E=f(new ft(w.x,-w.y,0).mul(T));t.fillStyle="#ee7777";for(const e of[g,b,A,E])t.fillRect(e.x-2,e.y-2,4,4);let R=!0;t.beginPath(),t.strokeStyle="#ee9999",t.lineWidth=1;for(const e of[g,b,A,E])R?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),R=!1;t.closePath(),t.stroke();for(let e=0;e<n.length;e++){const{center:r,radius:i}=n[e],o=f(r),s=i*u;t.beginPath(),t.strokeStyle="black",t.arc(o.x,o.y,s,0,2*Math.PI),t.stroke()}for(let e=0;e<i.length;e++){const{norm:r}=i[e],n=f(r.mul(1.1));t.fillStyle="blue",t.fillRect(n.x-2,n.y-2,4,4);const o=r.toString(),s=t.measureText(o);m=s.width;const l=s.fontBoundingBoxAscent+s.fontBoundingBoxDescent;t.fillStyle="#ffffff99",t.fillRect(n.x-m/2,n.y+3,m,l),t.textBaseline="top",t.fillStyle="blue",t.fillText(o,n.x-m/2,n.y+6)}t.textBaseline="top",t.fillStyle="red",t.fillText("EYE",10,4),t.fillRect(4,7,4,4),t.fillStyle="blue",t.fillText("LIGHTS",10,18),t.fillRect(4,21,4,4),t.fillStyle="black",t.fillText("OPTICS",10,32),t.fillRect(4,35,4,4),t.fillStyle="#ee9999",t.fillText("VIEWPORT",10,46),t.fillRect(4,49,4,4)}function Tt(t,e,r){const n=nt(t,e,r,new at,new at(1,1)),i=new et(t,e,r),o=i.add();return{spectralShader:rt(t,pt,["u_r","u_obs","u_S0","u_st","u_t","u_s","u_sxy","u_s_r","u_s_c","u_eye","u_fov","u_ls","u_Ts","u_Ti"],n,!0),displayShader:rt(t,vt,["u_r","u_S0"],n,!0),bufferPool:i,buffer:o,width:e,height:r}}function gt(t,e,r,n,i,s){const l=i.map((t=>[t.center.x,t.center.y,t.center.z])).flat(),a=i.map((t=>t.radius));a.length<D&&a.push(-1);const u=s.map((t=>[t.norm.x,t.norm.y,t.norm.z,t.offset])).flat();for(;u.length<4*X;)u.push(0);it(t,e,r.read(),r.write(),(()=>{t.uniform3fv(e.u_obs,ht),t.uniform1f(e.u_st,n),t.uniform1f(e.u_t,n/mt),t.uniform1f(e.u_s,o(-1,1)),t.uniform2f(e.u_sxy,o(-1,1),o(-1,1)),t.uniform3fv(e.u_s_c,l),t.uniform1fv(e.u_s_r,a),t.uniform3f(e.u_eye,dt.x,dt.y,dt.z),t.uniform1f(e.u_fov,k),t.uniform4fv(e.u_ls,u),t.uniform2f(e.u_Ts,q[1],q[0]),t.uniform2f(e.u_Ti,W[1],q[0]-W[0]-1)}))}function bt(t,e,r,n,i){t.canvas.width=e.width,t.canvas.height=e.height,gt(t,e.spectralShader,e.buffer,r,n,i),e.buffer.flip(),it(t,e.displayShader,e.buffer.read(),null,null)}class At{constructor(t,e,r=3,n=[]){this.gen=t,this.rank=e,this.N=r,this.samples=n}sample(){let t=Number.MAX_VALUE,e=null;for(let r=0;r<this.N;r++){const r=this.gen(),n=this.samples.map((t=>this.rank(t,r))).reduce(((t,e)=>t+e),0);n<t&&(t=n,e=r)}return this.samples.push(e),e}}class Et{constructor(t,e,r=[]){this.gen=t,this.filter=e,this.samples=r}sample(){let t=!1,e=null;for(;!t;)e=this.gen(),t=this.filter(e)&&this.samples.every((t=>this.filter(e,t)));return this.samples.push(e),e}}function Rt(){let r=window.innerWidth,n=window.innerHeight;new at(0,0);const i=new at(r,n).floor(),[l,a]=[i.x,i.y],u=ut(l,a,"display"),c=Z(u);if(!c)return;const f=Tt(c,l,a);let h=null,d=null;h=ut(H,H,"debug"),h.style.position="absolute",h.style.top="0",h.style.left="0",d=h.getContext("2d");let x=t("v")??!1;const _=()=>{h.style.display=x?"block":"none"};_();new ft(0,1,0).cross(dt.normalize());const m=new ft(1,1.5,Y),v=[{radius:1,center:(t=>{let e=o(.2,1),r=o(.2,1);const n=1*e/30*Math.PI*(s()?-1:1),i=1*r/15*Math.PI*(s()?-1:1);return new ft(0,0,t).rotateY(n).rotateX(i)})(.001)}],y=new At((()=>{const t=v.length/(D-1),e=st(L,N,(r=t,Math.pow(r,.25)));var r;const n=(t=>{let e=o(),r=o();const n=e*Math.PI*2,i=r*Math.PI*2;return new ft(0,0,t).rotateY(n).rotateX(i)})(st(0,U-e,Math.sqrt(o()))).mul3(m);return{center:n,radius:e}}),((t,e)=>{const r=t.center.x-e.center.x,n=t.center.y-e.center.y;return-1*(r*r+n*n)}),Math.floor(o(6,10)),[]);for(;v.length<D;)v.push(y.sample());const p=[dt.normalize()],w=new Et((()=>new ft(0,0,1).rotateX(o(2*Math.PI)).rotateY(o(2*Math.PI))),((t,e)=>null==e?t.z<.49:t.dot(e)<.8),p),T=Array(X).fill(null).map((()=>({norm:w.sample().rotateX(0),offset:-50})));wt(d,H,H,v,T,i);let g=1;!function t(){g>=mt+1?document.title="FULL_SPECTRUM":(bt(c,f,g,v,T),g++,document.title=`FULL_SPECTRUM (${lt(g/mt*100,1)}%)`,window.requestAnimationFrame(t))}(),window.addEventListener("keydown",(t=>{if("v"==t.key)x=!x,_();else if("d"==t.key){const t=W[0].toString().padStart(2,"0"),r=W[1].toString().padStart(2,"0");ct(u,`FULL_SPECTRUM_${e}_${t}x${r}`)}}))}Rt();
I've been fascinated with the idea of using the Computer to visually enumerate all possible states in a system. Typically, a long-form art collection has 100s of mints, chosen from billions of billions of possible outputs. However, it is totally possible and (in my opinion) fascinating to explore much more constrained systems, ones where we can express and appreciate each item of the enumeration in the context of all possible outputs. This series, "7 Factorial", represents one of the simplest possible enumerations, namely all of the ways to permute (order) a set of items. The permutations are drawn as sorting networks, visualizing each permutation as the displacement of its constituent elements. With 7 items, there are 5040 possible permutations. Yet despite such a simple formulation, the range of outputs is both surprising and beautiful. In celebration of this minimal, structured, yet spontaneously-arising diversity of forms, each of the 19 mints available in “7 Factorial” will be a randomly chosen permutation of 5040. To properly appreciate the full parameter space, and contextualize each of the 19 chosen mints within it, each minter will later be airdropped the full 5040 permutations with the 19 “realized” editions highlighted.
console.log("Lars Wander https://larswander.com CC BY-NC-SA 4.0");let t=()=>{let t=tokenData.hash,e=t=>t<=1?1:t*e(t-1),l=t=>"string"==typeof t,r=document,n=window,o=()=>Array(7),s=e(7),f=parseInt(t.substring(t.length-17,t.length-1),16)%s;console.log(f);let i=t=>t.length,h=Math.min,a=(Math.max,n.innerWidth),w=n.innerHeight,p=h(a,w)/7,g=o(),d=[...g.keys()];for(let t=0;t<7;t++){let l=e(7-t-1),r=Math.floor(f/l),n=d.filter((t=>null!=t))[r];g[t]=d[n],d[n]=null,f%=l}let u=t=>t.toPrecision(4),c=(t,e,l)=>t.setAttribute(e,l),m=t=>r.createElementNS("http://www.w3.org/2000/svg",t),M=(t,e)=>t.appendChild(e),$=(t,e)=>{let r=m("path");return c(r,"d",t.map((t=>l(t)?t:`${u(t[0])},${u(t[1])} `)).join("")),c(r,"fill",e.f||"none"),c(r,"stroke",e.s||"#fff"),c(r,"stroke-width",u(e.sw||1)),r},C=m("svg");c(C,"viewbox",`0 0 ${a} ${w}`),c(C,"width",`${a}px`),c(C,"height",`${w}px`);let L=[];for(let t=0;t<7;t++){if(t===g[t])continue;let e=[],l=t,r=g[l];for(;e.push(r),g[l]=l,r!==t;)l=r,r=g[l];L.push(e)}let b=i(L)+1,k=3/b,x=.95*k,y=.1*k,v=o().fill(!1),A=o(),N=(t,e)=>{A[e]=[{l:t,s:{sw:.3}},{l:t,s:{s:"#000",sw:.198}}]};for(let t=1;t<b;t++){let e=L[t-1],l=i(e),r=e[l-1];for(let n=0;n<l;n++){let o=e[n],s=e[(n+1)%l],f=.37*o,i=.37*s,h=k*t;N(["M",[f,0],"L",[f,h-x],"C",[f,h+y],[i,h-y],[i,h+x],"L",[i,3]],s),r=o,v[o]=!0}}for(let t=0;t<7;t++)v[t]||N(["M",[.37*t,0],"L",[.37*t,3]],t);M(C,$(["M",[0,0],"L",[a,0],[a,w],[0,w]],{f:"#fff"}));let S=a-2*p,W=w-2*p,[j,B]=[S/(6*.37),W/3],D=h(j,B),[E,H]=[.5*(S-6*.37*D)+p,.5*(W-3*D)+p],I=t=>{if(l(t))return t;let[e,r]=t;return[e*D+E,r*D+H]};for(let t of A.flat()){let{l:e,s:l}=t;l.sw=D*l.sw,M(C,$(e.map(I),l))}M(r.body,C)};t();
0x06dc474f…f7ce·#16,528,265·0x54d52d65…d8b662
Light Doesn't Bend That WayAddress: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failed
0x06dc474f…f7ce·#15,797,024·0xc2d2c580…cb9372
Perry, Mary, and LarsAddress: delegate call to non-co`DAddress: delegate call to non-co`DAddress: low-level delegate call failedAddress: low-level delegate call failed
Every edition is accompanied by a physical, watercolor plot. Each plot will be made available to its owner for the cost of shipping. Details and schedule can be found in the project website. This piece is a study of the interaction of simple rules, relying heavily on repetition to highlight how complex and subtle these interactions become.
function calculateFeatures(e){function t(e){let t=function(e,t){null==t&&(t=e,e=0);return function(e,t){const r=10**t;return Math.floor(e*r)/r}(c()*(t-e)+e,5)}(e.map(([e,t])=>e).reduce((e,t)=>e+t));for(let[r,o]of e){if(r>=t)return o;t-=r}}function r(e,t){return null==t&&(t=e,e=0),Math.floor(c()*(t-e))+e}const{tokenId:o,hash:n}=e;console.log(n);let l=parseInt(n.slice(0,16),16),s=parseInt(n.slice(16,32),16),i=parseInt(n.slice(32,48),16),a=parseInt(n.slice(48,64),16);function c(){var e=s<<9,t=5*l;return a^=s,s^=i^=l,l^=a,i^=e,a=a<<11|a>>>21,((t=9*(t<<7|t>>>25))>>>0)/4294967296}const u=t([[1,"A"],[1,"B"],[1,"C"],[1,"D"]]),_=t([[1,"Blush"],[1,"Meadow"],[1,"Gold"],[1,"Contra"]]),d=t([[1,"Sparse"],[1,"Moderate"],[1,"Packed"]]),f=(p=.87,x=c(),x<p);var p;const h={Rule:u,Steps:r(7,22),Fullness:d,Colors:_,Curves:f,Breaks:t([[1,!1],[3,!0]])};return console.log("features =",JSON.stringify(h)),h}console.log("Made by Lars Wander https://larswander.com"),console.log("Licensed under CC BY-NC-SA 4.0");const MAX_CHAOS=6;function randperm(e){const t=[...e],r=[];for(;t.length>0;){const[e]=t.splice(Math.floor(random(t.length)),1);r.push(e)}return r}function randchoice(e){return e[randint(e.length)]}function randint(e,t){return null==t&&(t=e,e=0),Math.floor(random(e,t))}function randfloat(e,t){return null==t&&(t=e,e=0),trunc(random()*(t-e)+e,5)}function randbool(e){return random()<e}const H=Math.sqrt(3)*(2/3),W=1;function hex_safe_coords(e,t){let[r,o]=t;return[(r+e.steps_y)%e.steps_y,(o+e.steps_x)%e.steps_x]}function hex_neighbors(e,t){let[r,o]=t;return o%2==0?[hex_safe_coords(e,[r,o+1]),hex_safe_coords(e,[r+1,o]),hex_safe_coords(e,[r,o-1]),hex_safe_coords(e,[r-1,o-1]),hex_safe_coords(e,[r-1,o]),hex_safe_coords(e,[r-1,o+1])]:[hex_safe_coords(e,[r+1,o+1]),hex_safe_coords(e,[r+1,o]),hex_safe_coords(e,[r+1,o-1]),hex_safe_coords(e,[r,o-1]),hex_safe_coords(e,[r-1,o]),hex_safe_coords(e,[r,o+1])]}function hex_coords_to_point(e,t){let[r,o]=t;return[o*W*e.cell_size,(r*H+.5*H*(o%2==0?0:1))*e.cell_size]}function hex_grid(e,t,r){let o=Math.floor(e/r)-1,n=Math.floor(t/r/H),l=[];for(let e=0;e<n;e++){let e=[];for(let t=0;t<o;t++)e.push(!1);l.push(e)}return{width:e,height:t,cell_size:r,steps_x:o,steps_y:n,grid:l,neighbors:hex_neighbors,dirs:6,coords_to_point:hex_coords_to_point,safe_coords:hex_safe_coords}}function grid_occupied(e,t){let[r,o]=e.safe_coords(e,t);return e.grid[r][o]}function grid_occupy(e,t){let[r,o]=e.safe_coords(e,t);e.grid[r][o]=!0}function grid_bigstep(e,t){let[r,o]=e,[n,l]=t;return Math.abs(r-n)+Math.abs(o-l)>2}function circle_walker_before_step(e,t){}function circle_walker_after_step(e,t){}function circle_walker_update_dir(e,t){t.dir+=1,t.dir%=e.dirs}function circle_walker(e,t){return{coords:e,layer:t,dir:t,before_step:circle_walker_before_step,after_step:circle_walker_after_step,update_dir:circle_walker_update_dir,alive:!0,history:[[e]]}}function onedir_walker_before_step(e,t){t.dir=t.onedir}function onedir_walker_after_step(e,t){}function onedir_walker_update_dir(e,t){t.dir+=1,t.dir%=e.dirs}function onedir_walker(e,t){return{coords:e,layer:t,dir:t,onedir:t,before_step:onedir_walker_before_step,after_step:onedir_walker_after_step,update_dir:onedir_walker_update_dir,alive:!0,history:[[e]]}}function cycle_walker_before_step(e,t){t.dir=Math.floor(t.cycle)}function cycle_walker_after_step(e,t){t.cycle-=.333,t.cycle+=e.dirs,t.cycle%=e.dirs}function cycle_walker_update_dir(e,t){t.dir+=1,t.dir%=e.dirs}function cycle_walker(e,t){return{coords:e,layer:t,dir:t,cycle:t,cycle_amount:randfloat(.05,.3),before_step:cycle_walker_before_step,after_step:cycle_walker_after_step,update_dir:cycle_walker_update_dir,alive:!0,history:[[e]]}}function flip_walker_before_step(e,t){t.dir==t.first_dir?t.rotate*=-1:t.update_dir(e,t)}function flip_walker_after_step(e,t){}function flip_walker_update_dir(e,t){t.dir+=t.rotate,t.dir+=e.dirs,t.dir%=e.dirs}function flip_walker(e,t){return{coords:e,layer:t,dir:t,rotate:1,first_dir:t,before_step:flip_walker_before_step,after_step:flip_walker_after_step,update_dir:flip_walker_update_dir,alive:!0,history:[[e]]}}function push_line(e){e.history.push([])}function push_point(e,t){e.history[e.history.length-1].push(t)}function finalize_walker(e){e.alive=!1,push_point(e,e.coords)}function step_walker(e,t){if(!t.alive)return;let r=t.dir,o=t.coords,n=e.neighbors(e,o);t.before_step(e,t);let l=!1;for(let r=0;r<e.dirs;r++){let r=n[t.dir];if(null!=r&&!grid_occupied(e,r)){l=!0,t.coords=r;break}t.update_dir(e,t)}l?(grid_bigstep(o,t.coords)?(push_point(t,o),push_line(t),push_point(t,t.coords)):r!==t.dir&&push_point(t,o),t.after_step(e,t)):finalize_walker(t)}function safe_cycle(e){return randint(e)}function attempt(e,t,r,o){let n=[];const l=()=>safe_cycle(e.steps_y),s=()=>safe_cycle(e.steps_x);let i=l(),a=s(),c=randint(i),u=randint(a),_=Math.ceil(t/(o?2:1)),d=randperm([1,2,3]);d.push(d[0]+3),d.push(d[1]+3),d.push(d[2]+3);let f=0,p=new Set,h=0;const y=()=>{let e=l();for(;e===i;)e=l();a=i,i=e};for(let o=0;o<t;o++){if(f=d[o%d.length],f%=e.dirs,c+=i,u+=a,_>0&&(o+1)%_==0){c+=l(),u+=s(),y()}c+=e.steps_y,c%=e.steps_y,u+=e.steps_x;let t=[c,u%=e.steps_x],w=`${c},${u}`;if(p.has(w)){if((h+=1)>MAX_CHAOS)return;c+=l(),u+=s(),t=[c%=e.steps_y,u%=e.steps_x],w=`${c},${u}`}p.add(w),n.push(r(t,f))}return console.log("disruptions:",h),n}function regular_walkers(e,t,r,o){let n=attempt(e,t,r,o);for(;null==n;)n=attempt(e,t,r,o);return n}function mul(e,t){let[r,o]=e;return[r*t,o*t]}function rot(e,t){let[r,o]=e,n=Math.sin(t),l=Math.cos(t);return[r*l+o*n,r*-n+o*l]}function add(e,t){let[r,o]=e,[n,l]=t;return[r+n,o+l]}function dist_between(e,t){let[r,o]=e,[n,l]=t;return Math.sqrt((r-n)**2+(o-l)**2)}function line_length(e){let t=0;for(let r=0;r<e.length-1;r++)t+=dist_between(e[r],e[r+1]);return t}function lerp_t(e,t,r){let[o,n]=e,[l,s]=t;return add(mul(e,1-r),mul(t,r))}function lerp_d(e,t,r){let o=dist_between(e,t);return 0===o?e:lerp_t(e,t,r/o)}function qbezier(e,t,r){let o=0,n=[],l=dist_between(e,t),s=l>0?1/l:.1;function i(o){let n=1-o;return add(add(mul(e,n*n),mul(t,2*n*o)),mul(r,o*o))}for(n.push(i(o));o<1;)o=Math.min(1,o+s),n.push(i(o));return n}function to_lines(e,t){let r=[];for(let o of t.history){let t=[];for(let r of o){let o=e.coords_to_point(e,r);t.push(o)}0!==t.length&&r.push(t)}return r}function curve_style(e){return function(t){let r=[];r.push(t[0]);for(let o=0;o<t.length-2;o++){let n=t[o],l=t[o+1],s=t[o+2];n=lerp_d(l,n,Math.min(e,dist_between(n,l)/2)),s=lerp_d(l,s,Math.min(e,dist_between(s,l)/2)),Array.prototype.push.apply(r,qbezier(n,l,s))}return r.push(t[t.length-1]),r}}function apply_style(e,t){let r=[];for(let o of e){let e=[];for(let r of o){let o=[];for(let e of r)o.push(t(e));e.push(o)}r.push(e)}return r}function trunc(e,t){let r=10**t;return Math.floor(e*r)/r}function to_svg(e,t){let r=!0,o=[];for(const n of t){let t=document.createElementNS(e,"polyline"),l="";if(1===n.length||2===n.length&&n[0][0]===n[1][0]&&n[0][1]===n[1][1]){const[e,t]=n[0],r=.3,o=8;for(let n=0;n<o;n++){const s=n/o*Math.PI*2,[i,a]=rot([r,0],s);l+=`${trunc(e+i,4)},${trunc(t+a,4)} `}}else for(let[e,t]of n)l+=`${trunc(e,4)},${trunc(t,4)} `;t.setAttribute("points",l),t.setAttribute("class",r?"refill":"no-refill"),o.push(t),r=!1}return o}function parallel(e,t,r){for(let r of t)grid_occupied(e,r.coords)?(r.alive=!1,r.history.length=0):grid_occupy(e,r.coords);for(let o=0;o<r;o++)for(let r of t)r.alive&&(step_walker(e,r),grid_occupy(e,r.coords));for(let e of t)e.alive&&finalize_walker(e)}function walker_factory(e){switch(e){case"A":return circle_walker;case"B":return onedir_walker;case"C":return cycle_walker;case"D":return flip_walker;default:throw`Illegal type ${e}`}}const BACKGROUND="rgb(255,254,254)",COLORS={Meadow:{lines:[{color:"#059e82",name:"viridian"},{color:"#70b03a",name:"sap-green"},{color:"#ff007f",name:"rose"}]},Blush:{lines:[{color:"#003153",name:"prussian-blue"},{color:"#ff007f",name:"rose"},{color:"#00a9ae",name:"cobalt-turquoise"}]},Contra:{lines:[{color:"#880088",name:"quinacridone-violet"},{color:"#de9726",name:"gold-ochre"},{color:"#00a9ae",name:"cobalt-turquoise"}]},Gold:{lines:[{color:"#ff007f",name:"rose"},{color:"#00a9ae",name:"cobalt-turquoise"},{color:"#de9726",name:"gold-ochre"}]}};function layer_(e,t){return e.lines[t%e.lines.length]}function layer_color(e,t){return layer_(e,t).color}function layer_light(e,t){return t>=e.lines.length}function layer_name(e,t){return`${layer_(e,t).name}${layer_light(e,t)?"-faint":""}`}const FULLNESS={Sparse:.75,Moderate:.95,Packed:1.3};function setup(){noCanvas(),noLoop();let e=1200,t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg"),o=parseInt(tokenData.hash.slice(0,16),16);randomSeed(o),r.setAttribute("width","100vw"),r.setAttribute("height","100vh"),r.setAttribute("viewBox","0 0 900 "+e);let n=document.createElementNS(t,"path");n.setAttribute("d","M 100 100 M 800 1100"),r.appendChild(n);var l=new URL(window.location.href);let s=calculateFeatures(tokenData),{Rule:i,Steps:a,Fullness:c,Colors:u,Curves:_,Breaks:d}=s;const f=COLORS[u];r.setAttribute("style",`background-color:${BACKGROUND};`);let p=hex_grid(700,1e3,7.2),h=p.dirs,y=Math.ceil(p.steps_x*p.steps_y*FULLNESS[c]/a)+1,w=walker_factory(i);var g=l.searchParams.get("count");y=Math.min(y,null!=g?parseInt(g):y),console.log("line count:",y);let k=regular_walkers(p,y,w,d);var m=l.searchParams.get("steps");parallel(p,k,Math.min(null!=m?parseInt(m):a,a));let b=[];for(let e=0;e<h;e++)b.push([]);for(walker of k){const e=to_lines(p,walker);0!==e.length&&b[walker.layer].push(e)}if(_){b=apply_style(b,curve_style(18))}let x=document.createElementNS(t,"g");x.setAttribute("transform","translate(100,100)");for(let e=0;e<h;e++){let r=b[e],o=document.createElementNS(t,"g");const n=e,l=layer_name(f,n),s=layer_color(f,n),i=layer_light(f,n)?.25:.7;o.setAttribute("class",l),o.setAttribute("id",l),o.setAttribute("style",`fill:none;stroke-width:3.2;stroke-linejoin:round;stroke-linecap:round;stroke-opacity:${i};stroke:${s}`);for(let e of r)for(const r of to_svg(t,e))o.appendChild(r);x.appendChild(o)}r.appendChild(x),document.body.appendChild(r)}