memoscan
← all memos

Memo 0x63886cbd…0eb610 on Ethereum

ottom=-5,s.shadow.mapSize.set(6*i.x,6*i.y),s}function generateCubeMap(){var e=document.createElement("canvas");const t=1024,r=1024;e.width=t,e.height=r;var a=e.getContext("2d");function i(e,t,r){e.addColorStop(0,t),e.addColorStop(1,r),a.fillStyle=e}function s(e){a.fillStyle=e,a.fillRect(0,0,t,r)}function n(e){let s={x:.65,y:.05};var n=a.createRadialGradient(t*s.x,r*s.y,204.8,t*s.x,r*s.y,819.2);i(n,"white","#777065");const o=e?[.15,1]:[0,.75];a.fillRect(t*o[0],153.6,t*o[1],409.6),e&&(s={x:.5,y:.5},i(n=a.createRadialGradient(t*s.x,r*s.y,204.8,t*s.x,r*s.y,614.4),"white","blue"),a.fillRect(153.6,358.4,716.8,204.8)),s={x:.5,y:.1},i(n=a.createRadialGradient(t*s.x,r*s.y,512,t*s.x,r*s.y,921.6),"#3d3c3b","#777065"),a.fillRect(0,614.4,t,921.6)}let o=[];const l=[n,n,s,s,function(e){let s={x:.5,y:.5};var n=a.createRadialGradient(t*s.x,r*s.y,0,t*s.x,r*s.y,512);i(n,"white","#858ba0"),a.fillRect(0,358.4,t,204.8),s={x:.5,y:.1},i(n=a.createRadialGradient(t*s.x,r*s.y,409.6,t*s.x,r*s.y,819.2),"white","#777065"),a.fillRect(0,614.4,t,921.6)},function(e){i(a.createRadialGradient(512,512,204.8,512,512,768),"white","blue"),a.fillRect(0,358.4,t,256)}],u=[!0,!1,"000000","3f3d3c",1,1];for(let i=0;i<6;i++)a.fillStyle="#000000",a.fillRect(0,0,t,r),l[i](u[i]),o.push(e.toDataURL());return o}function getParams(){let e=mintParams.rotation,t=mintParams.sphereSettings[1],r=mintParams.circleSettings[1];return{palette:palettes[mintParams.color],ratioMode:1,cameraZ:10,viewSize:2.5,bgMode:0,background:new THREE.Color(mintParams.background[0],mintParams.background[1],mintParams.background[2]),wrapMode:"mirror",toneMappingExposure:1.75,baseColor:new THREE.Vector4(1,1,1,1),generalScale:mintParams.generalScale,lightPos1:mintParams.lights[0][0],lightIntensity1:mintParams.lights[0][1],lightPos2:mintParams.lights[1][0],lightIntensity2:mintParams.lights[1][1],boxSimplexFreq:1e3,boxBaseScale:.5,boxOpacity:.9,boxEnvIntensity:.3,boxRoughness:.5,boxMetalness:.1,boxRotation:90,boxInstances:mintParams.boxSettings[0],boxScaleRange:mintParams.boxSettings[1],boxPosRange:mintParams.boxSettings[2],boxMeshRot:e,boxVtxDisp:0,boxColoringMode:mintParams.boxSettings[3],sphereOpacity:.8,sphereEnvIntensity:.9,sphereRoughness:.9,sphereMetalness:.3,sphereRotation:0,sphereInstances:mintParams.sphereSettings[0],sphereScaleRange:[t,t,t],spherePosRange:mintParams.sphereSettings[2],sphereMeshPos:[0,0,0],sphereMeshRot:e,sphereVtxDisp:0,sphereColoringMode:[0,0],circleOpacity:.75,circleMeshPosition:[0,0,3],circleEnvIntensity:1,circleRoughness:1,circleMetalness:1,circleBaseScale:.5,circleRotation:0,circleInstances:mintParams.circleSettings[0],circleScaleRange:[r,r,r],circlePosRange:mintParams.circleSettings[2],circleMeshRot:e,circleVtxDisp:0,circleColoringMode:[0,0],lineOpacity:.25,lineRotation:90,lineInstances:mintParams.lineSettings[0],lineScaleRange:[mintParams.lineSettings[1][0],mintParams.lineSettings[1][1],mintParams.lineSettings[1][1]],linePosRange:mintParams.sphereSettings[2],lineMeshRot:e,lineVtxDisp:0,lineColoringMode:[1,0],saoBias:mintParams.saoBias,saoIntensity:.38,saoScale:.5,saoKernelRadius:85,saoMinResolution:5e-4,saoBlurRadius:60,saoBlurStdDev:20,saoBlurDepthCutoff:.0015,bloomThreshold:mintParams.bloom[0],bloomStrength:mintParams.bloom[1],bloomRadius:mintParams.bloom[2],displacementOctaves:3,noiseSeed:100*R.r(),applyCanvas:!0,canvasDetail:2.5,grainAmt:.05}}function customPBRMaterial(e,t){e.uniforms=t;const r="#include <common>\n#define I int\n#define F float\n#define V2 vec2\n#define V3 vec3\n#define V4 vec4\n#define FR fract\n#define M mix\nuniform vec4 uBC; uniform vec3 uSR; uniform vec3 uPR;uniform float uRT;uniform float uVD;uniform float uGS;attribute int aID;attribute vec3 aPos;attribute vec3 aScale;attribute vec3 aAxis;attribute vec3 aColor;varying vec2 vUv;varying vec4 vc;flat varying int vTexID;flat varying int vvi;varying vec3 vrv;varying float vRatio;mat4 rotationMatrix(V3 v, F a){v=normalize(v);F s=sin(a);F c=cos(a);F oc=1.-c;return mat4(oc*v.x*v.x+c, oc*v.x*v.y-v.z*s, oc*v.z*v.x+v.y*s, 0.,oc*v.x*v.y+v.z*s, oc*v.y*v.y+c, oc*v.y*v.z-v.x*s, 0.,oc*v.z*v.x-v.y*s, oc*v.y*v.z+v.x*s,oc*v.z*v.z+c,0.,0.,0.,0.,1.);}F hash11(F p){p = FR(p*.1031);p*=p+ 33.33;p*=p+p;return FR(p);}V3 hash31(F p) {V3 p3 = FR(V3(p)*V3(.1031,.1030,.0973));p3+=dot(p3,p3.yzx+33.33); return FR((p3.xxy+p3.yzz)*p3.zyx);}",a="I id=aID; I vid=gl_VertexID; V3 NS=hash31(F(id)*3.+F(vid))*2.-1.; V3 P=transformed; V3 SC=aScale*uSR; V3 TS=aPos*uPR;V3 NP=P*SC;V4 RT=rotationMat*V4(NP, 1.);NP=RT.xyz;NP+=TS;NP+=NS*uVD;NP*=uGS;transformed=NP;vUv=uv;vc=V4(1.);vvi=vid;vrv=hash31(F(id));";e.onBeforeCompile=e=>{for(const r in t)e.uniforms[r]=t[r];e.vertexShader=e.vertexShader.replace("#include <common>",r),e.vertexShader=e.vertexShader.replace("#include <beginnormal_vertex>"," #include <beginnormal_vertex>\nmat4 rotationMat = rotationMatrix(aAxis, radians(uRT));V4 NN=rotationMat*V4(objectNormal, 1);objectNormal=normalize(NN.xyz);"),e.vertexShader=e.vertexShader.replace("#include <begin_vertex>",`#include <begin_vertex>\n${a} vc = V4(aColor,1.)*uBC;\n `),e.fragmentShader=e.fragmentShader.replace("#include <common>","#include <common>\n#define I int\n#define V2 vec2\n#define V3 vec3\n#define V4 vec4\n#define FR fract\n#define M mix\n#define GRAD 1 \n#define SEMI 3\n#define SGRAD 4\nvarying vec4 vc;varying vec2 vUv;flat varying int vvi;varying vec3 vrv;uniform vec3 uC0;uniform vec3 uC1;uniform vec3 uC2;uniform vec3 uC3;uniform vec3 uC4;uniform vec2 uCM;"),e.fragmentShader=e.fragmentShader.replace("vec4 diffuseColor = vec4( diffuse, opacity );","V2 uv=vUv;V4 diffuseColor=V4(vc.rgb,opacity);V3 cs[5]=V3[5](uC0,uC1,uC2,uC3,uC4);I i=I(vrv.x * 2.99);I j=I(vrv.y*1.99);I m=I(uCM.x);I o=I(uCM.y);V3 fc=diffuseColor.rgb;if(m==GRAD){fc=M(diffuseColor.rgb,cs[(i+o)%5],uv[j]);}else if(m==SEMI){V3 color=vvi<6?cs[(0+o)%5]:vvi<12?cs[(1+o)%5]:vvi<18?cs[(2+o)%5]:cs[(4+o)%5];fc=color;}else if(m==SGRAD){V3 color=vvi<6?M(cs[(0+o)%5],cs[(1+o)%5],(uv.x+uv.y)*.5):vvi<12?M(cs[(2+o)%5],cs[(3+o)%5],uv.x):vvi<18?M(cs[(4+o)%5],cs[(0+o)%5],uv.y):M(cs[(1+o)%5],cs[(2+o)%5],(uv.y+uv.x)*.5);fc=color;}diffuseColor.rgb=fc;")};const i=new THREE.MeshDepthMaterial({depthPacking:THREE.RGBADepthPacking});return i.onBeforeCompile=e=>{for(const r in t)e.uniforms[r]=t[r];e.vertexShader=e.vertexShader.replace("#include <common>",r),e.vertexShader=e.vertexShader.replace("#include <begin_vertex>",`#include <begin_vertex>\nmat4 rotationMat=rotationMatrix(aAxis,radians(uRT));${a}`)},[e,i]}function getNoiseTexture(e,t,r,a){return{shader:new THREE.ShaderMaterial({uniforms:{uTime:u(0),uRes:u(e),uSeed:u(t)},vertexShader:"varying vec2 vUv;void main(){vUv = uv;gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.);}",fragmentShader:`\n #define PI 3.141592\n #define FL float\nvarying vec2 vUv;uniform float uTime;uniform vec2 uRes;uniform float uSeed;${simplexNoise}FL fbm(vec3 x, FL f, FL g, FL amp, FL o){FL t=0.;FL a=1.;for(int i=0;i<${a};i++){t+=psrdnoise(f*x,vec3(0.),1.);f*=2.;a*=g;}return t*amp+o;}void main(){vec2 res=uRes;vec2 uv=vUv;FL aspect=res.x/res.y;uv.x*=aspect;${r}gl_FragColor = vec4(vec3(c),1.);}`}),pixelFormat:{depthBuffer:!1,stencilBuffer:!1,format:THREE.RGBAFormat,type:THREE.FloatType,internalFormat:"RGB8"}}}function displacementShader(e,t){return{uniforms:{tDiffuse:u(null),uRes:u([e.x*t,e.y*t]),sNoise:u(null),uCF:u([p.canvasDetail,p.applyCanvas]),uGF:u(p.grainAmt),uPF:u(postFX?1:0)},vertexShader:"varying vec2 vUv; void main(){gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.);vUv=uv;}",fragmentShader:"#define TAU 6.28318530718\n#define V2 vec2\n#define V3 vec3\n#define V4 vec4\n#define FL float\n\nuniform sampler2D tDiffuse;uniform vec2 uRes;uniform sampler2D sNoise;uniform vec2 uCF;uniform float uGF;uniform float uPF;varying vec2 vUv;FL hash12(V2 p){V3 p3=fract(V3(p.xyx)*.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}V2 uvS(V2 p,V2 r){return p+.6*sin(p*r*TAU)/TAU/r;}V4 sno(V2 p,V2 r){V2 uv=p/r;uv=uvS(uv,r);return texture(sNoise,uv);}V3 gct(V2 xy,FL s,V2 q){V4 r=sno(xy*1.2/sqrt(s),q)-sno(xy*1.2/sqrt(s)+V2(1,-1)*1.5,q);return .95+.05*r.xxx+.05*r.xyz;}void main(){V2 uv=vUv;V2 xy=gl_FragCoord.xy;V4 data=texture2D(tDiffuse,uv);V3 C=data.rgb;FL S=uCF.x;V3 ca=gct(xy,S,uRes);C=mix(C,C*ca,uCF.y*uPF);FL gr=hash12(xy)*uGF;C+=(C*gr*uPF);gl_FragColor=V4(C,1.);}"}}function createNoiseTexture(e,t){return noisePass=getNoiseTexture(e,p.noiseSeed,"FL c=fbm(vec3(uv,uSeed),15.,.7,.2,.3);c+=fbm(vec3(uv,uSeed),193.,.4,.15,.05);",p.displacementOctaves),writeStaticTexture(renderer,{x:e.x,y:e.y},noisePass.pixelFormat,noisePass.shader)}const setArrayIdxs=(e,t,r)=>{e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2]},setAttr=(e,t,r,a)=>{a.setAttribute(e,new THREE.InstancedBufferAttribute(t,r))},af32=e=>new Float32Array(3*e),ai32=e=>new Int32Array(e);function createAttributes(e){return{ids:ai32(e),pos:af32(e),sca:af32(e),axi:af32(e),col:af32(e),rot:ai32(e)}}function updateAttributes(e,t,r,a,i,s){e.ids[a]=s[0],setArrayIdxs(e.sca,i,s[2]),setArrayIdxs(e.pos,i,s[3]),setArrayIdxs(e.axi,i,s[4]),setArrayIdxs(e.col,i,s[5]),t.position.set(0,0,0),t.updateMatrix(),r.setMatrixAt(a,t.matrix)}function setAttributes(e,t){setAttr("aID",e.ids,1,t),setAttr("aPos",e.pos,3,t),setAttr("aScale",e.sca,3,t),setAttr("aAxis",e.axi,3,t),setAttr("aColor",e.col,3,t)}function createInstances(e,t,r,a,i=!1,s=[]){const n=Math.sqrt(e),o=createNoise2D(new Random),l=new THREE.Object3D;let u=createAttributes(e);const h=p.boxSimplexFreq;for(let t=0,r=0,c=e;t<c;t++,r+=3){let e=[parseInt(t%n)/n*h,parseInt(t/n)/n*h];const c=[.5*o(e[0],e[1])+.5,.5*o(e[0]+h,e[1]+h)+.5,.5*o(e[0]+2*h,e[1]+2*h)+.5];let d,m=s.length;if(m<1){d=[o(e[0]+3*h,e[1]+3*h),o(e[0]+4*h,e[1]+4*h),o(e[0]+5*h,e[1]+5*h)]}else d=s[t%m];const f=o(e[0]+6*h,e[1]+6*h);let v=[0,0,0],g=1,x=p.palette[0];f<.25?(v=[0,1,0],x=p.palette[1]):f<.5?(v=[0,0,1],x=p.palette[2]):f<.75?(v=[-1,0,0],x=p.palette[0]):g=0,i&&(x=p.palette[R.ri(0,4)]);updateAttributes(u,l,a,t,r,[t,g,c,d,v,toRGB(x)])}setAttributes(u,r)}function createSphereInstances(e,t,r,a){const i=new THREE.Object3D;let s=createAttributes(e),n=[];for(let t=0,r=0,o=e;t<o;t++,r+=3){const e=R.r(),o=[e,e,e],l=[R.rr(-1,1),R.rr(-1,1),R.rr(-1,1)];n.push(l);const u=R.r();let h=[0,0,0],c=1;u<.25?h=[0,1,0]:u<.5?h=[0,0,1]:u<.75?h=[-1,0,0]:c=0,updateAttributes(s,i,a,t,r,[t,c,o,l,h,toRGB(p.palette[R.rc([0,3,4])])])}return setAttributes(s,r),n}function createCircleInstances(e,t,r,a){const i=createNoise2D(new Random);let s=100;const n=Math.floor(Math.sqrt(e)),o=new THREE.Object3D;let l=createAttributes(e);for(let t=0,r=0,u=e;t<u;t++,r+=3){let e=[parseInt(t%n)/n*s,parseInt(t/n)/n*s];const u=R.r(),h=[u,u,u],c=[i(e[0]+s,e[1]+s),i(e[0]+200,e[1]+200),i(e[0]+300,e[1]+300)],d=R.r();let m=[0,0,0],f=1;d<.25?m=[0,1,0]:d<.5?m=[0,0,1]:d<.75?m=[-1,0,0]:f=0,updateAttributes(l,o,a,t,r,[t,f,h,c,m,toRGB(p.palette[R.ri(0,4)])])}setAttributes(l,r)}function applyCubeMap(e,t,r=!1,a=null){const i=new THREE.PMREMGenerator(renderer),s=(new THREE.CubeTextureLoader).load(e,(()=>{for(let e of t)e.envMap=i.fromCubemap(s).texture;i.dispose(),composer.render(),r&&exportCustom()}))}function prepareMesh(e,t){e.receiveShadow=e.castShadow=e.frustumCulled=!0,e.customDepthMaterial=t,e.needsUpdate=!0,scene.add(e)}function getDim(e,t=null){let r=window.innerHeight,a=window.innerHeight;return null!==t&&(r=a=t),r*=.75,{x:r,y:a,a:.75}}function makeUniforms(e,t,r,a,i){return{uGS:u(p.generalScale),uC0:u(toRGB(p.palette[0])),uC1:u(toRGB(p.palette[1])),uC2:u(toRGB(p.palette[2])),uC3:u(toRGB(p.palette[3])),uC4:u(toRGB(p.palette[4])),uRT:u(e),uSR:u(t),uPR:u(r),uBC:u(p.baseColor),uVD:u(a),uCM:u(i)}}function init(e=null){R=new Random,p=getParams(),dim=getDim(p.ratioMode,e),scene=new THREE.Scene,renderer=new THREE.WebGLRenderer({antialias:!0,preserveDrawingBuffer:1,powerPreference:"high-performance"}),createContainer(renderer),renderer.setSize(dim.x,dim.y),renderer.setClearColor(p.background,1),renderer.physicallyCorrectLights=!0,renderer.toneMapping=THREE.ACESFilmicToneMapping,renderer.toneMappingExposure=p.toneMappingExposure,renderer.outputEncoding=THREE.sRGBEncoding,renderer.shadowMap.enabled=!0,renderer.shadowMap.type=THREE.PCFSoftShadowMap;const t=new THREE.Vector2;renderer.getDrawingBufferSize(t),dim={x:t.width,y:t.height,a:t.width/t.height};renderer.setPixelRatio(2);const r=p.viewSize;camera=new THREE.OrthographicCamera(-r*dim.a,r*dim.a,r,-r,.1,30),camera.position.set(0,0,p.cameraZ);let a=new THREE.MeshStandardMaterial;a.envMapIntensity=p.boxEnvIntensity,a.roughness=p.boxRoughness,a.metalness=p.boxMetalness,a.opacity=p.boxOpacity,a.transparent=!0;let i=new THREE.MeshStandardMaterial;i.envMapIntensity=p.sphereEnvIntensity,i.roughness=p.sphereRoughness,i.metalness=p.sphereMetalness,i.opacity=p.sphereOpacity,i.transparent=!0;let s=new THREE.MeshStandardMaterial;s.envMapIntensity=1,s.roughness=p.circleRoughness,s.metalness=p.circleMetalness,s.opacity=p.circleOpacity,s.transparent=!0;let n,o,l,u=new THREE.MeshStandardMaterial;u.envMapIntensity=p.boxEnvIntensity,u.roughness=p.boxRoughness,u.metalness=p.boxMetalness,u.opacity=p.lineOpacity,u.transparent=!0,materialsList=[a,u,i,s],n=makeUniforms(p.boxRotation,p.boxScaleRange,p.boxPosRange,p.boxVtxDisp,p.boxColoringMode);const h=customPBRMaterial(a,n);o=h[0],l=h[1];let c=p.boxBaseScale,d=new THREE.BoxBufferGeometry(c,c,c),m=new THREE.InstancedMesh(d,o,p.boxInstances);prepareMesh(m,l),createInstances(p.boxInstances,o,d,m),m.rotation.set(toRadians(p.boxMeshRot[0]),toRadians(p.boxMeshRot[1]),toRadians(p.boxMeshRot[2])),n=makeUniforms(p.sphereRotation,p.sphereScaleRange,p.spherePosRange,p.sphereVtxDisp,p.sphereColoringMode);const f=customPBRMaterial(i,n);o=f[0],l=f[1];let v=new THREE.SphereBufferGeometry(1,32,32),g=new THREE.InstancedMesh(v,o,p.sphereInstances);prepareMesh(g,l);let x=createSphereInstances(p.sphereInstances,o,v,g);g.position.set(p.sphereMeshPos[0],p.sphereMeshPos[1],p.sphereMeshPos[2]),g.rotation.set(toRadians(p.sphereMeshRot[0]),toRadians(p.sphereMeshRot[1]),toRadians(p.sphereMeshRot[2])),n=makeUniforms(p.circleRotation,p.circleScaleRange,p.circlePosRange,p.circleVtxDisp,p.circleColoringMode);const E=customPBRMaterial(s,n);o=E[0],l=E[1];let M=new THREE.CircleBufferGeometry(p.circleBaseScale,32),T=new THREE.InstancedMesh(M,o,p.circleInstances);prepareMesh(T,l),createCircleInstances(p.circleInstances,o,M,T),T.position.set(p.circleMeshPosition[0],p.circleMeshPosition[1],p.circleMeshPosition[2]),n=makeUniforms(p.lineRotation,p.lineScaleRange,p.linePosRange,p.lineVtxDisp,p.lineColoringMode);const S=customPBRMaterial(u,n);o=S[0],l=S[1],c=p.boxBaseScale;let C=new THREE.BoxBufferGeometry(c,c,c),y=new THREE.InstancedMesh(C,o,p.lineInstances);y.receiveShadow=y.castShadow=y.frustumCulled=!1,y.customDepthMaterial=l,y.needsUpdate=!0,scene.add(y),createInstances(p.boxInstances,o,C,y,!0,x),y.rotation.set(toRadians(p.boxMeshRot[0]),toRadians(p.boxMeshRot[1]),toRadians(p.boxMeshRot[2]));const b=new THREE.AmbientLight(16777215,.25);scene.add(b);let D=getDirLight(p.lightPos1,16777215,p.lightIntensity1,!0,dim);scene.add(D);let P=getDirLight(p.lightPos2,16777215,p.lightIntensity2,!0,dim);scene.add(P);let w=913;const B=new THREE.WebGLMultisampleRenderTarget(dim.x,dim.y,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat});composer=new EffectComposer(renderer,B),composer.setSize(2*dim.x,2*dim.y);let F=new RenderPass(scene,camera);composer.addPass(F);let A=new SAOPass(scene,camera,!0,!1);A.resolution.set(2*dim.x,2*dim.y),A.params.saoBias=p.saoBias,A.params.saoScale=p.saoScale,A.params.saoKernelRadius=dim.y>w?p.saoKernelRadius*Math.pow(dim.y/w,1.24):p.saoKernelRadius,A.params.saoIntensity=dim.y>w?p.saoIntensity*Math.pow(w/dim.y,.5):p.saoIntensity,A.params.saoMinResolution=p.saoMinResolution,A.params.saoBlurRadius=p.saoBlurRadius,A.params.saoBlurStdDev=p.saoBlurStdDev,A.params.saoBlurDepthCutoff=p.saoBlurDepthCutoff,composer.addPass(A),saoComposer=new EffectComposer(renderer),saoComposer.setSize(2*dim.x,2*dim.y),saoComposer.renderToScreen=!1,saoComposer.addPass(F),saoComposer.addPass(A);let H=new UnrealBloomPass(dim,.1,.5,.75);H.threshold=p.bloomThreshold,H.radius=p.bloomRadius,H.strength=dim.y>w?p.bloomStrength*Math.pow(w/dim.y,.33):p.bloomStrength,composer.addPass(H);let V=createNoiseTexture(dim,2);postfxPass=new ShaderPass(displacementShader(dim,2)),postfxPass.uniforms.sNoise.value=V,composer.addPass(postfxPass),camera.lookAt(m.position),window.addEventListener("resize",onWindowResize),document.addEventListener("keydown",onDocumentKeyDown,!1)}function updateResize(){const e=new THREE.Vector2;renderer.getDrawingBufferSize(e);const t={x:e.width,y:e.height,aspect:e.width/e.height};noisePass.shader.uniforms.uRes.value=[t.x,t.y],postfxPass.uniforms.uRes.value=[t.x,t.y],camera.aspect=t.aspect,camera.updateProjectionMatrix()}function sizeTransform(e=null,t=2){let r=getDim(p.ratioMode,e);renderer.setSize(r.x,r.y),renderer.setPixelRatio(t),updateResize(),composer.render()}function onWindowResize(){sizeTransform()}function onDocumentKeyDown(e){var t=e.which;if(e.shiftKey)switch(t){case 69:sizeTransform(3840,1),exportCustom();break;case 83:sizeTransform(5760,1),exportCustom();break;case 66:postFX=!0,postfxPass.uniforms.uPF.value=postFX,composer.render();break;case 78:postFX=!1,postfxPass.uniforms.uPF.value=postFX,composer.render();break;case 79:composer.render(),exportCustom()}}const saveFile=function(e,t){const r=document.createElement("a");"string"==typeof r.download?(document.body.appendChild(r),r.download=t,r.href=e,r.click(),document.body.removeChild(r)):location.replace(uri)};function exportCustom(){let e;Date.now||(Date.now=function(){return(new Date).getTime()});let t=Math.floor(Date.now()/1e3);try{const r="image/png";e=renderer.domElement.toDataURL(r),saveFile(e.replace(r,"image/octet-stream"),`Laterals#${mintNumber}_${t}.png`)}catch(e){return void console.log(e)}sizeTransform(window.innerHeight)}init(null),applyCubeMap(cubemap,materialsList);