uniform vec2 resolution;
uniform sampler2D u_texture;
uniform float time;
varying vec2 v_texCoord;

void main(){

	float pixel_size = 1.0/resolution.y;

	vec4 sum = vec4(0.0);
	
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - 4.0*pixel_size)) * 0.05;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - 3.0*pixel_size)) * 0.09;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - 2.0*pixel_size)) * 0.12;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - pixel_size)) * 0.15;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y)) * 0.16;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + pixel_size)) * 0.15;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + 2.0*pixel_size)) * 0.12;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + 3.0*pixel_size)) * 0.09;
	sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + 4.0*pixel_size)) * 0.05;
	
	//Intensity wave travel
	float x= time*0.1;
	float PI = 3.141592;
	//float intensity_y = (sin(x + PI/2.0)+1.0)/2.0;
	
	
	// float intensity_y = mod(x,1.0);
	
	// float dt = abs(v_texCoord.y - intensity_y);
	// if(dt < 0.1) sum *= (1.0f + 1.0*((0.1-dt)/0.1));

	gl_FragColor = sum;
}