getParticleVertexShader = ({
  colorMode,
  color,
  devicePixelRatio
}) => `
// Size attribute for particle geometry
attribute float size;

// Calculate color based on particle position
varying vec3 vColor;

void main() {
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
  gl_PointSize = size * ( 300.0 / -mvPosition.z ) * ${devicePixelRatio};
  gl_Position = projectionMatrix * mvPosition;

  ${colorMode === 'rainbow' ? rainbowVertextColors : ''}
  ${colorMode === 'solid' ? solidVertexColors({ color }) : ''}
}
`
Generates a vertex shader for a particle system

This shader uses the position of particles to determine their color
and change them as they move