uniform mat4 Eng_ObjectMatrix;
uniform float Eng_WaterMax;
uniform vec3 Eng_LocalLighting;

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

void main()
{
	TexCoord = gl_MultiTexCoord0.xy;
 	vec4 wvert = Eng_ObjectMatrix * gl_Vertex;
 	
	height = Eng_WaterMax - wvert.z;
	air = wvert.z - Eng_WaterMax;
	
	Clr = (max(0.0, dot(gl_Normal, Eng_LocalLighting)) * gl_LightSource[0].diffuse) + gl_LightSource[0].ambient;
	 			 	
 	gl_Position = ftransform();
}