 varying vec3 vertNormal;
 varying vec3 vertLightDir;
 
+#define PI radians(180.)
+
+// adapted from http://stackoverflow.com/a/26127012/128511
+// https://www.vertexshaderart.com/art/79HqSrQH4meL63aAo/revision/9c9YN5LwBQKLDa4Aa
+
+vec3 fibonacciSphere(float samples, float i) {
+  float rnd = 1.;
+  float offset = 2. / samples;
+  float increment = PI * (3. - sqrt(5.));
+
+  //  for i in range(samples):
+  float y = ((i * offset) - 1.) + (offset / 2.);
+  float r = sqrt(1. - pow(y ,2.));
+
+  float phi = mod(i + rnd, samples) * increment;
+
+  float x = cos(phi) * r;
+  float z = sin(phi) * r;
+
+  return vec3(x, y, z);
+}
 
 vec4 windowToClipVector(vec2 window, vec4 viewport, float clipw) {
   vec2 xypos = (window / viewport.zw) * 2.0;

  vertSpiral.y = sin(pointRads) * pointRadius;
  vertSpiral.z = vertSpiral.z; // + displaceStrength * textureColor.r;

  // animate between layouts
  float easedMix = smoothstep(0.1, 0.9, mixVal);
  vec4 mixedVert = mix(vertCopy, vertSpiral, easedMix);

  // custom point size - use color to grow point
  float finalPointSize = pointSize * (1. + (easedMix * (textureColor.r * 4.)));

  float vertexIndex = x + y * width;

  // copy original vertex (0-1) and mult components to fit the defined width/height as a 2d sheet
  vec4 vertGrid = vertex;
  float heightSpread = height * spread;
  float widthSpread = width * spread;
  vertGrid.y = -heightSpread/2. + vertGrid.y * heightSpread;
  vertGrid.x = -widthSpread/2. + vertGrid.x * widthSpread;
  vertGrid.z = vertGrid.z + displaceStrength * textureColor.r;

  // try a different way of displacing - spiral?
  vec4 vertSpiral = vertex;
