memoscan
← all memos

Memo 0xb80979d3…b0c5fb on Ethereum

(()=>{"use strict";const A=THREE;class B{constructor(A){this.hash=A,this.init()}init(){this.useA=!1;let A=function(A){let B=parseInt(A.substring(0,8),16),I=parseInt(A.substring(8,16),16),Q=parseInt(A.substring(16,24),16),Y=parseInt(A.substring(24,32),16);return function(){B|=0,I|=0,Q|=0,Y|=0;let A=(B+I|0)+Y|0;return Y=Y+1|0,B=I^I>>>9,I=Q+(Q<<3)|0,Q=Q<<21|Q>>>11,Q=Q+A|0,(A>>>0)/4294967296}};this.prngA=new A(this.hash.substring(2,34)),this.prngB=new A(this.hash.substring(34,66));for(let A=0;A<1e6;A+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}rand_rarity(A){const B=this.random_dec();let I=0,Q=0;for(let Y=0;Y<A.length;Y++)if(Q+=A[Y],B<Q){I=Y;break}return I}rand(A,B){return A+(B-A)*this.random_dec()}random_int(A,B){return Math.floor(this.random_num(A,B+1))}random_bool(A){return this.random_dec()<A}random_choice(A){return A[this.random_int(0,A.length-1)]}}const I="varying vec2 vUv;\r\nvoid main()\r\n{\r\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n vUv = uv;\r\n}";class Q{constructor(B,Q,Y){this.numGroups=B,this.numParticles=Q,this.detail=Y,this.detail1=Y+1,this.group=new A.Group,this.vertices=new Float32Array(this.detail1*this.detail1*3);for(let A=0;A<this.detail1;A++){const B=A/this.detail*4-2;for(let I=0;I<this.detail1;I++){const Q=I/this.detail*4-2;this.vertices[3*(A*this.detail1+I)+0]=2*B/(B*B+Q*Q+1),this.vertices[3*(A*this.detail1+I)+1]=2*Q/(B*B+Q*Q+1),this.vertices[3*(A*this.detail1+I)+2]=-(B*B+Q*Q-1)/(B*B+Q*Q+1)}}const F=[];for(let A=0;A<this.detail;A++)for(let B=0;B<this.detail;B++)F.push(A+this.detail1*B,A+this.detail1*(B+1),A+1+this.detail1*B),F.push(A+this.detail1*(B+1),A+1+this.detail1*(B+1),A+1+this.detail1*B);this.geometries=new Array(this.numGroups),this.positionAttributes=new Array(this.numGroups);for(let B=0;B<this.numGroups;B++)this.geometries[B]=new A.BufferGeometry,this.geometries[B].setIndex(F),this.positionAttributes[B]=this.vertices.slice(),this.geometries[B].setAttribute("position",new A.BufferAttribute(this.positionAttributes[B],3)),this.geometries[B].computeVertexNormals();this.material=new A.ShaderMaterial({vertexShader:"varying float diffuse;\r\n\r\nvoid main() {\r\n #include <beginnormal_vertex>\r\n #include <defaultnormal_vertex>\r\n\r\n transformedNormal = normalize(transformedNormal);\r\n vec3 dir = vec3(0.0, 0.0, 1.0);\r\n dir = mat3(instanceMatrix) * vec3(-0.3, 0.0, 1.0);\r\n diffuse = dot(normalize(dir), transformedNormal);\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n}",fragmentShader:"varying float diffuse;\r\n\r\nvoid main() {\r\n vec3 color = mix(vec3(0.12), vec3(1.0), smoothstep(0.7, 0.701, diffuse));\r\n gl_FragColor = vec4(color, 1.0);\r\n}"}),this.meshes=new Array(B);for(let I=0;I<B;I++)this.meshes[I]=new A.InstancedMesh(this.geometries[I],this.material,this.numParticles),this.meshes[I].instanceMatrix.setUsage(A.DynamicDrawUsage),this.group.add(this.meshes[I]);this.positions=new Array(B),this.thetas=new Array(B),this.scales=new Array(B),this.speeds=new Array(B);for(let A=0;A<B;A++)this.positions[A]=new Float32Array(3*Q),this.thetas[A]=new Float32Array(Q),this.scales[A]=new Float32Array(Q),this.speeds[A]=new Float32Array(Q);this.scene=new A.Scene,this.camera=new A.Camera,this.renderTarget=new A.WebGLRenderTarget(this.detail1,this.detail1,{type:A.FloatType});const M=new A.ShaderMaterial({vertexShader:I,fragmentShader:"varying vec2 vUv;\r\n\r\nuniform float scale;\r\nuniform float seed;\r\n\r\n#define PI 3.14159265359\r\n\r\nvec2 rand22(vec2 p) {\r\n return fract(sin(vec2(dot(p, vec2(19.212, 29.214)), dot(p, vec2(91.421, 18.314)))) * seed);\r\n}\r\n\r\nvoid main() {\r\n vec2 p = vUv * scale;\r\n vec2 ib = floor(p);\r\n vec2 fb = p - ib;\r\n \r\n float mi = 1.0;\r\n for (float i = -1.0; i <= 1.0; i++) {\r\n for (float j = -1.0; j <= 1.0; j++) {\r\n vec2 q = rand22(fract((ib + vec2(i, j)) / scale) * scale);\r\n q = vec2(i, j) + 0.5 + 0.3 * sin(q * PI * 2.0);\r\n mi = min(mi, length(fb - q));\r\n }\r\n }\r\n float disp = smoothstep(0.0, 2.5, mi);\r\n\r\n gl_FragColor = vec4(disp, 0.0, 0.0, 1.0);\r\n}",uniforms:{scale:{value:8},seed:{value:123}}});this.renderMesh=new A.Mesh(new A.PlaneGeometry(2,2),M),this.scene.add(this.renderMesh)}setDisplacenment(A,B,I){this.positionAttributes[I].set(this.vertices.slice()),this.geometries[I].attributes.position.needsUpdate=!0,this.geometries[I].computeVertexNormals(),A.setRenderTarget(this.renderTarget);for(let Q=0;Q<2;Q++){this.renderMesh.material.uniforms.seed.value=B.rand(100,1e3),this.renderMesh.material.uniforms.scale.value=3+3*Q,A.render(this.scene,this.camera);const Y=new Float32Array(4*this.detail1*this.detail1);A.readRenderTargetPixels(this.renderTarget,0,0,this.detail1,this.detail1,Y);const F=this.geometries[I].getAttribute("normal").array.slice();for(let A=0;A<this.detail1;A++)for(let B=0;B<this.detail1;B++)this.positionAttributes[I][3*(A*this.detail1+B)+0]-=(1.6-.8*Q)*Y[4*(A*this.detail1+B)]*F[3*(A*this.detail1+B)+0],this.positionAttributes[I][3*(A*this.detail1+B)+1]-=(1.6-.8*Q)*Y[4*(A*this.detail1+B)]*F[3*(A*this.detail1+B)+1],this.positionAttributes[I][3*(A*this.detail1+B)+2]-=(1.6-.8*Q)*Y[4*(A*this.detail1+B)]*F[3*(A*this.detail1+B)+2];this.geometries[I].attributes.position.needsUpdate=!0,this.geometries[I].computeVertexNormals()}A.setRenderTarget(null)}set(A){for(let B=0;B<this.numGroups;B++)for(let I=0;I<this.numParticles;I++){const Q=A.rand(1.2,1.6),Y=A.rand(0,2*Math.PI),F=A.rand(0,.5*Math.PI);this.positions[B][3*I+0]=Q*Math.cos(Y)*Math.cos(F),this.positions[B][3*I+1]=Q*Math.sin(Y)*Math.cos(F),this.positions[B][3*I+2]=Q*Math.sin(F)*.6,this.scales[B][I]=A.rand(1,1.6),this.thetas[B][I]=A.rand(-Math.PI,Math.PI),this.speeds[B][I]=A.rand(.1,3)}}update(A,B,I){for(let Q=0;Q<this.numParticles;Q++){const Y=.5+.5*Math.pow(B,this.speeds[I][Q]);A.position.x=Y*this.positions[I][3*Q+0],A.position.y=Y*this.positions[I][3*Q+1],A.position.z=Y*this.positions[I][3*Q+2],A.scale.set(this.scales[I][Q],this.scales[I][Q],this.scales[I][Q]),A.rotation.set(0,0,this.thetas[I][Q]+Y*(Q%2==0?.2:-.2),"ZYX"),A.updateMatrix(),this.meshes[I].setMatrixAt(Q,A.matrix)}this.meshes[I].instanceMatrix.needsUpdate=!0}}class Y{constructor(B,I){this.numGroups=B,this.numParticles=I,this.group=new A.Group,this.geometry=new A.PlaneGeometry(.06,.12),this.material=new A.MeshBasicMaterial({color:1118481}),this.meshes=new Array(B);for(let I=0;I<B;I++)this.meshes[I]=new A.InstancedMesh(this.geometry,this.material,this.numParticles),this.meshes[I].instanceMatrix.setUsage(A.DynamicDrawUsage),this.group.add(this.meshes[I]);this.positions=new Array(B),this.thetas=new Array(B),this.phis=new Array(B),this.scales=new Array(B),this.speeds=new Array(B);for(let A=0;A<B;A++)this.positions[A]=new Float32Array(3*I),this.thetas[A]=new Float32Array(I),this.phis[A]=new Float32Array(I),this.scales[A]=new Float32Array(I),this.speeds[A]=new Float32Array(I)}set(A){for(let B=0;B<this.numGroups;B++)for(let I=0;I<this.numParticles;I++){const Q=Math.pow(A.rand(1.2,3),4),Y=A.rand(0,2*Math.PI),F=A.rand(0,.5*Math.PI);this.positions[B][3*I+0]=Q*Math.cos(Y)*Math.cos(F),this.positions[B][3*I+1]=Q*Math.sin(Y)*Math.cos(F),this.positions[B][3*I+2]=Q*Math.sin(F),this.scales[B][I]=A.rand(.6,.8),this.thetas[B][I]=A.rand(-1,1),this.phis[B][I]=A.rand(-Math.PI,Math.PI),this.speeds[B][I]=A.rand(.2,1.2)}}update(A,B,I){for(let Q=0;Q<this.numParticles;Q++){const Y=.5+.5*Math.pow(B,this.speeds[I][Q]);A.position.x=Y*this.positions[I][3*Q+0],A.position.y=Y*this.positions[I][3*Q+1],A.position.z=Y*this.positions[I][3*Q+2],A.scale.set(this.scales[I][Q],this.scales[I][Q],this.scales[I][Q]),A.rotation.set(0,this.phis[I][Q],this.thetas[I][Q],"ZYX"),A.updateMatrix(),this.meshes[I].setMatrixAt(Q,A.matrix)}this.meshes[I].instanceMatrix.needsUpdate=!0}}class F{constructor(B,I){this.numGroups=B,this.numParticles=I,this.group=new A.Group,this.geometry=new A.ConeGeometry(.05,1,24,24),this.material=new A.ShaderMaterial({vertexShader:"varying float diffuse;\r\n\r\nvoid main() {\r\n\t#include <begin_vertex>\r\n float theta = -0.4 * transformed.y;\r\n transformed.y += 0.5;\r\n diffuse = smoothstep(2.0 - transformed.y * 2.5, 2.0 - transformed.y * 2.5 + 0.01, abs(abs(atan(transformed.z, transformed.x)) - 1.8));\r\n transformed.xy = mat2(cos(theta), -sin(theta), sin(theta), cos(theta)) * transformed.xy;\r\n #include <project_vertex>\r\n}",fragmentShader:"varying float diffuse;\r\n\r\nvoid main() {\r\n vec3 color = mix(vec3(1.0), vec3(0.12), diffuse);\r\n gl_FragColor = vec4(vec3(color), 1.0);\r\n}"}),this.meshes=new Array(B);for(let I=0;I<B;I++)this.meshes[I]=new A.InstancedMesh(this.geometry,this.material,this.numParticles),this.meshes[I].instanceMatrix.setUsage(A.DynamicDrawUsage),this.group.add(this.meshes[I]);this.depths=new Array(B),this.thetas=new Array(B),this.phis=new Array(B),this.scales=new Array(B),this.speeds=new Array(B);for(let A=0;A<B;A++)this.depths[A]=new Float32Array(I),this.thetas[A]=new Float32Array(I),this.phis[A]=new Float32Array(I),this.scales[A]=new Float32Array(I),this.speeds[A]=new Float32Array(I)}set(A){for(let B=0;B<this.numGroups;B++)for(let I=0;I<this.numParticles;I++)this.depths[B][I]=A.rand(0,.5),this.scales[B][I]=A.rand(2,5),this.thetas[B][I]=A.rand(.5,2.5),this.phis[B][I]=Math.floor(A.rand(0,2))*Math.PI,this.speeds[B][I]=A.rand(.2,1)}update(A,B,I){for(let Q=0;Q<this.numParticles;Q++){const Y=.5+.5*Math.pow(B,this.speeds[I][Q]);A.position.set(0,0,this.depths[I][Q]),A.scale.set(this.scales[I][Q]*Y,this.scales[I][Q]*Y,this.scales[I][Q]*Y),A.rotation.set(0,this.phis[I][Q],this.thetas[I][Q],"YZX"),A.updateMatrix(),this.meshes[I].setMatrixAt(Q,A.matrix)}this.meshes[I].instanceMatrix.needsUpdate=!0}}class M{constructor(B){this.numParticles=B,this.geometry=new A.BufferGeometry;const I=new Float32Array(3*B),Q=new Float32Array(B);this.geometry.setAttribute("position",new A.Float32BufferAttribute(I,3)),this.geometry.setAttribute("scale",new A.Float32BufferAttribute(Q,1)),this.material=new A.ShaderMaterial({transparent:!0,depthWrite:!1,vertexShader:"attribute float scale;\r\n\r\nuniform float displayScale;\r\n\r\nvoid main() {\r\n vec4 viewPosition = modelViewMatrix * vec4(position, 1.0);\r\n gl_Position = projectionMatrix * viewPosition;\r\n gl_PointSize = displayScale * (scale / -viewPosition.z);\r\n}",fragmentShader:"void main() {\r\n float d = distance(gl_PointCoord, vec2(0.5)) * 2.0;\r\n float alpha = smoothstep(1.01, 0.99, d) * pow(d, 8.0);\r\n gl_FragColor = vec4(vec3(0.7), alpha);\r\n}",uniforms:{displayScale:{value:0}}}),this.mesh=new A.Points(this.geometry,this.material)}set(A,B,I){const Q=this.mesh.geometry.attributes.position.array,Y=this.mesh.geometry.attributes.scale.array;this.p0=new Float32Array(2*this.numParticles);for(let B=0;B<this.numParticles;B++)this.p0[2*B+0]=A.rand(0,20),this.p0[2*B+1]=A.rand(0,20),Q[3*B+0]=this.p0[2*B+0]-10,Q[3*B+1]=this.p0[2*B+1]-10,Q[3*B+2]=A.rand(-10,-5),Y[B]=A.rand(20,40);this.mesh.geometry.attributes.position.needsUpdate=!0,this.mesh.geometry.attributes.scale.needsUpdate=!0,this.v1=B,this.v2=I}update(A){const B=this.mesh.geometry.attributes.position.array;for(let I=0;I<this.numParticles;I++)B[3*I+0]=(1e10+this.p0[2*I+0]+this.v1*A)%20-10,B[3*I+1]=(1e10+this.p0[2*I+1]+this.v2*A)%20-10;this.mesh.geometry.attributes.position.needsUpdate=!0}}const E="attribute float scale;\r\nattribute float t0;\r\nattribute float spark;\r\nattribute float angle;\r\n\r\nuniform float displayScale;\r\nuniform float time;\r\n\r\nvarying float vSpark;\r\nvarying float vAngle;\r\n\r\nvoid main() {\r\n vSpark = spark;\r\n vAngle = angle;\r\n\r\n vec4 viewPosition = modelViewMatrix * vec4(position, 1.0);\r\n gl_Position = projectionMatrix * viewPosition;\r\n gl_PointSize = displayScale * scale * (sin(t0 + time * 30.0) * 0.4 + 0.6) * (1.0 / -viewPosition.z);\r\n}",g="#define PI 3.14159265359\r\n\r\nvarying float vSpark;\r\nvarying float vAngle;\r\n\r\nvoid main() {\r\n vec2 uv = gl_PointCoord - 0.5;\r\n uv *= mat2(cos(vAngle), -sin(vAngle), sin(vAngle), cos(vAngle));\r\n float d = length(uv);\r\n float s = vSpark + 1.0;\r\n float alpha = exp(-d * 10.0 * s) * max(0.0, 1.0 - abs(uv.x * uv.y * 120.0 * s));\r\n float a = PI / 4.0;\r\n uv *= mat2(cos(a), -sin(a), sin(a), cos(a));\r\n alpha = max(alpha, exp(-d * 16.0 * s) * max(0.0, 1.0 - abs(uv.x * uv.y * 160.0 * s)));\r\n gl_FragColor = vec4(vec3(1.0), alpha * 20.0);\r\n}";class c{constructor(B){this.numParticles=B,this.geometry=new A.BufferGeometry;const I=new Float32Array(3*B),Q=new Float32Array(B),Y=new Float32Array(B);this.geometry.setAttribute("position",new A.Float32BufferAttribute(I,3)),this.geometry.setAttribute("scale",new A.Float32BufferAttribute(Q,1)),this.geometry.setAttribute("t0",new A.Float32BufferAttribute(Y,1)),this.material=new A.ShaderMaterial({transparent:!0,depthWrite:!1,vertexShader:E,fragmentShader:g,uniforms:{displayScale:{value:0},time:{value:0}}}),this.mesh=new A.Points(this.geometry,this.material)}set(A,B,I){const Q=this.mesh.geometry.attributes.scale.array,Y=this.mesh.geometry.attributes.t0.array;this.p0=new Float32Array(2*this.numParticles);for(let B=0;B<this.numParticles;B++)this.p0[2*B+0]=A.rand(0,20),this.p0[2*B+1]=A.rand(0,20),Q[B]=A.rand(4,12),Y[B]=A.rand(0,2*Math.PI);this.mesh.geometry.attributes.scale.needsUpdate=!0,this.mesh.geometry.attributes.t0.needsUpdate=!0,this.v1=B,this.v2=I}update(A){const B=this.mesh.geometry.attributes.position.array;for(let I=0;I<this.numParticles;I++)B[3*I+0]=(1e10+this.p0[2*I+0]+this.v1*A)%20-10,B[3*I+1]=(1e10+this.p0[2*I+1]+this.v2*A)%20-10;this.mesh.geometry.attributes.position.needsUpdate=!0,this.mesh.material.uniforms.time.value=A}}class h{constructor(B){this.numParticles=B,this.geometry=new A.BufferGeometry;const I=new Float32Array(3*B),Q=new Float32Array(B),Y=new Float32Array(B),F=new Float32Array(B),M=new Float32Array(B);this.geometry.setAttribute("position",new A.Float32BufferAttribute(I,3)),this.geometry.setAttribute("scale",new A.Float32BufferAttribute(Q,1)),this.geometry.setAttribute("t0",new A.Float32BufferAttribute(Y,1)),this.geometry.setAttribute("spark",new A.Float32BufferAttribute(F,1)),this.geometry.setAttribute("angle",new A.Float32BufferAttribute(M,1)),this.material=new A.ShaderMaterial({transparent:!0,depthWrite:!1,vertexShader:E,fragmentShader:g,uniforms:{displayScale:{value:0},time:{value:0}}}),this.mesh=new A.Points(this.geometry,this.material)}set(A){const B=this.mesh.geometry.attributes.scale.array,I=this.mesh.geometry.attributes.t0.array,Q=this.mesh.geometry.attributes.spark.array,Y=this.mesh.geometry.attributes.angle.array;this.a=A.rand(3,6),this.b=A.rand(3,6),this.c=A.rand(3,6),this.phi=A.rand(0,2*Math.PI),this.psi=A.rand(0,2*Math.PI),this.offset=new Float32Array(3*this.numParticles);for(let F=0;F<this.numParticles;F++)this.numParticles,this.offset[3*F+0]=A.rand(-2,2),this.offset[3*F+1]=A.rand(-2,2),this.offset[3*F+2]=A.rand(-8,-4),B[F]=A.rand(.1,20),I[F]=A.rand(0,2*Math.PI),Q[F]=A.rand(-.5,1.5),Y[F]=A.rand(0,.5*Math.PI);this.mesh.geometry.attributes.scale.needsUpdate=!0,this.mesh.geometry.attributes.t0.needsUpdate=!0,this.mesh.geometry.attributes.spark.needsUpdate=!0,this.mesh.geometry.attributes.angle.needsUpdate=!0}update(A){const B=this.mesh.geometry.attributes.position.array;for(let I=0;I<this.numParticles;I++){const Q=.4*(I/this.numParticles+Math.floor(1.2*A-I/this.numParticles));B[3*I+0]=4*Math.sin(this.a*Q)+this.offset[3*I+0],B[3*I+1]=4*Math.sin(this.b*Q+this.phi)+this.offset[3*I+1],B[3*I+2]=6*Math.sin(this.c*Q+this.psi)+this.offset[3*I+2],this.count++}this.mesh.geometry.attributes.position.needsUpdate=!0,this.mesh.material.uniforms.time.value=A}}class C{constructor(B){this.numParticles=B,this.geometry=new A.PlaneGeometry(10,10),this.material=new A.ShaderMaterial({vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n vUv = uv;\r\n \r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n}",fragmentShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n vec2 uv = vUv;\r\n uv -= .5;\r\n uv *= 1.5;\r\n \r\n float d = 0.0;\r\n float a = 0.463647609;\r\n uv.x = abs(uv.x);\r\n if (uv.x * 0.5 + uv.y > 0.2) {\r\n uv -= vec2(0.2, 0.1);\r\n uv *= mat2(cos(a), -sin(a), sin(a), cos(a));\r\n uv /= vec2(0.22360679, 0.3);\r\n d = length(uv);\r\n } else if (uv.y < 0.1) {\r\n uv.y -= 0.2;\r\n uv *= mat2(cos(a), -sin(a), sin(a), cos(a));\r\n uv /= vec2(0.22360679, 0.3);\r\n d = length(uv) - 1.0;\r\n }\r\n float r = smoothstep(1.1, 1.08, d) - smoothstep(1.02, 1.0, d);\r\n\r\n // Output to screen\r\n gl_FragColor = vec4(vec3(1.0), r * 0.8);\r\n}",transparent:!0}),this.mesh=new A.InstancedMesh(this.geometry,this.material,this.numParticles),this.mesh.instanceMatrix.setUsage(A.DynamicDrawUsage),this.positions=new Float32Array(3*B),this.scale=1,this.d=1}set(A){this.d=A.rand(1.2,1.8);for(let A=0;A<this.numParticles;A++)this.positions[3*A+0]=0,this.positions[3*A+1]=0,this.positions[3*A+2]=this.d*A;this.mesh.position.set(A.rand(-60,60),A.rand(-40,40),-100),this.mesh.rotation.set(.01*this.mesh.position.y,.01*-this.mesh.position.x,0),this.scale=A.rand(.2,1.2)}update(A,B){for(let I=0;I<this.numParticles;I++){A.position.x=this.positions[3*I+0],A.position.y=this.positions[3*I+1],A.position.z=this.positions[3*I+2]+this.d*(2*B-Math.floor(2*B));const Q=this.scale*this.smoothstep(-6,-5.98,2*B-I/24);A.scale.set(Q,Q,Q),A.updateMatrix(),this.mesh.setMatrixAt(I,A.matrix)}this.mesh.instanceMatrix.needsUpdate=!0}smoothstep(A,B,I){let Q=I-A+I/(B-A);return Q<0?0:Q<1?Q*Q*(3-2*Q):1}}class i{constructor(B,I){this.numPaths=B,this.numVertices=I,this.group=new A.Group,this.origin=new A.Vector3(0,0,0),this.paths=new Array(this.numPaths),this.geometries=new Array(this.numPaths);for(let B=0;B<this.numPaths;B++){this.paths[B]=new A.CurvePath;let Q=this.origin;for(let I=0;I<this.numVertices;I++){const I=new A.Vector3(1,0,0);I.add(Q),this.paths[B].add(new A.LineCurve3(Q,I)),Q=I}this.geometries[B]=new A.TubeGeometry(this.paths[B],I,.01+.008*B,5,!1)}this.material=new A.ShaderMaterial({vertexShader:"void main() {\r\n\t#include <begin_vertex>\r\n #include <beginnormal_vertex>\r\n #include <defaultnormal_vertex>\r\n\r\n transformedNormal = normalize(transformedNormal);\r\n transformed += transformedNormal * transformed.y * 0.016;\r\n\r\n\t#include <project_vertex>\r\n}",fragmentShader:"void main() {\r\n gl_FragColor = vec4(vec3(1.0), 1.0);\r\n}"}),this.meshes=new Array(this.numPaths);for(let B=0;B<this.numPaths;B++)this.meshes[B]=new A.Mesh(this.geometries[B],this.material),this.group.add(this.meshes[B])}set(B){this.origin.set(B.rand(-10,10),8,-10),this.d0=new A.Vector3(-this.origin.x/50+B.rand(-.1,.1),-.3,0);for(let I=0;I<this.numPaths;I++){let Q=this.origin.clone(),Y=this.d0.clone();for(let F=0;F<this.numVertices;F++){Y.multiplyScalar(B.rand(.98,1.02)),Y.applyAxisAngle(new A.Vector3(0,0,1),B.rand(-.1,.1));let M=new A.Vector3(Y.y,-Y.x,B.rand(-.01,.01));M.setLength(B.rand(-.5,.5));let E=Q.clone();E.add(Y),E.add(M),this.paths[I].curves[F].v1.copy(Q),this.paths[I].curves[F].v2.copy(E),Q=E}let F=new A.TubeGeometry(this.paths[I],this.numVertices,.01+.008*I,5,!1);for(let A=0;A<this.geometries[I].vertices.length;A++)this.geometries[I].vertices[A].copy(F.vertices[A]);this.geometries[I].verticesNeedUpdate=!0,this.geometries[I].computeVertexNormals()}}update(B,I){for(let B=0;B<this.numPaths;B++){let Q=this.origin.clone(),Y=this.d0.clone();for(let F=0;F<this.numVertices;F++){Y.multiplyScalar(I.rand(.98,1.02)),Y.applyAxisAngle(new A.Vector3(0,0,1),I.rand(-.1,.1));let M=new A.Vector3(Y.y,-Y.x,I.rand(-.01,.01));M.setLength(I.rand(-.5,.5));let E=Q.clone();E.add(Y),E.add(M),this.paths[B].curves[F].v1.copy(Q),this.paths[B].curves[F].v2.copy(E),Q=E}let F=new A.TubeGeometry(this.paths[B],this.numVertices,.01+.008*B,5,!1);for(let A=0;A<this.geometries[B].vertices.length;A++)this.geometries[B].vertices[A].copy(F.vertices[A]);this.geometries[B].verticesNeedUpdate=!0,this.geometries[B].computeVertexNormals()}}}class w{constructor(B){this.numParticles=B,this.geometry=new A.PlaneGeometry(10,10,2,2),this.canvas=document.createElement("canvas"),this.canvas.width=1200,this.canvas.height=1200,this.texture=new A.CanvasTexture(this.canvas),this.material=new A.ShaderMaterial({vertexShader:"varying float alpha;\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n #include <beginnormal_vertex>\r\n #include <defaultnormal_vertex>\r\n\r\n vUv = uv;\r\n alpha = length(instanceColor.xyz) / sqrt(3.0);\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n}",fragmentShader:"uniform sampler2D tex;\r\n\r\nvarying float alpha;\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n vec4 diffuseColor = texture2D( tex, vUv );\r\n diffuseColor.a *= alpha;\r\n gl_FragColor = diffuseColor;\r\n}",uniforms:{tex:{value:this.texture}},transparent:!0}),this.mesh=new A.InstancedMesh(this.geometry,this.material,this.numParticles),this.mesh.instanceColor=new A.InstancedBufferAttribute(new Float32Array(3*this.numParticles),3);for(let B=0;B<this.numParticles;B++){let I=1-Math.pow(B/this.numParticles,.01);this.mesh.setColorAt(B,new A.Color(I,I,I))}this.mesh.instanceColor.needsUpdate=!0,this.normal=new A.Vector3,this.speed=0}set(B){this.draw(B),this.texture.needsUpdate=!0,this.mesh.rotation.set(B.rand(-1.2,0),B.rand(-.2,.2),B.rand(-.2,.2)),this.normal.set(0,0,1),this.normal.applyMatrix4(this.mesh.matrix),this.mesh.position.set(B.rand(-2,2),B.rand(1*this.mesh.rotation.x,0)+1,B.rand(-10,-6));const I=new A.Object3D;for(let A=0;A<this.numParticles;A++)I.position.x=0,I.position.y=0,I.position.z=.04*A,I.scale.set(1,1,1),I.updateMatrix(),this.mesh.setMatrixAt(A,I.matrix);this.mesh.instanceMatrix.needsUpdate=!0,this.speed=B.rand(-.006,.006)}draw(A){const B=Math.floor(A.rand(0,2)),I=Math.floor(A.rand(0,2)),Q=Math.floor(A.rand(0,4)),Y=Math.floor(A.rand(0,3))%2,F=Math.floor(A.rand(0,4)),M=Math.floor(A.rand(4,8)),E=[5,6,7,8,7,8,9,9][Q],g=this.canvas.getContext("2d");g.clearRect(0,0,1200,1200),g.strokeStyle="#ffffff",g.fillStyle="#ffffff",g.lineWidth=16;let c,h=(A,B,I)=>{g.beginPath(),g.arc(A,B,I,0,2*Math.PI),g.stroke()},C=(A,B,I,Q)=>{let Y=[5,6,7,8,7,8,9,9][Q],F=[2,2,2,2,3,3,3,4][Q],M=2*Math.PI/Y;g.beginPath();for(let Q=0;Q<Y;Q++){let Y=M*Q,E=M*(Q+F);g.moveTo(A+I*Math.sin(Y),B-I*Math.cos(Y)),g.lineTo(A+I*Math.sin(E),B-I*Math.cos(E))}return g.stroke(),I*Math.cos(F/Y*Math.PI)};switch(B){case 0:c=A.rand(400,450),h(600,600,c),h(600,600,500);var i=(500+c)/2,w=(500-c)/2;if(0==I)for(let A=0;A<E*(10-E);A++){let B=2*Math.PI/(E*(10-E))*A,I=A%(10-E)==0?w:.2*w;h(600+i*Math.sin(B),600-i*Math.cos(B),I)}else for(let A=0;A<E*(12-E);A++){let B=2*Math.PI/(E*(12-E))*A;J=600+(i-.6*w)*Math.sin(B),U=600-(i-.6*w)*Math.cos(B),y=600+(i+.6*w)*Math.sin(B),N=600-(i+.6*w)*Math.cos(B),g.beginPath(),g.moveTo(J,U),g.lineTo(y,N),g.stroke()}break;case 1:if(c=A.rand(250,300),h(600,600,c),h(600,600,500),i=(500+c)/2,w=(500-c)/2,0==I)for(let A=0;A<E;A++){let B=2*Math.PI/E*A;h(600+i*Math.sin(B),600-i*Math.cos(B),w),C(600+i*Math.sin(B),600-i*Math.cos(B),w,Q)}else for(let A=0;A<E*(9-E);A++){let B=2*Math.PI/(E*(9-E))*A;A%(9-E)==0?(h(600+i*Math.sin(B),600-i*Math.cos(B),.8*w),h(600+i*Math.sin(B),600-i*Math.cos(B),.4*w)):h(600+i*Math.sin(B),600-i*Math.cos(B),.2*w)}}var J,U,y,N;1==Y&&((A,B,I,Q)=>{let Y=2*Math.PI/Q;g.beginPath();for(let A=0;A<Q;A++){let B=Y*A,Q=Y*(A+1);g.moveTo(600+I*Math.sin(B),600-I*Math.cos(B)),g.lineTo(600+I*Math.sin(Q),600-I*Math.cos(Q))}g.stroke()})(0,0,c,E);let s=C(600,600,c,Q);switch(F){case 1:h(600,600,s);break;case 2:h(600,600,s),C(600,600,s,M);break;case 3:C(600,600,s,M)}}update(A){this.mesh.rotateOnAxis(this.normal,this.speed)}}class J{constructor(A,B){this.mode=B,0==this.mode?(this.explosion=new Q(4,12,80),this.fragment=new Y(4,56),this.cone=new F(4,5),this.count=-1,A.add(this.explosion.g