   window.lineDisablePrefix = `

  `;
  window.lineDisableSuffix = `
    gl_FragColor.rgba = vec4(0.0, 0.0, 0.0, 1.0);

  `;

   window.hueFSPrefix = `
      uniform float hueRotate;
      uniform float enabled;
      uniform float saturation;
      vec3 rgb2hsv(vec3 c) {
          vec4 K = vec4(0.0, -1.0/3.0, 2.0/3.0, -1.0);
          vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
          vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
          float d = q.x - min(q.w, q.y);
          float e = 1.0e-10;
          return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
      }

      vec3 hsv2rgb(vec3 c) {
          vec4 K = vec4(1.0, 2.0/3.0, 1.0/3.0, 3.0);
          vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
          return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
      }
  `;

    window.hueFSSuffix = `
      if(enabled < 0.9) return;
      vec3 hsv = rgb2hsv(gl_FragColor.rgb);
      hsv.x = fract(hsv.x + hueRotate);
      hsv.y = clamp(hsv.y + saturation, 0.0, 1.0);
      gl_FragColor.rgb = hsv2rgb(hsv);
  `;


   window.hueFSPrefix2 = `
      uniform float hueRotate;
      uniform float enabled;
      uniform float saturation;
      uniform float time;
      vec3 rgb2hsv(vec3 c) {
          vec4 K = vec4(0.0, -1.0/3.0, 2.0/3.0, -1.0);
          vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
          vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
          float d = q.x - min(q.w, q.y);
          float e = 1.0e-10;
          return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
      }

      vec3 hsv2rgb(vec3 c) {
          vec4 K = vec4(1.0, 2.0/3.0, 1.0/3.0, 3.0);
          vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
          return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
      }

float randomi(vec2 coord)
{
    float seed = 2.0;
    return fract(sin(dot(coord.st,vec2(12.9898,78.233)+seed)) * 43758.5453);
}

float pattern(vec2 st, vec2 v, float t) {
    vec2 p = floor(st+v);
    return step(t, randomi(100.+p*.000001)+randomi(p.xx)*0.5 );
}

void drawFlow() {
    vec2 iResolution = vec2(1920.0, 1080.0);
    vec2 parameters = vec2(200.0,1000.0);

    vec2 fragCoord = vMapUv.xy * iResolution;

    vec2 st = fragCoord/iResolution.xy;
    st.x *= iResolution.x/iResolution.y;

    vec2 grid = vec2(1.5,1.5);
    st *= grid;
    st = st.yx;
 
    vec2 ipos = floor(st);
    vec2 fpos = fract(st);

    float bpm = 125.0;
    float currentBeat = time*60.0/bpm;
    float timeInBeat = floor(currentBeat*40.0)/40.0+floor(currentBeat*4.0);

    vec2 vel = vec2(timeInBeat*2.*max(grid.x,grid.y));
    vel *= vec2(-1.,-1.0) * randomi(vec2(1.0+ipos.y));

    vec2 offset = vec2(0.0,0.);

    vec3 color1 = vec3(0.);
    color1 = vec3(pattern(st+offset,vel,0.5+parameters.x/iResolution.x));

    // Margins
    //color1 *= step(0.2,fpos.y);

    vec4 fragColor = vec4(1.0-color1,1.0);
    if (fragColor.r == 0.0) {
      fragColor = gl_FragColor;
    } else {
      //fragColor = texture(texture0, texCoord);
      //fragColor *= color;
    }

    gl_FragColor = mix(gl_FragColor, (gl_FragColor*0.8+vec4(0.2))*fragColor, clamp(3.5*distance(gl_FragCoord.yy/iResolution.xy, vec2(0.5,0.5)),0.0,1.0));
}
  `;

    window.hueFSSuffix2 = `
      if(enabled < 0.9) return;
      drawFlow();
      vec3 hsv = rgb2hsv(gl_FragColor.rgb);
      hsv.x = fract(hsv.x + hueRotate);
      hsv.y = clamp(hsv.y + saturation, 0.0, 1.0);
      gl_FragColor.rgb = hsv2rgb(hsv);
  `;