<script id='vShader' type='x-vertex/x-shader'>
uniform float pixelRatio;
varying vec3 mPosition;//modified position
if(t>0.)b=max(0.,(cos(a/20.-t*.02)-.99)*3./a);
if(z>0.)b=max(0.,cos(a/40.-z*.01+2.));
mPosition=position*(1.+b*4.);
vec4 mvPosition=modelViewMatrix*vec4(mPosition,1.);
gl_Position=mvPosition*projectionMatrix;
gl_PointSize=pixelRatio*size*(1.+gas*2.)/length(mvPosition.xyz);
<script id='fShader' type='x-fragment/x-shader'>
float a=distance(mPosition,vPosition);
float b=max(.32,.0065*length(vPosition));
float c=distance(gl_PointCoord,vec2(.5));
float starlook=-(c-.5)*1.2*gas;
float gaslook=(1.-gas)/(c*10.);
float texture=starlook+gaslook;
gl_FragColor=vec4(.32,.28,b,1.)*texture*(1.-a*.35);
if(z>0.)gl_FragColor*=cos(1.57*z/322.)*(1.-.001*length(mPosition));
<p class=shadow>Milkyways Industries proudly presents</p>
<p class=shadow>the Dark EnErgy Pulse Buster</p>
<span class='black one'></span>
<span class='black two'></span>
<span class='black three'></span>
<span class='black four'></span>
<span class='black one right'></span>
<span class='black two right'></span>
<span class='black three right'></span>
<span class='black four right'></span>
<span id=timeline></span>
<span class=metal id=abort></span>
<div id=instruction>Welcome ! Now we have conquered all the universe, we prefer shooting at galaxies rather than golf balls. There are billions anyway. Click to scan it first.</div>
<div id=good-person>I shouldn't. It is not the Jedi way.</div>
<p class=counter-title id=saved>galaxies saved<p class=counter id=savedresult>0</p></p>
<p class=counter-title id=destroyed>galaxies destroyed<p class=counter id=destroyedresult>0</p></p>
<a class=twitter href="https://twitter.com/GPUaccelerated" target='_blank'>Share your result on twitter</a>
<a class=more href="https://codepen.io/collection/nVYEGg/" style='position:absolute; bottom:10px;right:10px;font-family:Arial;color:#33c;margin-right:-500px;transition:margin-right 500ms ease;' target='_blank'>More webgl galaxies</a>
<button style='position:absolute;width:100%;text-align:center;border-radius:5px;right:10px;font-family:Arial;color:#33c;outline:none;background:none;border:none;text-decoration:underline;font-size:16px;cursor:pointer;'>Had a bad day ?<br/>Destroy this galaxy to undwind</button>