0xedc8a720…fea4sent to0xa7d8d9ef…d270·#15,239,811·view on Etherscan
const vs="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;}",fsn="precision highp float;precision highp sampler2D;uniform sampler2D l;uniform vec2 i;uniform float j;float e(vec2 a){return fract(1e+4*sin(17.*a.x+a.y*.1)*(.1+abs(sin(a.y*13.+a.x))));}float m(vec2 d){vec2 a=floor(d),b=fract(d);float f=e(a),h=e(a+vec2(1.,0.)),k=e(a+vec2(0.,1.)),n=e(a+vec2(1.,1.));vec2 c=b*b*(3.-2.*b);return mix(f,h,c.x)+(k-f)*c.y*(1.-c.x)+(n-h)*c.x*c.y;}float g(vec2 b,float c,float a){float d=2./a*m(b)+c-1./a,f=clamp(floor(a*d)/(a-1.),0.,1.);return f;}void main(){vec2 h=gl_FragCoord.xy/i.xy;h.y=1.-h.y;vec2 c=gl_FragCoord.xy/j,k=i.xy/j,d=floor(c)/k;d.y=1.-d.y;vec3 a=pow(texture2D(l,d).rgb,vec3(2.2));vec2 b=floor(c.xy+.5);vec3 f=vec3(g(b,a.r,3.),g(b,a.g,3.),g(b,a.b,3.));f.rgb=pow(f,vec3(.454545)),gl_FragColor=vec4(f,1.);}",fs="precision highp float;precision highp sampler2D;uniform sampler2D G,h;uniform float i,w,x,j,H,I,J,K;uniform vec2 m,L;const vec2 y=vec2(37.,17.),z=vec2(59.,83.);vec4 A(vec2 a){float b=texture2D(h,(a+.5)/m).r,c=texture2D(h,(a+.5+y)/m).r,d=texture2D(h,(a+.5+z)/m).r,e=texture2D(h,(a+.5+y+z)/m).r;return vec4(b,c,d,e);}vec4 M(vec4 a){return 1.792843-.853735*a;}float R(float a){return 1.792843-.853735*a;}vec4 g(float d,vec4 c){const vec4 e=vec4(1.,1.,1.,-1.);vec4 a,b;a.xyz=floor(fract(vec3(d)*c.xyz)*7.)*c.z-1.,a.w=1.5-dot(abs(a.xyz),e.xyz),b=vec4(lessThan(a,vec4(0.))),a.xyz=a.xyz+(b.xyz*2.-1.)*b.www;return a;}float B(vec4 c){const vec4 d=vec4(.138197,.276393,.41459,-.447214);vec4 C=floor(c+dot(c,vec4(.309017))),a=c-C+dot(C,d.xxxx),b;vec3 D=step(a.yzw,a.xxx),p=step(a.zww,a.yyz);b.x=D.x+D.y+D.z,b.yzw=1.-D,b.y+=p.x+p.y,b.zw+=1.-p.xy,b.z+=p.z,b.w+=1.-p.z;vec4 N=clamp(b,0.,1.),O=clamp(b-1.,0.,1.),P=clamp(b-2.,0.,1.),q=a-P+d.xxxx,r=a-O+d.yyyy,s=a-N+d.zzzz,t=a+d.wwww;float Q=A(c.zx).z;vec4 f=A(c.xy),e=vec4(.003401,.020408,.142857,0.),k=g(Q,e),l=g(f.x,e),n=g(f.y,e),o=g(f.z,e),E=g(f.w,e),F=M(vec4(dot(k,k),dot(l,l),dot(n,n),dot(o,o)));k*=F.x,l*=F.y,n*=F.z,o*=F.w,E*=R(dot(E,E));vec3 u=max(.6-vec3(dot(a,a),dot(q,q),dot(r,r)),0.);vec2 v=max(.6-vec2(dot(s,s),dot(t,t)),0.);u=u*u,v=v*v;return 49.*(dot(u*u,vec3(dot(k,a),dot(l,q),dot(n,r)))-dot(v*v,vec2(dot(o,s),dot(E,t))));}void main(){vec2 c=gl_FragCoord.xy/m.xy;c.y=1.-c.y;float k=m.x/m.y;vec2 b=L;b.x*=k;vec2 a=(floor(c*L)+0.5)/L;vec3 d=texture2D(G,a).rgb;float e=B(vec4(H+a.x*w,a.y*K,j*cos(i),j*sin(i))),f=B(vec4(a.x*J,I+a.y*w,j*sin(i),j*cos(i)));vec2 l=vec2(e*x,f*x);d=texture2D(G,(a+l)*0.986).rgb,gl_FragColor=vec4(d,.4);}";let R,can,buffA,buffB,buffC,shA,shB,palette,brush,brushes,grid,bkg,bord,bc,bt,xoff,yoff,w,h,cols,nx,ny,npg,projectNumber=Math.floor(parseInt(tokenData.tokenId)/1e6),mintNumber=parseInt(tokenData.tokenId)%1e6,DW=750,DH=1e3,M=window.innerWidth>=window.innerHeight?window.innerHeight/DH:window.innerWidth/DW,gestures=[],pts=[],t=0,id=0,totalFrames=90,dot=Math.round(1*M*4)/4>0?Math.round(1*M*4)/4:.25,tdot=dot,pause=!1;const colorPalettes={library:["BB6100","ffba08","3f88c5","f5dfbb","F1A644","F7EDE2","F0CB94"],beach:["005C8E","d62828","eae2b7","fcbf49","D5CC9D","E4F9FF","B6E1F0"],airport:["0081a7","00afb9","fdfcdc","fed9b7","f07167","E7FDFF","E1E1E1"],museum:["2b2d42","8d99ae","edf2f4","ef233c","d90429","F3F3F3","D1CCC1"],desert:["FCC223","92140c","FFE5C7","FFCF99","BA6F2E","FFF2E6","FFE3A8"],gallery:["FAC021","B00000","7D67E7","FFE3C3","A0B2D5","F0F0F0","D5D5D5"],lounge:["83289C","7577BD","B6D6CC","F1FEC6","FF553E","F7F5E1","FDD474"],garden:["DE8E43","E8DAB2","4F6D7A","DCDF7A","6AB846","EBF7E1","BBFFB7"],party:["072ac8","1e96fc","a2d6f9","fcf300","ffc600","FFF7FB","FFBED7"]},palettes=Object.keys(colorPalettes);function col(t){return"#"+t[floor(R.random_int(0,4))]}function setup(){window.innerHeight<=window.innerWidth?(w=.75*max(window.innerHeight,1),h=max(window.innerHeight,1)):(w=max(window.innerWidth,1),h=max(window.innerWidth,1)/.75),can=createCanvas(w,h,WEBGL),buffB=createGraphics(w,h,WEBGL),buffA=createGraphics(w,h,WEBGL),buffA.setAttributes({alpha:!0}),buffC=createGraphics(w,h,WEBGL),buffC.setAttributes({alpha:!0}),console.log(dot),pixelDensity(1),buffA.pixelDensity(1),buffB.pixelDensity(1),buffC.pixelDensity(1),setAttributes({alpha:!0}),buffB.setAttributes({alpha:!0}),npg=createGraphics(512,512),npg.pixelDensity(1),frameRate(30),shA=createShader(vs,fsn),shB=buffB.createShader(vs,fs),brush=createGraphics(50,50),brush.pixelDensity(1),R=new Random,cols=palettes[int(9*R.random_dec())],palette=colorPalettes[cols],grid=R.random_choice([1,2,3,4,6,8]),pixl=R.random_choice([64,128,256,256,512,640]),nx=R.random_choice([3,3,6,9,9,12]),ny=R.random_choice([2,4,8,16,16,32]),bord=R.random_dec()>.1,bt=R.random_dec()>.3,brushes=R.random_choice([12,18,18,24,24,24]),xoff=R.random_int(0,9e3),yoff=R.random_int(0,9e3),randomSeed(xoff*yoff),drawNoise(npg),bc="#"+palette[6],bkg="#"+palette[5],buffC.noStroke(),buffC.background(bkg),buffA.noStroke(),buffA.clear(),buffA.background(bkg),initPts(brushes);let t=document.getElementById("defaultCanvas0");t.style.imageRendering="pixelated",t.imageSmoothingEnabled=!1,console.log({Hash:tokenData.hash,Palette:cols,"Warped Subdivisions":grid,"Secondary Resolution":pixl,Margin:bord||1==grid?"yes":"no","Saturated Border?":1==grid||bt||!bord?"no":"yes","Chaos X":nx,"Chaos Y":ny,"No. of Brushes":brushes},"RASTER by Galo Canizares (b. 1989)")}function draw(){t=1*frameCount/totalFrames*TWO_PI,shader(shA),shA.setUniform("i",[w,h]),shA.setUniform("l",buffC),shA.setUniform("j",dot),rect(-width/2,-height/2,width,height),buffB.shader(shB),shB.setUniform("m",[w,h]),shB.setUniform("L",[pixl,DH/abs(10-grid)]),shB.setUniform("G",buffC),shB.setUniform("h",npg),shB.setUniform("i",t),shB.setUniform("K",nx),shB.setUniform("J",ny),shB.setUniform("w",grid),shB.setUniform("x",.2),shB.setUniform("j",.005),shB.setUniform("H",xoff),shB.setUniform("I",yoff),buffB.rect(-width/2,-height/2,width,height),buffC.image(buffB,-width/2,-height/2,width,height),buffC.image(buffA,-width/2,-height/2,width,height),buffC.noFill(),buffC.stroke(1==grid||bt||!bord?bkg:bc),buffC.strokeWeight(bord||1==grid?width/18:0),buffC.rect(-width/2,-height/2,width,height),image(buffC,-width/2,-height/2,width,height);for(let t=0;t<gestures.length;t++)gestures[t].animGesture(),gestures[t].drawGesture(buffA);frameCount%30==0&&gestures.length<pts.length&&addGesture(),frameCount%15==0&&buffA.clear()}function addGesture(){let t=new Gesture(.1,R.random_int(50*M,150*M),col(palette));id<pts.length-1&&(t.initGesture(18,pts[id],pts[id+1]),gestures.push(t),id++)}function drawNoise(t){t.loadPixels();for(let e=0;e<t.width;e++)for(let s=0;s<t.height;s++){const i=4*(t.width*e+s);t.pixels[i]=255*random(),t.pixels[i+3]=255}t.updatePixels()}function drawBrush(t,e,s,i,r){t.pixelDensity(1),t.clear(),t.loadPixels();for(let o=0;o<t.width;o++)for(let n=0;n<t.height;n++){const a=4*(t.width*o+n);let h=dist(n,o,t.width/2,t.height/2),d=map(h,0,t.width/2,0,255);t.pixels[a]=e,t.pixels[a+1]=s,t.pixels[a+2]=i,t.pixels[a+3]=r/255*(255-d)}t.updatePixels()}function shuff(t){let e,s,i=t.length;for(;i;)s=Math.floor(random()*i--),e=t[i],t[i]=t[s],t[s]=e;return t}function initPts(t){for(let t=DH/10*M;t<DH*M;t+=DH/5*M)for(let e=DW/10*M;e<DW*M;e+=DW/5*M){let s=new Point(e-width/2,t-height/2);pts.push(s)}pts=shuff(pts).slice(0,t)}function keyPressed(){switch(key){case"1":dot=1*tdot;break;case"2":dot=4*tdot;break;case"4":dot=16*tdot;break;case"8":dot=32*tdot;break;case"s":save("RASTER-"+tokenData.hash+".png");break;case"p":pause=!pause,pause?noLoop():loop();break;case"r":buffC.background(bkg)}}function mousePressed(){pause=!pause,pause?noLoop():loop()}class Point{constructor(t,e){this.x=t,this.y=e}}class Gesture{constructor(t,e,s){this.pts=[],this.curr=[0,0],this.dist=[0,0],this.temp={beginX:0,beginY:0,endX:0,endY:0},this.col=s,this.radi=e,this.step=t,this.traveled=0,this.next=0}initGesture(t,e,s){let i,r=[e.x,e.y];i=12==brushes?[0,0]:[R.random_int(0,DW*M)-width/2,R.random_int(0,DH*M)-height/2];let o=[s.x,s.y];this.pts=this.drawBezier(r,i,o,t),this.pts.length>0&&(this.temp.beginX=this.pts[0].x,this.temp.beginY=this.pts[0].y,this.temp.endX=this.pts[1].x,this.temp.endY=this.pts[1].y,this.dist[0]=this.temp.endX-this.temp.beginX,this.dist[1]=this.temp.endY-this.temp.beginY,this.curr[0]=this.temp.beginX,this.curr[1]=this.temp.beginY)}animGesture(){this.traveled+=this.step,this.traveled<1?(this.curr[0]=this.temp.beginX+this.traveled*this.dist[0],this.curr[1]=this.temp.beginY+this.traveled*this.dist[1]):this.traveled>1&&(this.nextPt(),this.traveled=0)}drawGesture(t){t.fill(this.col),t.noStroke(),drawBrush(brush,red(this.col),green(this.col),blue(this.col),15),t.blendMode(REPLACE),t.push(),t.texture(brush),t.translate(this.curr[0],this.curr[1]),t.plane(this.radi,this.radi),t.pop()}nextPt(){this.next<this.pts.length-1?this.next+=1:this.next>=this.pts.length-1&&(this.next=0),this.next<this.pts.length-1?(this.temp.beginX=this.pts[this.next].x,this.temp.beginY=this.pts[this.next].y,this.temp.endX=this.pts[this.next+1].x,this.temp.endY=this.pts[this.next+1].y,this.dist[0]=this.temp.endX-this.temp.beginX,this.dist[1]=this.temp.endY-this.temp.beginY):this.next===this.pts.length-1&&(this.temp.beginX=this.pts[this.next].x,this.temp.beginY=this.pts[this.next].y,this.temp.endX=this.pts[0].x,this.temp.endY=this.pts[0].y)}drawBezier(t,e,s,i){let r=[];for(let o=0;o<i;o++){let n=o/Math.max(1,i-1),a=this.qCurve(t,e,s,n);r.push(a)}return r}qCurve(t,e,s,i){let r=t[0],o=t[1],n=e[0],a=e[1],h=s[0],d=s[1],c=1-i,f=c*c,l=i*i,u=[];return u[0]=f*r+2*c*i*n+l*h,u[1]=f*o+2*c*i*a+l*d,u[0]+=R.random_int(-10*M,10*M),u[1]+=R.random_int(-10*M,10*M),createVector(u[0],u[1])}}class Random{constructor(){this.useA=!1;let t=function(t){let e=parseInt(t.substr(0,8),16),s=parseInt(t.substr(8,8),16),i=parseInt(t.substr(16,8),16),r=parseInt(t.substr(24,8),16);return function(){e|=0,s|=0,i|=0,r|=0;let t=(e+s|0)+r|0;return r=r+1|0,e=s^s>>>9,s=i+(i<<3)|0,i=i<<21|i>>>11,i=i+t|0,(t>>>0)/4294967296}};this.prngA=new t(tokenData.hash.substr(2,32)),this.prngB=new t(tokenData.hash.substr(34,32));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num(t,e){return t+(e-t)*this.random_dec()}random_int(t,e){return Math.floor(this.random_num(t,e+1))}random_bool(t){return this.random_dec()<t}random_choice(t){return t[this.random_int(0,t.length-1)]}}