0xe4f517a4…f7b9sent to0x99a9b7c1…b069·#16,562,350·view on Etherscan
Vector2(this._width,this._height)},ugenhash:{type:"f",value:x()*15e6+10},uCountLines:{type:"f",value:1e5},uLineWidth:{type:"f",value:10},uLineWidthRandomAdd:{type:"f",value:5},uLineWidthRandomPower:{type:"f",value:8},uSegmentLengthMin:{type:"f",value:0},uSegmentLengthMax:{type:"f",value:0},uSegmentLengthPower:{type:"f",value:4},uRotationType:{type:"f",value:1},uRotationNoise:{type:"v2",value:new THREE.Vector2(0,0)},uRotationDir:{type:"f",value:0},uColor:{type:"v3",value:new THREE.Vector3(.5,.5,.5)},uAlpha:{type:"f",value:1},uHueRand:{type:"v2",value:new THREE.Vector2(0,0)},uSaturationRand:{type:"v2",value:new THREE.Vector2(0,0)},uLuminosityRand:{type:"v2",value:new THREE.Vector2(0,0)},uColorAdjustementValue:{type:"f",value:1},uColorAdjustementScale:{type:"f",value:1},uDontUsePattern:{type:"f",value:0},uVisibleThreshold:{type:"f",value:.01},uModSatPercentBased:{type:"f",value:.2},uModLumPercentBased:{type:"f",value:.125},uAnimTime:{type:"f",value:0},uNormalStr:{type:"f",value:10},uLightPos:{type:"v2",value:new THREE.Vector2(-.3,.8)},uLightStr:{type:"f",value:.1},uIsShadow:{type:"f",value:0},uCountLinesStep:{type:"f",value:0},uCountToAdd:{type:"f",value:0}}})}_generateRands(){let s=this._linesHolder.lines;for(let t of s)t.x=x(),t.y=x()}prepare(s,t,e=1,a=!1,l=0,i=1e6,m=0){let c=this._material.uniforms,h=o.layersData.layersData[s],d=Ks(a?h.colorShadow:h.color);c.tPattern.value=t,c.uColor.value.x=d.h/360,c.uColor.value.y=d.s/100,c.uColor.value.z=d.l/100,c.uCountLines.value=h.countLines*e,c.uLineWidth.value=h.lineWidth,c.uLineWidthRandomAdd.value=h.lineWidthRandomAdd,c.uLineWidthRandomPower.value=h.lineWidthRandomPower,c.uSegmentLengthMin.value=h.segmentLengthMin,c.uSegmentLengthMax.value=h.segmentLengthMax,c.uSegmentLengthPower.value=h.segmentLengthPower,c.uRotationType.value=a?h.shadowRotation:h.rotationType,c.uAlpha.value=a?h.alphaShadow:h.alpha,c.uHueRand.value.x=h.hueMin,c.uHueRand.value.y=h.hueMax,c.uSaturationRand.value.x=h.saturationMin,c.uSaturationRand.value.y=h.saturationMax,c.uLuminosityRand.value.x=h.luminosityMin,c.uLuminosityRand.value.y=h.luminosityMax,c.uColorAdjustementValue.value=h.colorAdjustmentValue,c.uColorAdjustementScale.value=h.colorAdjustmentScale,c.uModSatPercentBased.value=h.modSatPercentBased,c.uModLumPercentBased.value=h.modLumPercentBased,c.uAnimTime.value=0,c.uIsShadow.value=a?1:0,c.uCountLinesStep.value=l,c.uCountToAdd.value=i,c.uRotationDir.value=h.rotationValue,c.uDontUsePattern.value=h.dontUsePattern,c.uVisibleThreshold.value=h.visibleThreshold}get mesh(){return this._linesHolder}};var Di=Math.PI/2,Ti=Math.PI*2;function st(r){return-.5*(Math.cos(Math.PI*r)-1)}function tt(r){return r*r}function et(r){let s=r-1;return s*s*s+1}var rt="precision highp float;uniform sampler2D uArtworkTexture;uniform sampler2D uPatternTexture;uniform vec2 uArtworkSize;uniform float uNormalStr;uniform vec2 uLightPos;uniform float uLightStr;varying vec2 vUv;vec2 stdNormalMap(float height){return-vec2(dFdx(height),dFdy(height));}vec3 blendMultiply(vec3 base,vec3 blend){return base*blend;}void main(){vec4 artwork=texture2D(uArtworkTexture,vUv);vec4 pattern=texture2D(uPatternTexture,vUv);float sharpenSize=0.2;vec2 areaSize=sharpenSize/uArtworkSize;vec4 c1=texture2D(uArtworkTexture,mod(vUv-areaSize,1.));vec4 c2=texture2D(uArtworkTexture,mod(vec2(vUv.x,vUv.y-areaSize.y),1.));vec4 c3=texture2D(uArtworkTexture,mod(vec2(vUv.x+areaSize.x,vUv.y-areaSize.y),1.));vec4 c4=texture2D(uArtworkTexture,mod(vec2(vUv.x-areaSize.x,vUv.y),1.));vec4 c5=texture2D(uArtworkTexture,mod(vec2(vUv.x+areaSize.x,vUv.y),1.));vec4 c6=texture2D(uArtworkTexture,mod(vec2(vUv.x-areaSize.x,vUv.y+areaSize.y),1.));vec4 c7=texture2D(uArtworkTexture,mod(vec2(vUv.x,vUv.y+areaSize.y),1.));vec4 c8=texture2D(uArtworkTexture,mod(vUv+areaSize,1.));vec4 blur=(c1+c3+c6+c8+2.*(c2+c4+c5+c7)+4.*artwork)/16.;vec4 artwork2=(1.+sharpenSize)*artwork-sharpenSize*blur;float height=(artwork2.r+artwork2.g+artwork2.b)/3.;vec2 normal=stdNormalMap(height);normal*=uNormalStr;normal+=.5;float lighting=dot(normal,normalize(uLightPos));artwork.rgb+=lighting*uLightStr*.82*.5;height=(pattern.r+pattern.g+pattern.b)/3.;normal=stdNormalMap(height);normal*=uNormalStr;normal+=.5;lighting=dot(normal,normalize(-uLightPos));artwork.rgb+=lighting*uLightStr*.25;gl_FragColor=artwork;}";var m0=class{constructor(s,t,e,a){this._renderer=s,this._displacementTexture=t,this._width=e,this._height=a,this._patternsCreator=new i0(this._width,this._height,this._renderer,this._displacementTexture),this._artworkLayer=new h0(this._width,this._height,this._displacementTexture),this._idxLayer=0,this._createEngine()}_createEngine(){this._scene=new THREE.Scene,this._camera=new THREE.PerspectiveCamera(45,this._width/this._height,1e-4,1e4),this._camera.updateProjectionMatrix();let s={wrapS:THREE.ClampToEdgeWrapping,wrapT:THREE.ClampToEdgeWrapping,minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBFormat};this._renderTarget=new THREE.WebGLRenderTarget(this._width,this._height,s),this._renderTarget.texture.generateMipmaps=!1,this._renderTarget2=new THREE.WebGLRenderTarget(this._width,this._height,s),this._renderTarget2.texture.generateMipmaps=!1,this._materialEdges=new THREE.ShaderMaterial({vertexShader:D,fragmentShader:rt,uniforms:{uArtworkSize:{type:"v2",value:new THREE.Vector2(this._width,this._height)},uArtworkTexture:{type:"t",value:null},uPatternTexture:{type:"t",value:null},uNormalStr:{type:"f",value:10},uLightPos:{type:"v2",value:new THREE.Vector2(-.3,.8)},uLightStr:{type:"f",value:.1}},side:THREE.DoubleSide,transparent:!0}),this._geometry=new THREE.PlaneBufferGeometry(2,2),this._meshEdges=new THREE.Mesh(this._geometry,this._materialEdges)}reset(){this._currentIdxLayer=0,this._currentCountLines=0,this._patternsCreator.reset(),this._renderer.setRenderTarget(this._renderTarget),this._renderer.setClearColor(o.globalData.backgroundColorGL,1),this._renderer.clear(!0,!0,!0)}draw(){this._renderer.setRenderTarget(this._renderTarget),this._renderer.setClearColor(o.globalData.backgroundColorGL,1),this._renderer.clear(!0,!0,!0);let s=o.postprocessData;this._materialEdges.uniforms.uLightPos.value.x=s.lightPosX,this._materialEdges.uniforms.uLightPos.value.y=s.lightPosY,this._materialEdges.uniforms.uLightStr.value=s.lightStr;for(let t=0;t<o.layersData.count;t++){let e=o.layersData.layersData[t];!e.isActivated||(this._patternsCreator.generate(t,1),this._renderer.setRenderTarget(this._renderTarget),t!==0&&e.alphaShadow>0&&(this._artworkLayer.prepare(t,this._patternsCreator.textureShadow,1,!0),this._renderer.render(this._artworkLayer.mesh,this._camera)),this._artworkLayer.prepare(t,this._patternsCreator.texture,1),this._renderer.render(this._artworkLayer.mesh,this._camera),this._renderer.setRenderTarget(this._renderTarget2),this._materialEdges.uniforms.uArtworkTexture.value=this._renderTarget.texture,this._materialEdges.uniforms.uPatternTexture.value=this._patternsCreator.texture,this._renderer.render(this._meshEdges,this._camera))}this._outTexture=this._renderTarget2.texture,this._renderer.setRenderTarget(null)}drawAnimated(){let s=o.postprocessData;this._materialEdges.uniforms.uLightPos.value.x=s.lightPosX,this._materialEdges.uniforms.uLightPos.value.y=s.lightPosY,this._materialEdges.uniforms.uLightStr.value=s.lightStr;let t=o.layersData.layersData[this._currentIdxLayer];if(!t.isActivated||this._currentCountLines>=t.countLines)return this._currentIdxLayer+=1,!0;let e=et(this._currentCountLines/t.countLines),a=this._artworkLayer.countLines*.4+this._artworkLayer.countLines*e*.6>>0;return this._patternsCreator.generate(this._currentIdxLayer,1),this._renderer.setRenderTarget(this._renderTarget),this._currentIdxLayer!==0&&this._hasShadow&&(this._artworkLayer.prepare(this._currentIdxLayer,this._patternsCreator.textureShadow,1,!0,this._currentCountLines,a),this._renderer.render(this._artworkLayer.mesh,this._camera)),this._artworkLayer.prepare(this._currentIdxLayer,this._patternsCreator.texture,1,!1,this._currentCountLines,a),this._renderer.render(this._artworkLayer.mesh,this._camera),this._outTexture=this._renderTarget.texture,this._currentCountLines+=a,this._currentCountLines>=t.countLines&&(this._currentIdxLayer+=1,this._currentCountLines=0,this._renderer.setRenderTarget(this._renderTarget2),this._materialEdges.uniforms.uArtworkTexture.value=this._renderTarget.texture,this._materialEdges.uniforms.uPatternTexture.value=this._patternsCreator.texture,this._renderer.render(this._meshEdges,this._camera),this._outTexture=this._renderTarget2.texture,t=o.layersData.layersData[this._currentIdxLayer],t&&(this._hasShadow=t.alphaShadow>0)),!0}get isFullyDrawn(){return this._currentIdxLayer>=o.layersData.count}get textureArtwork(){return this._outTexture}get patternTexture(){return this._patternsCreator.texture}get percent(){let s=o.layersData.layersData[this._currentIdxLayer];if(!s)return 1;let t=this._currentIdxLayer/(o.layersData.count-1),e=1/(o.layersData.count-1),a=this._currentCountLines/s.countLines*e;return isNaN(a)&&(a=0),t+a}};var at=`precision highp float;uniform float uAnimTime;
#import color/contrast
#import noise/perlin
vec3 getPerlinTurbulence(vec2 position,float scale,float strength,float time){vec3 perlin=pnoiseVec3(vec3(position.xy+vec2(uAnimTime*1.56,uAnimTime*0.35),time)*scale);perlin*=strength;return perlin;}uniform float uScale;uniform float uStrength;uniform float uTime;uniform float uSaturation;uniform float uContrast;uniform float uIsAbs;uniform float uIsBlackAndWhite;uniform vec2 uRatio;varying vec2 vUv;void main(){vec2 uvScaled=(vUv-.5)*uRatio;vec3 color1=getPerlinTurbulence(uvScaled,uScale,uStrength,uTime);vec3 colorReasonable=color1;vec3 color=colorReasonable;color=color*(1.-uIsAbs)+abs(color)*uIsAbs;color=color*(1.-uIsBlackAndWhite)+vec3((color.r+color.g+color.b)/3.)*uIsBlackAndWhite;vec4 result=vec4(color,1.);result=contrastMatrix(uContrast)*result;const vec3 W=vec3(0.2125,0.7154,0.0721);vec3 intensity=vec3(dot(result.rgb,W));result.rgb=mix(intensity,result.rgb,uSaturation);gl_FragColor=result;}`;var be=T(at),p0=class{constructor(s,t,e){this._renderer=s,this._width=t,this._height=e,this._createEngine()}_createEngine(){this._createUniforms(),this._material=new THREE.ShaderMaterial({fragmentShader:be,vertexShader:D,uniforms:this._uniforms,side:THREE.DoubleSide}),this._geometry=new THREE.PlaneBufferGeometry(2,2),this._mesh=new THREE.Mesh(this._geometry,this._material),this._camera=new THREE.PerspectiveCamera(45,this._width/this._height,1e-4,1e4),this._camera.updateProj