#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D   u_tex0;
uniform sampler2D   u_tex1;
uniform sampler2D   u_tex2;
uniform float		u_time;
varying vec2        v_texture;
varying vec2        v_texture1;
varying vec4	    v_col;
void main()
	{
	vec4 colTile = texture2D(u_tex0, v_texture);
	float fGrad = texture2D(u_tex1, v_texture1).g + u_time;
	vec4 colFog = texture2D(u_tex2, vec2(fGrad, 0));
	
	gl_FragColor = mix(colTile, colFog, 1.0 - v_col.a);
	}