

uniform sampler2D mVelocity;
//uniform sampler2D mLastLine;
uniform vec3 mMax;
uniform vec3 mMin;

uniform float mStep;

void main (void) 
{
	
	
	
	if(gl_TexCoord[0].w == 0.0)
	{
		discard;
	}

	
	vec4 vellookup = texture2D(mVelocity, gl_TexCoord[0].xy);
	

	vec4 color = vec4(gl_TexCoord[1].xy + vellookup.xy, 0.0, 1.0);
	
	if(color.x < mMin.x)
	{
		discard;
	}
	if(color.y < mMin.y)
	{
		discard;
	}
	if(color.x > mMax.x)
	{
		discard;
	}
	if(color.y > mMax.y)
	{
		discard;
	}

	gl_FragColor = color;
	//gl_FragColor = vec4(normpos.xy, 0.0, 1.0);
	//gl_FragColor = vec4(lnormpos, 0.0, 1.0);
	//gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}