uniform sampler2D mVelocity;
uniform sampler2D mTransfer;
uniform float maxMagnitude;
uniform float minMagnitude;


void main (void) 
{
	vec4 lookup = texture2D(mVelocity, gl_TexCoord[0].xy);
	float len = ( length(lookup.xy) - minMagnitude ) / ( maxMagnitude - minMagnitude );
	
	vec4 color = texture2D(mTransfer, vec2(len, 0.5));

	color.a *= gl_Color.a;

	gl_FragColor = color;
}