attribute vec3 pos;
varying vec2 tc;
 
void main()
{	
	tc = (pos.xy+1.0)/2.0;
	gl_Position = vec4(pos.xy, 0.0, 1.0);
}	

//FRAGMENT
uniform sampler2D Texture0; 

float grid(vec2 tc)
{
	//tc.x += .01;
	float lines = 0.0;
	float scale = 64.0;
	float lineWidth = .995;
	float lineX = pow((abs(sin((tc.x*3.141592)*scale*1.0))-lineWidth), .20);
	float lineY = pow((abs(sin((tc.y*3.141592)*scale*4.0))-lineWidth), .20);
	return max(0.0, max(lineX, lineY));
}

void main()
{  

	gl_FragColor = vec4(grid(tc));
	//gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
	return; 
}
