varying float height, air;
varying vec4 Clr;
varying vec2 TexCoord;

uniform sampler2D DiffuseMap;
uniform vec4 Eng_WaterDeepColor;
uniform float Eng_WaterDeepVisibility;

void main()
{
	if (air > 0.0)
  		discard;
	else
	{
	    vec4 C = vec4(Clr);
	    C.a = 1.0;
		gl_FragColor = mix((C * texture2D(DiffuseMap, TexCoord)), Eng_WaterDeepColor, min(Eng_WaterDeepVisibility, height) / Eng_WaterDeepVisibility);
	}
}