let hash=tokenData.hash;const colors0=[["#e1d6b9","#1A1B1B"],["#90C6C8","#F23A0B","#F23A0B","#694f67","#B8A898","#837F8F","#785085","#785085","#090112","#ee9d46","#8DCEAF","#090112",]],colors010=[["#e1d6b9","#1A1B1B"],["#90C6C8","#F23A0B","#F23A0B","#F23A0B","#694f67","#B8A898","#F23A0B","#837F8F","#785085","#785085","#090112","#ee9d46"]],colors1=[["#0E0E0E","#C0B4A5","#9C9996"],["#0E0E0E","#222121","#3D3B3B"]],colors2=[["#DAD2B9","#0d0d0d",],["#A83D3D","#AD0404","#071E5B","#071E5B"]],colors210=[["#DAD2B9","#090909",],["#A83D3D","#ab0101","#002280","#071E5B","#071E5B"]],colors3=[["#DAD2B9","#131212"],["#FFCA0F","#DBB70A","#F29304"]],colors4=[["#391c3c","#131212"],["#FFCA0F","#FFCA0F","#c13a69","#ca2e64","#92be02","#131212","#F29304","#F29304"]],colors5=[["#c7bc9c","#131212"],["#FFCA0F","#FFCA0F","#220e22","#f24b04","#f24b04","#F29304","#1c1407","#2d02af","#2d02af","#131212","#F29304"]],colors6=[["#317E72","#0E0E0E"],["#A83D3D","#920303","#B67C04","#B67C04"]],colors7=[["#c7bc9c","#0c0d01"],["#F3EA8F","#0E0E0E","#85A32D","#91a006","#8CA73B","#b75592","#b10202","#b10202","#615952","#276F14","#0E0E0E"]],colors8=[["#C6BFB1","#1A1B1B"],["#CAC5B2","#E0DAC8","#83b2bf","#ea8150","#cba18e","#ECE7DD"]],colors810=[["#C6BFB1","#1A1B1B"],["#CAC5B2","#E0DAC8","#83b2bf","#d12f03","#ea8150","#cba18e","#ECE7DD"]],colors9=[["#e1d6b9","#530a00"],["#CCB8A1","#ce6f03","#6987b9","#6987b9"]],colors910=[["#e1d6b9","#5c0d03"],["#CCB8A1","#ce6f03","#725b97","#6987b9","#6987b9"]],colors10=[["#EBDEC7","#1A1B1B"],["#F5DDC0","#F1E1D0","#DECCB3","#A14106","#FAC292","#B13718"]],colors11=[["#E7D7BB","#1A1B1B"],["#CEC88E","#feb101","#C97F06","#feb101","#E1CB34","#CEC88E","#0E0E0E","#fedd01","#0E0E0E","#e5392b","#0E0E0E"]],colors12=[["#e1cba5","#1A1B1B"],["#A16997","#1A1B1B","#73D0BB","#3eb79a","#F44811","#F44811","#F44811","#694f67"]],colors13=[["#D3BD84","#1A1B1B"],["#bd0303","#df8423","#910000","#bd0303"]],colors14=[["#D3BD84","#1A1B1B"],["#F3076D","#F5390A","#0BB6B3","#F23A0B","#694f67","#ee9d46","#694f67"]],colors15=[["#859647","#272A23"],["#50750f","#54780d","#859647","#859647","#d1ca04","#3e0355","#5c3f67","#475136","#5D5343"]],colors16=[["#2a008c","#1A1B1B"],["#C69561","#e2c8aa","#8b1c04","#C69561"]],colors17=[["#ba5401","#161515"],["#C69561","#A7A293","#9d0e0e","#C69561"]],colors18=[["#d4a600","#0a0a0a"],["#918c7b","#bfb494","#262783","#C69561"]],colors19=[["#D3BD84","#1A1B1B"],["#fbd202","#ed8312","#bf1d00","#2383bf","#c80909","#ee9d46","#694f67"]],colors1910=[["#D3BD84","#1A1B1B"],["#ed8312","#bf1d00","#2383bf","#c80909","#ee9d46","#694f67"]],colors20=[["#c54e38","#1A1B1B"],["#bf1d00","#fbd202","#490c61","#c01693","#ac1183","#efa91c","#ee9d46","#ee9d46","#694f67"]],colors2010=[["#64589a","#0e0f0f"],["#bf1d00","#fbb402","#5b2372","#ac1183","#efa91c","#ee9d46"]],colors21=[["#bc8000","#111111"],["#945508","#2d7600","#b00707","#760223"]],colors2110=[["#b17f12","#141414"],["#c56c00","#207900","#980101","#b00707","#b00707","#760223"]],colors22=[["#328384","#AEAA9F"],["#17242D","#01040C","#202428","#01040C","#21026a","#021b61","#68645E"]],colors23=[["#859647","#0d0d0d"],["#50750f","#859647","#d1ca04","#512363","#825094","#475136","#5D5343"]],colors2310=[["#859647","#020202"],["#d1ca04","#d1ca04","#512363","#825094"]],colors24=[["#036539","#CDC495"],["#01040C","#202428","#01040C","#8E8E13","#D2D23A","#01040C"]],colors25=[["#A10223","#090909"],["#099CAC","#099CAC"]],colors2510=[["#A10223","#0b0a0a"],["#099CAC","#099CAC","#A10223","#A10223"]],colors26=[["#262626","#0a0a0a"],["#700000","#ba0000","#ba0000","#01a277","#a38b01","#071E5B"]],colors2610=[["#262626","#0a0a0a"],["#ba0000","#ba0000","#007224","#a38b01","#071E5B"]],colors27=[["#262626","#0c0c0c"],["#70005f","#cb3304","#cb3304","#a301a0","#a301a0","#071E5B"]],colors2710=[["#262626","#0a0a0a"],["#cb3304","#cb3304","#a301a0","#a301a0","#071E5B"]],colors28=[["#e1d6b9","#141515"],["#B38367","#bb4d04","#38465b","#38465b"]],colors29=[["#e1d6b9","#0b0b0b"],["#678798","#02677b","#ad4407","#f1b100","#678798","#02677b"]],colors2910=[["#e1d6b9","#0b0b0b"],["#678798","#02677b","#02677b","#ad4407","#f1b100","#678798","#02677b"]],colors30=[["#dbd3bd","#0c041e"],["#678798","#d6ccb1","#c82c05","#dd4ea9","#1fc830","#02677b"]],colors31=[["#262626","#0A0816"],["#0A0816","#648d03","#4780a8","#f19d00","#077F87","#191A1B","#0A3678"]],colors32=[["#262626","#0A0816"],["#0A0816","#a43c4f","#b26c04","#739e22","#b1504b","#87070d","#191A1B","#0A3678"]],colors3210=[["#262626","#0A0816"],["#a31d65","#e28800","#7f8a03","#047898","#930700","#930700","#87070d","#191A1B","#0A3678"]],var0={border:15,warpStrength:.002,warpScale:10.5,contrast:.1,pCount:450,iterations:350,backIterations:40,maxSpeed:5,showParticles:1,thick:5,opac:30,thickDots:{show:1,thick:80,opac:150},darkSpots:{enabled:1,minOpac:0,minThick:1,opacityMapMin:-400,opacityMapMax:700},cFactor:160,lines:{enable:1,showDots:1,minDist:40,maxDist:90,thick:.4,visiblePercent:.25},wind:{enabled:0,value:3},repellers:{enabled:1,minNumber:17,maxNumber:42,minStrength:3e3,maxStrength:7e3,minRadius:950,maxRadius:1050},nSpeed:4,nFactor:[7e3],nDenom:5,nLOD:3,nFalloff:.35,maxOfNoises:0,minOfNoises:0,addedNoise:0,subtractedNoise:0,multipliedNoise:0,rounded:{enabled:1,value:10},sinOfNoise:{enabled:0,value:2},moduloNoise1:{enabled:1,value:330,k:1},moduloNoise2:{enabled:1,value:.6,k:1},lowThreshold:0,lowThreshValue:0,upThreshold:0,upThreshValue:0,palettes:[colors010,colors2,colors3,colors4,colors5,colors6,colors7,colors810,colors9,colors12,colors13,colors14,colors16,colors17,colors18,colors19,colors20,colors21,colors2310,colors2510,colors27,colors28,colors2910,colors30,colors31,colors32]},var1={border:15,warpStrength:.002,warpScale:10.5,contrast:.1,pCount:500,iterations:350,backIterations:40,maxSpeed:6,showParticles:1,thick:5,opac:30,thickDots:{show:1,thick:100,opac:100},darkSpots:{enabled:1,minOpac:10,minThick:1,opacityMapMin:-400,opacityMapMax:700},cFactor:150,lines:{enable:1,showDots:1,minDist:50,maxDist:90,thick:.4,visiblePercent:.27},wind:{enabled:1,value:5},repellers:{enabled:1,minNumber:20,maxNumber:25,minStrength:4e3,maxStrength:6e3,minRadius:950,maxRadius:1050},nSpeed:4,nFactor:[1e4],nDenom:5,nLOD:13,nFalloff:.3,maxOfNoises:0,minOfNoises:0,addedNoise:0,subtractedNoise:0,multipliedNoise:0,rounded:{enabled:1,value:18},sinOfNoise:{enabled:0,value:2},moduloNoise1:{enabled:1,value:330,k:1},moduloNoise2:{enabled:1,value:.6,k:1},lowThreshold:0,lowThreshValue:0,upThreshold:0,upThreshValue:0,palettes:[colors0,colors1,colors210,colors4,colors5,colors6,colors7,colors810,colors9,colors11,colors12,colors14,colors19,colors2110,colors23,colors24,colors26,colors2710,colors29,colors30,colors31,colors3210]},var2={border:15,warpStrength:.003,warpScale:20.5,contrast:.1,pCount:1100,iterations:300,backIterations:100,maxSpeed:5,showParticles:1,thick:2,opac:100,thickDots:{show:1,thick:140,opac:120},darkSpots:{enabled:1,minOpac:12,minThick:1,opacityMapMin:-300,opacityMapMax:500},cFactor:100,lines:{enable:1,showDots:1,minDist:20,maxDist:25,thick:.4,visiblePercent:.45},wind:{enabled:0,value:1},repellers:{enabled:1,minNumber:10,maxNumber:22,minStrength:1e3,maxStrength:3e3,minRadius:50,maxRadius:250},nSpeed:10,nFactor:[3e4],nDenom:3,nLOD:1,nFalloff:.5,maxOfNoises:0,minOfNoises:0,addedNoise:0,subtractedNoise:0,multipliedNoise:0,rounded:{enabled:0,value:.1},sinOfNoise:{enabled:0,value:2},moduloNoise1:{enabled:1,value:330,k:1},moduloNoise2:{enabled:1,value:.6,k:1},lowThreshold:.4,lowThreshValue:.2,upThreshold:.9,upThreshValue:.1,palettes:[colors0,colors210,colors7,colors810,colors910,colors11,colors13,colors14,colors19,colors2010,colors2110,colors23,colors2610,colors2710,colors28,colors29,colors30,colors31,colors3210]},var3={border:15,warpStrength:.003,warpScale:8.5,contrast:.1,pCount:1100,iterations:300,backIterations:100,maxSpeed:5,showParticles:1,thick:2,opac:100,thickDots:{show:1,thick:110,opac:120},darkSpots:{enabled:1,minOpac:10,minThick:1,opacityMapMin:-300,opacityMapMax:600},cFactor:120,lines:{enable:1,showDots:1,minDist:20,maxDist:25,thick:.4,visiblePercent:.45},wind:{enabled:0,value:1},repellers:{enabled:1,minNumber:10,maxNumber:22,minStrength:1e3,maxStrength:3e3,minRadius:50,maxRadius:250},nSpeed:10,nFactor:[3e4],nDenom:3,nLOD:1,nFalloff:.4,maxOfNoises:0,minOfNoises:0,addedNoise:0,subtractedNoise:0,multipliedNoise:0,rounded:{enabled:0,value:1e-4},sinOfNoise:{enabled:0,value:2},moduloNoise1:{enabled:1,value:330,k:1},moduloNoise2:{enabled:1,value:.6,k:1},lowThreshold:.4,lowThreshValue:.2,upThreshold:.9,upThreshValue:.1,palettes:[colors0,colors210,colors5,colors7,colors810,colors910,colors11,colors14,colors19,colors2010,colors2110,colors23,colors2610,colors27,colors28,colors29,colors30,colors31,colors3210]},var4={border:15,warpStrength:.003,warpScale:11.5,contrast:.1,pCount:1100,iterations:300,backIterations:100,maxSpeed:5,showParticles:1,thick:2,opac:100,thickDots:{show:1,thick:100,opac:240},darkSpots:{enabled:1,minOpac:0,minThick:1,opacityMapMin:-400,opacityMapMax:600},cFactor:100,lines:{enable:1,showDots:1,minDist:20,maxDist:25,thick:.4,visiblePercent:.5},wind:{enabled:0,value:2},repellers:{enabled:1,minNumber:10,maxNumber:22,minStrength:1e3,maxStrength:9e3,minRadius:50,maxRadius:250},nSpeed:10,nFactor:[45e3],nDenom:3,nLOD:2,nFalloff:.35,maxOfNoises:0,minOfNoises:0,addedNoise:0,subtractedNoise:0,multipliedNoise:0,rounded:{enabled:0,value:1},sinOfNoise:{enabled:0,value:2},moduloNoise1:{enabled:1,value:330,k:1},moduloNoise2:{enabled:1,value:.6,k:1},lowThreshold:.4,lowThreshValue:.2,upThreshold:.9,upThreshValue:.1,palettes:[colors010,colors1,colors2,colors3,colors4,colors5,colors6,colors7,colors8,colors10,colors12,colors13,colors14,colors15,colors16,colors17,colors18,colors19,colors21,colors22,colors24,colors27,colors28,colors30,colors31,colors32]},var6={border:15,warpStrength:.003,warpScale:11.5,contrast:.1,pCount:1100,iterations:300,backIterations:60,maxSpeed:5,showParticles:1,thick:2,opac:120,thickDots:{show:1,thick:170,opac:240},darkSpots:{enabled:1,minOpac:0,minThick:1,opacityMapMin:-500,opacityMapMax:600},cFactor:150,lines:{enable:1,showDots:1,minDist:20,maxDist:25,thick:.4,visiblePercent:.5},wind:{enabled:0,value:2},repellers:{enabled:1,minNumber:10,maxNumber:22,minStrength:1e3,maxStrength:9e3,minRadius:50,maxRadius:250},nSpeed:10,nFactor:[45e3],nDenom:3,nLOD:2,nFalloff:.35,maxOfNoises:0,minOfNoises:0,addedNoise:0,subtractedNoise:0,multipliedNoise:0,rounded:{enabled:0,value:1},sinOfNoise:{enabled:0,value:2},moduloNoise1:{enabled:1,value:330,k:1},moduloNoise2:{enabled:1,value:.6,k:1},lowThreshold:.4,lowThreshValue:.2,upThreshold:.9,upThreshValue:.1,palettes:[colors010,colors1,colors2,colors3,colors4,colors5,colors6,colors7,colors8,colors10,colors12,colors13,colors14,colors15,colors16,colors17,colors18,colors19,colors21,colors22,colors24,colors27,colors28,colors30,colors31,colors32]};class Particle{constructor(o,e){this.pos=createVector(o,e),this.vel=createVector(),this.acc=createVector(),this.maxSpeed=options.maxSpeed;let $=noise((this.pos.x+0)/options.cFactor,(this.pos.y+1e3)/options.cFactor);noise((this.pos.x+5e3)/options.cFactor,(this.pos.y+4e3)/options.cFactor),noise(this.pos.x+5e3,this.pos.y+4e3),options.darkSpots.enabled?(options.cFactor,this.thick=map($,0,1,options.darkSpots.minThick,options.thick,!0),this.opac=map($,0,1,options.darkSpots.opacityMapMin,options.darkSpots.opacityMapMax),this.opac=floor(constrain(this.opac,options.darkSpots.minOpac,options.thickDots.opac))):(this.thick=options.thick,this.opac=options.thickDots.opac);let s=round(map($,0,1,0,colors[1].length-1));this.color=color(colors[1][s]),this.color=transparentColor(this.color,this.opac)}getRepelled(o){let e=p5.Vector.sub(o.pos,this.pos),$=e.mag();repelG;let s=-o.strength/($*$);if($<o.radius){let t=map(s,100,0,s/4,s);e.setMag(t),this.acc.add(e)}}applyForce(o){this.acc.add(o)}update(){this.vel.add(this.acc),this.vel.limit(this.maxSpeed),this.pos.add(this.vel),this.acc.set(0,0)}edges(){this.pos.x>buff.width-options.border?this.pos.x=options.border:this.pos.x<options.border&&(this.pos.x=buff.width-options.border),this.pos.y>buff.height-options.border?this.pos.y=options.border:this.pos.y<options.border&&(this.pos.y=buff.height-options.border)}show(o=this.thick,e=this.color){buff.noStroke(),buff.fill(e),buff.circle(this.pos.x,this.pos.y,o)}}class Repeller extends Particle{constructor(o,e){super(o,e),this.strength=R.random_num(options.repellers.minStrength,options.repellers.maxStrength),this.radius=R.random_num(options.repellers.minRadius,options.repellers.maxRadius)}repel(o){let e=p5.Vector.sub(this.pos,o.pos),$=e.mag();e.normalize(),e.mult(-this.strength/($*$)),o.applyForce(e)}show(){buff.noFill(),buff.stroke(255,0,0),buff.ellipse(this.pos.x,this.pos.y,2*this.radius)}}console.log(tokenData.hash);class Random{constructor(){this.useA=!1;let o=function(o){let e=parseInt(o.substring(0,8),16),$=parseInt(o.substring(8,16),16),s=parseInt(o.substring(16,24),16),t=parseInt(o.substring(24,32),16);return function(){s|=0;let o=((e|=0)+($|=0)|0)+(t|=0)|0;return t=t+1|0,e=$^$>>>9,$=s+(s<<3)|0,s=(s=s<<21|s>>>11)+o|0,(o>>>0)/4294967296}};this.prngA=new o(tokenData.hash.substring(2,34)),this.prngB=new o(tokenData.hash.substring(34,66));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()}random_num(o,e){return o+(e-o)*this.random_dec()}random_int(o,e){return Math.floor(this.random_num(o,e+1))}random_choice(o){return o[this.random_int(0,o.length-1)]}}const vertexShader=`
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;
}
`,fragmentShader=`
precision mediump float;
varying vec2 vTexCoord;
uniform sampler2D u_tex0;
uniform float u_warpStrength;
uniform float u_warpScale;
uniform float u_contrast;
float rand(vec2 uv) {
return fract(sin(dot(uv.xy ,vec2(532.1231,1378.3453))) * 53211.1223);
}
float valueNoise(vec2 uv) {
vec2 localUv = fract(uv);
vec2 cellID = floor(uv);
localUv = localUv*localUv*(3.0 - 2.0*localUv);
localUv = smoothstep(0.0, 1.0, localUv);
float bottomLeft = rand(cellID);
float bottomRight = rand(cellID+vec2(1.0, 0.0));
float bottom = mix(bottomLeft, bottomRight, localUv.x);
float topLeft = rand(cellID + vec2(0.0, 1.0));
float topRight = rand(cellID + vec2(1.0, 1.0));
float top = mix(topLeft, topRight, localUv.x);
float center = mix(bottom, top, localUv.y);
return center;
}
float fractalValueNoise(vec2 uv) {
float c = valueNoise(uv*4.0);
c += valueNoise(uv*8.2)*.5;
c += valueNoise(uv*16.7)*.25;
c += valueNoise(uv*32.4)*.125;
c += valueNoise(uv*64.5)*.0625;
c /= 2.0;
return c;
}
vec3 adjustContrast(vec3 color, float value) {
return 0.5 + (1.0 + value) * (color - 0.5);
}
void main() {
vec2 uv = vTexCoord;
uv.y = 1.0 - uv.y;
uv.x += fractalValueNoise(uv*u_warpScale)*u_warpStrength;
uv.y += fractalValueNoise(uv*u_warpScale)*u_warpStrength;
vec4 buff = texture2D(u_tex0, uv);
vec3 color = vec3(buff.r, buff.g, buff.b);
color = adjustContrast(color, u_contrast);
color += rand(uv)/8.0;
gl_FragColor = vec4(color, 1.0);
}
`;let R=new Random,seed;const spotWidth=2,spotHeight=2,cols=75,rows=150,spotOpac=15;let buff,theShader,forceSign,shiftSignDX,shiftSignDY,options,colors,nFactor,startTime,iters,pDensity=3,repellers,particles;const variations=[var0,var1,var2,var3,var4,var6,var6];function setup(){seed=R.random_int(0,9999999);let o=window.location.search,e=new URLSearchParams(o);if(e.has("scale")){let $=int(e.get("scale"));2==$&&(pDensity=8),3==$&&(pDensity=12)}render(pDensity)}function render(o){windowWidth<.5625*windowHeight?createCanvas(windowWidth,windowWidth/.5625,WEBGL):createCanvas(.5625*windowHeight,windowHeight,WEBGL),noiseSeed(seed),pixelDensity(o),(buff=createGraphics(576,1024)).pixelDensity(o),buff.strokeCap(SQUARE),repellers=[],iters=0,theShader=createShader(vertexShader,fragmentShader),startTime=Date.now();noiseDetail((options=variations[R.random_int(0,variations.length-1)]).nLOD,options.nFalloff);let e=R.random_int(0,options.palettes.length-1);colors=options.palettes[e],nFactor=R.random_choice(options.nFactor),console.log("nFactor = "+nFactor),buff.background(colors[0][0]),forceSign=.5>R.random_dec()?-1:1,shiftSignDX=.5>R.random_dec()?-1:1,shiftSignDY=.5>R.random_dec()?-1:1,options.repellers.enabled&&setRepellers(),initParticles(),loop()}function initParticles(){particles=[];for(let o=0;o<options.pCount;o++){let e=R.random_num(options.border,buff.width-options.border),$=R.random_num(options.border,buff.height-options.border),s=new Particle(e,$);particles.push(s)}}function drawConnections(o){for(let e=0;e<particles.length;e++){let $=particles[e],s=p5.Vector.dist($.pos,o.pos);if(o!=$&&s<options.lines.maxDist&&s>options.lines.minDist){let t=color(colors[0][1]);t=transparentColor(t,options.opac),buff.stroke(t),buff.strokeWeight(options.lines.thick),buff.line(o.pos.x,o.pos.y,$.pos.x,$.pos.y),options.lines.showDots&&(o.show(o.thick,t),$.show(o.thick,t))}}}function draw(){if(1==iters&&drawSpotGrid(buff,2,2,75,150,15),iters<options.backIterations)for(let o=0;o<particles.length;o++){let e=particles[o],$=noiseProcessing(e.pos.x,e.pos.y),s=map($.nX,0,1,-options.nSpeed,options.nSpeed),t=map($.nY,0,1,-options.nSpeed,options.nSpeed);if(options.wind.enabled){let r=createVector(options.wind.value*forceSign,0);e.applyForce(r)}e.vel.x=s*shiftSignDX,e.vel.y=t*shiftSignDY,e.update(),e.edges(),options.thickDots.show&&e.show(options.thickDots.thick,e.color)}if(iters==options.backIterations&&initParticles(),iters>options.backIterations)for(let i=0;i<particles.length;i++){let l=particles[i],n=noiseProcessing(l.pos.x,l.pos.y),a=map(n.nX,0,1,-options.nSpeed,options.nSpeed),c=map(n.nY,0,1,-options.nSpeed,options.nSpeed);if(options.wind.enabled){let _=createVector(options.wind.value*forceSign,0);l.applyForce(_)}if(l.vel.x=a*shiftSignDX,l.vel.y=c*shiftSignDY,l.update(),l.edges(),options.showParticles){let d=color(colors[0][1]);d=transparentColor(d,options.opac),l.show(l.thick,d)}options.lines.enable&&R.random_dec()<options.lines.visiblePercent&&drawConnections(l)}if(iters>options.iterations+options.backIterations&&(drawSpotGrid(buff,2,2,75,150,15),noLoop(),round((Date.now()-startTime)/10)),repellers.length>0)for(let p of repellers)for(let u of particles)p.repel(u);shader(theShader),theShader.setUniform("u_tex0",buff),theShader.setUniform("u_warpStrength",options.warpStrength),theShader.setUniform("u_warpScale",options.warpScale),theShader.setUniform("u_contrast",options.contrast),rect(-width/2,-height/2,width,height),iters++}function poweredNoise(o,e){return pow(o,e)}function multipliedNoise(o,e){return o*e}function addedNoise(o,e){return o+e}function subtractedNoise(o,e){return o-e}function ridgedNoise(o,e){return o>e&&(o=e-(o-e))<0&&(o=-o),o/e}function moduloNoise(o,e,$){return o*e%$}function sigmoid(o){return 1/(1+exp(-o))}function almostUnitIdentity(o){return o*o*(2-o)}function integralSmoothstep(o,e){return o>e?o-e/2:o*o*o*(1-.5*o/e)/e/e}function expImpulse(o,e){let $=e*o;return $*exp(1-$)}function polyImpulse(o,e,$){return e/(e-1)*pow((e-1)*$,1/e)*o/(1+$*pow(o,e))}function expSustainedImpulse(o,e,$){let s=max(o-e,0);return min(o*o/(e*e),1+2/e*s*exp(-$*s))}function cubicPulse(o,e,$){return(o=abs(o-e))>$?0:1-(o/=$)*o*(3-2*o)}function expStep(o,e,$){return exp(-e*pow(o,$))}function gain(o,e){let $=.5*pow(2*(o<.5?o:1-o),e);return o<.5?$:1-$}function parabola(o,e){return pow(4*o*(1-o),e)}function pcurve(o,e,$){return pow(e+$,e+$)/(pow(e,e)*pow($,$))*pow(o,e)*pow(1-o,$)}function sinc(o,e){let $=PI*(e*o-1);return sin($)/$}function falloff(o,e){return((o=1/((o+1)*(o+1)))-(e=1/((e+1)*(e+1))))/(1-e)}function setRepellers(){repellers=[];let o=R.random_int(options.repellers.minNumber,options.repellers.maxNumber);for(let e=0;e<o;e++){let $=R.random_num(0,buff.width),s=R.random_num(0,buff.height),t=new Repeller($,s);repellers.push(t)}}function transparentColor(o,e){let $=red(o),s=green(o),t=blue(o);return color($,s,t,e)}function noiseProcessing(o,e){let $=noise((o+3e3)/nFactor,(e+4e3)/nFactor),s=noise((e+4e3)/nFactor,(o+3e3)/nFactor),t=noise((o+3e3)/(nFactor/options.nDenom),(e+4e3)/(nFactor/options.nDenom)),r=noise((e+4e3)/(nFactor/options.nDenom),(o+3e3)/(nFactor/options.nDenom));return options.rounded.enabled&&($=round($*options.rounded.value)/options.rounded.value,s=round(s*options.rounded.value)/options.rounded.value,t=round(t*options.rounded.value)/options.rounded.value,r=round(r*options.rounded.value)/options.rounded.value),options.sinOfNoise.enabled&&($=sin($*options.sinOfNoise.value)/2,s=sin(s*options.sinOfNoise.value)/2),options.maxOfNoises&&($=max($,t),s=max(s,r)),options.minOfNoises&&($=min($,t),s=min(s,r)),options.addedNoise&&($=addedNoise($,t),s=addedNoise(s,r)),options.subtractedNoise&&($=subtractedNoise($,t),s=subtractedNoise(s,r)),options.multipliedNoise&&($=multipliedNoise($,t),s=multipliedNoise(s,r)),options.moduloNoise1.enabled&&($=moduloNoise($,options.moduloNoise1.value,options.moduloNoise1.k),s=moduloNoise(s,options.moduloNoise1.value,options.moduloNoise1.k)),options.moduloNoise2.enabled&&($=moduloNoise($,options.moduloNoise2.value,options.moduloNoise2.k),s=moduloNoise(s,options.moduloNoise2.value,options.moduloNoise2.k)),$<options.lowThreshold&&($+=options.lowThreshValue),s<options.lowThreshold&&(s+=options.lowThreshValue),$>options.upThreshold&&($-=options.upThreshValue),s>options.upThreshold&&(s-=options.upThreshValue),{nX:$,nY:s}}function windowResized(){windowWidth<.5625*windowHeight?resizeCanvas(windowWidth,windowWidth/.5625,WEBGL):resizeCanvas(.5625*windowHeight,windowHeight,WEBGL)}function keyPressed(){("s"===key||"S"===key)&&save("Na\xefve.png")}function drawSpotGrid(o,e,$,s,t,r){o.rectMode(CENTER);let i=o.width/s,l=o.height/t;for(let n=0;n<=s+1;n++)for(let a=0;a<=t+1;a++){o.noStroke(),o.fill(10,r);let c=n*i,_=a*l;o.rect(c,_,e,$)}}
↓ show full (21,982 bytes)