varying float depth, height;
varying vec2 TexCoord;
uniform mat4 Eng_ObjectMatrix;
uniform float Eng_WaterMin;

void main()
{
	vec4 wvert = Eng_ObjectMatrix * gl_Vertex;
	height = Eng_WaterMin - wvert.z - 0.0; //todo
	
	TexCoord = gl_MultiTexCoord0.xy;
	
	gl_Position = ftransform();
	
	gl_Position.z = clamp(gl_Position.z, -1.0, 1.0);
	
	depth = ((gl_Position.z / gl_Position.w) + 1.0) * 0.5;
}