attribute mediump vec3 a_vertex;
attribute mediump vec2 a_texcoord;

uniform mat4 mvp;

uniform mediump vec4 g_Bottom;		// bottom coords in screen space
uniform mediump vec4 g_Swarm;		// swarm coords in screen space

varying mediump vec2 f_watercoord; 	// y = depth, x = shift
varying mediump vec2 f_bottomcoord;	// xy - refraction range, z - half depth
varying mediump vec2 f_swarmcoord;

void main()
{
	f_watercoord = a_texcoord;
	f_bottomcoord = (a_vertex.xy - g_Bottom.xy) * g_Bottom.zw;
	f_swarmcoord = (a_vertex.xy - g_Swarm.xy) * g_Swarm.zw;
	gl_Position = mvp * vec4(a_vertex, 1.0);
}