uniform sampler2D t_color;
uniform float r;
uniform float g;
uniform float b;
uniform float ratio;

void main(void) {
  vec4 col = texture2D(t_color,gl_TexCoord[0].xy);
  vec4 col2 = vec4(0.0, 0.0, 0.0, 0.0);
  float grey;
  float br = ratio;

  grey = (col.r + col.g + col.b) / 3.0;
  
//  col2.r = ( col.r*(1-ratio) ) + r*grey*ratio;
//  col2.g = ( col.g*(1-ratio) ) + g*grey*ratio;
//  col2.b = ( col.b*(1-ratio) ) + b*grey*ratio;

  col2.r = col.r*col.r*col.r*0.55 + 0.325*grey;
  col2.g = col.g*col.g*col.g*0.55 + 0.325*grey;
  col2.b = col.b*col.b*col.b*0.55 + 0.325*grey;
  
  
  gl_FragColor = col2;
  
}
