uniform int pattern;
uniform float time;

float step(float x) {
  return 1.0 / (1.0 + exp(-x*50.0));
  
}

void main() {
  float depth = gl_FragCoord.w*1.3;
  float a = 1.0; 

  if (pattern == 1) 
    a = cos(gl_FragCoord.x)*.5+.5 + cos(gl_FragCoord.y)*.5+.5;
  else if (pattern == 2)  {
    a= cos(gl_FragCoord.x)*.5+.5 * cos(gl_FragCoord.y)*.5+.5;
  }
  else if (pattern == 3)  {
    a= cos(gl_FragCoord.x)*.5+.5 / cos(gl_FragCoord.y)*.5+.5;
  }
  a += .5;

  gl_FragColor = vec4(gl_Color.xyz * depth, a*gl_Color.a);
}
