0x35ed1634…9501sent to0xa7d8d9ef…d270·#14,633,958·view on Etherscan
dlmt.x,e.artgrdlmt.y)}},vertexShader:W,fragmentShader:G})},Qe=()=>{let a=b.filter(_=>_.d!==void 0);a=a.length?a[0]:{c:"#ffffff",i:0,d:0};const E=re(a.c),q=te(E.h,E.s,E.l);S=new THREE.ShaderMaterial({defines:{nbshp:M},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},uskptsh:{value:e.skipThreshold},ushp:{value:l},ushpcl:{value:s},udkncl:{value:new THREE.Vector4(q.r/255,q.g/255,q.b/255,a.i)}},vertexShader:W,fragmentShader:Ee}),e.darken=a.d,e.darkenColor=a.dc||"#555555"},et=()=>{k=new THREE.Scene,R=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),Qe(),Ze(),Ke(),Je(),C=new THREE.PlaneBufferGeometry(2,2),P=new THREE.Mesh(C,v),k.add(P)},tt=a=>{S.uniforms.uskptsh.value=e.skipThreshold,a.setRenderTarget(u),P.material=S,a.render(k,R)},rt=a=>{v.uniforms.ugrdlmt.value.x=e.artgrdlmt.x,v.uniforms.ugrdlmt.value.y=e.artgrdlmt.y,v.uniforms.ucntr.value.x=0,v.uniforms.uRenderRot.value=0,v.uniforms.uskptsh.value=e.skipThreshold,v.uniforms.uStep.value=e.step,a.setRenderTarget(c[0]),P.material=v,a.render(k,R),v.uniforms.ugrdlmt.value.x=1,v.uniforms.ugrdlmt.value.y=1,a.setRenderTarget(c[5]),a.render(k,R),v.uniforms.uRenderRot.value=1,a.setRenderTarget(c[4]),a.render(k,R)},lt=a=>{a.setRenderTarget(c[2]),P.material=T,a.render(k,R),a.setRenderTarget(null)},ct=a=>{v.uniforms.uRenderRot.value=0,v.uniforms.ucntr.value.x=1,a.setRenderTarget(c[1]),P.material=v,a.render(k,R)},st=a=>{A.uniforms.ucntr.value=0,P.material=A,a.setRenderTarget(c[3]),a.render(k,R)},nt=a=>{rt(a),lt(a),tt(a),ct(a),st(a),a.setRenderTarget(null)},ot=()=>c[0].texture,at=()=>c[5].texture,it=()=>c[1].texture,ut=()=>u.texture,vt=()=>c[2].texture,ft=()=>c[3].texture,dt=()=>c[4].texture;return $(),Y(),et(),{getContourTexture:it,getColorTexture:ot,getColorTextureNoG:at,getColorSelectionTexture:ut,gtdtColorTexture:vt,getWrapTexture:ft,getRotationTexture:dt,render:nt}};var Vt=`#define PI 3.14159\nuniform sampler2D tInput;uniform vec3 uffst;varying vec2 vUv;vec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}\${noisecommon}\${snoise}vec3 gtpclstk2(vec2 res, float offset) {vec2 pencilstkuv = scale(vUv, res, vec2(1.5, .0));float pclstkPertub = sn3d(vec3(pencilstkuv, offset));vec2 pencilStrokeUv = vUv + vec2(pclstkPertub) * .2;vec3 c = texture2D(tInput, pencilStrokeUv).rgb * 10.;return c;}void main() {vec3 c = gtpclstk2(vec2(.1, 10.), 0.);c += gtpclstk2(vec2(.1, 50.), 0.) * .3;c = clamp(c, 0., 1.);gl_FragColor = vec4(c, 1.);}`;let le=Vt;le=le.replace("${noisecommon}",Se);le=le.replace("${snoise}",we);const $t=c=>{let l=c,s=null,o,n,t,i,u=null;const p=()=>{const C=4096;s=new THREE.WebGLRenderTarget(C,C,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter}),s.texture.wrapS=THREE.MirroredRepeatWrapping,s.texture.wrapT=THREE.MirroredRepeatWrapping},b=()=>{o=new THREE.Scene,n=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),i=new THREE.ShaderMaterial({uniforms:{tInput:{value:l},uffst:{value:new THREE.Vector4(e.curl.pos.x,e.curl.pos.y,e.curl.scl.x,e.curl.scl.y)}},vertexShader:W,fragmentShader:le}),t=new THREE.PlaneBufferGeometry(2,2),u=new THREE.Mesh(t,i),o.add(u)},k=()=>s.texture,R=C=>{C.setRenderTarget(s),C.render(o,n),C.setRenderTarget(null)};return p(),b(),{getColorTexture:k,render:R}};var qt="#define PI 3.14159\nuniform vec2 ures;uniform sampler2D tInput;uniform sampler2D tWrapInput;uniform sampler2D tDirtInput;uniform sampler2D tContourInput;uniform sampler2D tStrokesInput;uniform sampler2D tDarkInput;uniform sampler2D tRotationInput;uniform vec4 ubg;uniform vec4 ucbse;uniform vec4 uartcbse;uniform float uarthsft;uniform float urnd;uniform float uptscl;uniform float uptuvscl;uniform vec2 uptuvtrlt;uniform float uclattscl;uniform vec2 uclddgrtrlt;uniform float ugrnscl;uniform vec2 unblns;uniform vec4 ucrl; uniform vec2 ucrlwrp;uniform float ucrlscl;uniform vec2 ucllff;uniform vec2 upprtp;uniform vec2 uscrch;uniform vec4 uwrsz;uniform float uglrt;uniform vec2 ufllcll;uniform vec4 ufrmprm;uniform vec2 ungt;uniform float udtbld;uniform vec4 uDirts[nbdrts];uniform vec2 udtintfq[nbdrts];uniform float ucllbrdsz;uniform float upclskint;uniform float unseclint;uniform float uogclint;uniform float uhstkint;uniform float ufzzstkint;uniform float udkint;uniform vec3 uswl;uniform vec2 uppruvfsst;uniform float uDebug;uniform float udkn;uniform vec3 udkncl;uniform vec2 usqss;uniform float urt;uniform float urtfq;uniform vec3 ucntr;uniform float uedgwdh;uniform float upidx;uniform float uStep;varying vec2 vUv;\nvec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n${fm}${edge}${noisecommon}${pnoise}${snoise}${grain}${noise}${curl}${adjust}${blend}\nfloat rnduv(vec2 uv){float seed = uv.y * 100000.;float r = abs(tan(sin(uv.y * seed) * seed));return sqrt(1. - r) * 2. - 1.;}vec3 gtgrn() {float grainPertub = noise(vec3(vUv * vec2(4., 80.), 0.));grainPertub /= noise(vec3(vUv * vec2(40., 8.), 0.));vec3 cnoise = vec3(grain(vUv, vec2(2100., 2800.) * ugrnscl + grainPertub*.3));return cnoise;}float gtstns(vec2 offset) {float stains = 1. - vec3(grain(vUv + vec2(offset), vec2(2100., 2800.) * .0025)).r;float stainsEdges = 0.1;float stainsThreshold = .7;stains = smoothstep(stainsThreshold + stainsEdges, stainsThreshold - stainsEdges, stains);stains = clamp(stains, 0., 1.);return stains;}vec3 gtnsycl(float offset) {float scly = 1000.;if (ungt.x == 1.) scly = 100000.;vec2 tinywrapUV = scale(vUv, vec2(50., scly) + vec2(0., urnd * 500.), vec2(0.5));float tinywrap = noise(vec3(tinywrapUV, offset));vec2 tinyuv = vUv * vec2(tinywrap);vec3 nsycl = texture2D(tInput, tinyuv).rgb;return nsycl;}vec3 gtpclstk(float offset) {vec2 pencilstkuv = vUv + vec2(0., urnd);pencilstkuv = scale(pencilstkuv, vec2(5., 1000.), vec2(.5));vec3 curl = crlnse(vec3( (vUv*ucrl.z*1.1)+vec2(ucrl.y, ucrl.x), 0.));pencilstkuv = rotate(pencilstkuv, curl.r * .5);float pclstkPertub = noise(vec3(pencilstkuv, offset));vec2 pencilStrokeUv = vUv + vec2(pclstkPertub) * .2;vec3 c = texture2D(tInput, pencilStrokeUv).rgb * 10.;return c;}vec3 applycbse(vec3 c, vec4 cbse) {c = cntrst(c, cbse.r);c = brhtnss(c, cbse.g);c = strtn(c, cbse.b);c = xpsr(c, cbse.a);return c;}float gtdt(vec2 coords, vec2 levels) {float dirt = fm1(coords);dirt = max(levels.x, min(dirt, levels.y));dirt = map(dirt, levels.x, levels.y, 0., 1.);return dirt;}vec3 rgb2hsv(vec3 rgb){float Cmax = max(rgb.r, max(rgb.g, rgb.b));float Cmin = min(rgb.r, min(rgb.g, rgb.b));float delta = Cmax - Cmin;vec3 hsv = vec3(0., 0., Cmax);if (Cmax > Cmin){hsv.y = delta / Cmax;if (rgb.r == Cmax) {hsv.x = (rgb.g - rgb.b) / delta;}else{if (rgb.g == Cmax) {hsv.x = 2. + (rgb.b - rgb.r) / delta;}else {hsv.x = 4. + (rgb.r - rgb.g) / delta;}}hsv.x = fract(hsv.x / 6.);}return hsv;}float chrky(vec3 color, vec3 bgcolor, vec3 weightsOffset){vec3 backgroundColor = bgcolor;vec3 weights = vec3(4., 1., 2.) + weightsOffset;vec3 hsv = rgb2hsv(color);vec3 target = rgb2hsv(backgroundColor);float dist = length(weights * (target - hsv));return 1. - clamp(3. * dist - 1.5, 0., 1.);}\nvoid main() {float ratio = ures.x/ures.y;vec3 c = texture2D(tInput, vUv).rgb;vec3 oc = c;vec3 dirtc = texture2D(tDirtInput, vUv).rgb;vec3 cnoise = gtgrn();float stains = gtstns(c.rg);vec3 bgColor = ubg.rgb * ubg.a;float pertub = noise(vec3((vUv*uptuvscl * .3)+uptuvtrlt, 0.)) ;pertub += sn3d(vec3( (vUv* 6.7)+uptuvtrlt, 0.) ) * 0.01;float simplex = sn3d( vec3( (vUv*uptuvscl * 10.7)+uptuvtrlt, 0. ) );float simplex2 = sn3d( vec3( (vUv*uptuvscl * 1.7)+uptuvtrlt, 0. ) );vec3 curl = crlnse(vec3( (vUv*vec2(1., 1./ratio)*ucrl.z*ucrlscl)+vec2(ucrl.x, ucrl.y), 0.));vec3 dirtc2 = texture2D(tDirtInput, vUv + vec2(simplex*.005)).rgb;dirtc2 *= fm1(vUv*20.+uptuvtrlt);float m = mod(vUv.y * 3., .025);m = step(m, .01);if (u