#include <system.psh>

sampler2D ColorMap;
sampler2D OverlayMap;
sampler2D Distort:register(s2);

float2 Size;


float2 getTexOffset(float2 TexCoord, float2 Size) {
	float2 offset=tex2D(Distort,TexCoord)-0.5;
	offset=float2(offset.x/Size.x,offset.y/Size.y);
	return offset;
}

float4 ps_main(PS_IN In) : COLOR {
	//float2 Size=float2(15.0,30.0);
	float4 output=tex2D(ColorMap,In.Tex0+getTexOffset(In.Tex0,Size));
	return output;
}
