title: How can I add different color overlays to each iteration of the texture in this glsl shader?
body: <p>So I'm working on this shader right now, and the goal is to have a series of camera based tiles, each overlayed with a different color (think Andy Warhol). I've got the tiles working (side issue - the tiles on the ends are currently being cut off ~50%) but I want to add a color filter to each iteration. I'm looking for the cleanest possible way of doing this. Any ideas? </p>
  
  <p>frag shader:</p>
  
  <pre><code>#define N 3.0 // number of columns
  #define M 3. // number of rows
  
  #import "GPUImageWarholFilter.h"
  
  NSString *const kGPUImageWarholFragmentShaderString = SHADER_STRING
  (
   precision highp float;
   varying highp vec2 textureCoordinate;
   uniform sampler2D inputImageTexture;
  
   void main()
  {
  
      vec4 color = texture2D(inputImageTexture, vec2(fract(textureCoordinate.x * N)/(M/ N), fract(textureCoordinate.y * M) / (M/N)));
  
      gl_FragColor = color;
  
  
  }
   );
  </code></pre>