<!-- SOLID CITY · part 3391 -->
float uP; uniform float uB; varying vec2 vUv; void main(){ float y = vUv.y; float f = .8 + .2*sin(uT*60. + y*20.); vec3 hot = mix(vec3(3.,1.6,.6), vec3(1.6,2.2,4.), uB); vec3 c = mix(vec3(2.,.25,.1), hot, smoothstep(.2, 1., y)); float a = smoothstep(0., .9, y) * f * (.35 + uP * .65); gl_FragColor = vec4(c * a, 1.); }",blending:Wt,depthWrite:!1,transparent:!0,side:vn});for(let n of[-1,1]){let s=new Oi(.5,1,14,1,!0);s.translate(0,-.5,0);let r=new Ze(s,e);r.rotation.x=-Math.PI/2,r.position.set(1.15*n,-.05,4.25),gn.add(r),$t.flames.push(r);let a=new Zs(new rs({map:jf,color:new ge(2.5,1.2,.5),blending:Wt,depthWrite:!1,transparent:!0}));a.position.set(1.15*n,-.05,4.6),a.scale.setScalar(3),gn.add(a),$t.glows.push(a)}$t.flameMat=e;let t=new It({uniforms:{uT:Dt.time,uA:{value:0}},vertexShader:"varying vec3 vP; varying vec3 vN; varying vec3 vV; void main(){ vP = position; vN = normalize(normalMatrix*normal); vec4 mv = modelViewMatrix*vec4(position,1.); vV = normalize(-mv.xyz); gl_Position = projectionMatrix*mv; }",fragmentShader:"uniform float uT; uniform float uA; varying vec3 vP; varying vec3 vN; varying vec3 vV; void main(){ float fr = pow(1. - abs(dot(vN, vV)), 1.5); float n = .55 + .45*sin(vP.z*3. + uT*40. + sin(vP.x*5. + uT*23.)*2.); float tail = smoothstep(9., -5., vP.z); vec3 c = mix(vec3(2.2,.35,.05), vec3(2.4,1.2,.3), n); gl_FragColor = vec4(c * fr * n * tail * uA, 1.); }",blending:Wt,depthWrite:!1,transparent:!0,side:vn});$t.heat=new Ze(ut(new mn(1,20,14),{p:[0,0,.6],s:[4.2,2.4,8.4]}),t),$t.heat.visible=!1,gn.add($t.heat),$t.shield=new Ze(ut(new mn(1,20,14),{s:[6.2,3.2,7.4]}),new Ft({color:new ge(.6,1.8,3),transparent:!0,opacity:0,blending:Wt,depthWrite:!1})),gn.add($t.shield),et.add(gn)}var zf={hull:()=>new Yn({color:1714724,emissive:0,shininess:80,specular:5614216}),glowG:new Ft({color:new ge(.4,3,1.3)}),glowM:new Ft({color:new ge(2.6,.4,3)}),glowR:new Ft({color:new ge(3,.5,.3)})},Ia={};function Hv(){Ia.scout=[{geo:ut(new mn(4.2,18,10),{s:[1,.32,1]}),mat:"hull"},{geo:ut(new hi(4.3,.35,6,28),{r:[Math.PI/2,0,0]}),mat:"glowG"},{geo:ut(new mn(1.5,12,8),{p:[0,.9,0]}),mat:"glowG"},{geo:ut(new Oi(.8,3.4,6),{p:[0,-.2,4.6],r:[Math.PI/2,0,0]}),mat:"hull"}],Ia.circler=[{geo:ut(new hi(4.6,1,8,24),{r:[Math.PI/2,0,0]}),mat:"hull"},{geo:ut(new aa(2.1,1)),mat:"glowM"},...[0,1,2].map(i=>({geo:ut(new Oi(.7,3.6,6),{p:[Math.cos(i*2.09)*6.4,0,Math.sin(i*2.09)*6.4],r:[0,-i*2.09,-Math.PI/2]}),mat:"hull"}))],Ia.diver=[{geo:ut(new oa(3.2,0),{s:[.9,.5,2]}),mat:"hull"},{geo:ut(new Gt(9,.3,1.6),{p:[0,0,-1.6]}),mat:"hull"},{geo:ut(new mn(.9,10,8),{p:[0,.6,2.4]}),mat:"glowR"},{geo:ut(new Gt(9.2,.2,.3),{p:[0,.05,-2.4]}),mat:"glowR"}],Ia.mother=[{geo:ut(new mn(30,32,14),{s:[1,.22,1]}),mat:"hull"},{geo:ut(new mn(11,20,12,0,Math.PI*2,0,Math.PI/2),{p:[0,4,0]}),mat:"hull"},{geo:ut(new hi(30.5,1.1,6,48),{r:[Math.PI/2,0,0]}),mat:"glowG"},{geo:ut(new hi(18,.6,6,40),{p:[0,-5.5,0],r:[Math.PI/2,0,0]}),mat:"glowM"},...[0,1,2,3,4,5].map(i=>({geo:ut(new Gt(2.4,3,8),{p:[Math.cos(i*1.047)*22,2.6,Math.sin(i*1.047)*22],r:[0,-i*1.047,0]}),mat:"hull"})),{geo:ut(new mn(5,14,10),{p:[0,-6,0]}),mat:"glowR"}]}var kv={scout:{hp:2,r:9,v:135},circler:{hp:3,r:9.5,v:150},diver:{hp:3,r:8.5,v:230},mother:{hp:34,r:32,v:60}},Hn=[];function tp(i){let e=zf.hull(),t=Ia[i].map(r=>({geo:r.geo,mat:r.mat==="hull"?e:zf[r.mat]})),n=ep(t);et.add(n);let s=kv[i];return{type:i,mesh:n,hull:e,hp:s.hp,maxHp:s.hp,r:s.r,vmax:s.v,pos:new $e,vel:new $e,alive:!0,t:Math.random()*10,fireT:2+Math.random()*2,flash:0,mode:"attack",modeT:0,orbit:Math.random()*6.28,side:Math.random()<.5?-1:1,aim:new $e}}var fu=56,pr=new Ni(new Gt(.34,.34,1),new Ft({color:new ge(4,.5,.6),transparent:!0,blending:Wt,depthWrite:!1}),fu),mr=new Ni(new Gt(.12,.12,1),new Ft({color:new ge(4,3.4,2.4)}),fu);pr.frustumCulled=mr.frustumCulled=!1;pr.count=mr.count=0;et.add(pr,mr);var pc=[];for(let i=0;i<fu;i++)pc.push({on:!1,pos:new $e,prev:new $e,dir:new $e,v:0,life:0});function Vv(i){let e=new ft,t=r=>new wt(new Float32Array(i*r),r).setUsage(Vl);e.setAttribute("position",t(3)),e.setAttribute("aV",t(3)),e.setAttribute("aC",t(4)),e.setAttribute("aInfo",t(3));for(let r=0;r<i;r++)e.attributes.aInfo.setXYZ(r,-999,.001,0);let n=new It({uniforms:{uT:Dt.time,uScale:{value:400}},vertexShader:`attribute vec3 aV; attribute vec4 aC; attribute vec3 aInfo; uniform float uT; uniform float uScale; varying vec4 vC; varying float vK;
      void main(){ float t = uT - aInfo.x; float life = aInfo.y; vK = t / life; vC = aC;
        if (t < 0. || t > life) { gl_Position = vec4(2., 2., 2., 1.); gl_PointSize = 0.; return; }
        vec3 p = position + aV * (1. - exp(-2.2 * t)) / 2.2;
        vec4 mv = modelViewMatrix * vec4(p, 1.); float sz = aInfo.z * (1. + vK * 1.6);
        gl_PointSize = clamp(sz * uScale / -mv.z, 0., 220.); gl_Position = projectionMatrix * mv; }`,fragmentShader:"varying vec4 vC; varying float vK; void main(){ vec2 p = gl_PointCoord - .5; float r = length(p); float a = smoothstep(.5, .0, r) * 