
struct fragment {
	float4 position  : POSITION;
	float2 texcoord0 : TEXCOORD0;
};

float4 main(float2 texcoord : TEXCOORD0,
			uniform sampler2D texture,
			uniform sampler2D texture2,
			uniform float xmul,
			uniform float ymul) : COLOR0
{
	float4 col = tex2D(texture2, texcoord);
	float2 dir = -1.0+col.rg*2.0;

	dir.x *= xmul;
	dir.y *= ymul;

	dir = clamp(texcoord+dir, 0, 1);

	float4 newcol = tex2D(texture, dir);
	return newcol;
}