sampler texA : register(s0);
sampler texB : register(s1);

float time = 0.3;
float axis = 0;
float mag = -1;

float4 wipe( float2 uv: TEXCOORD0, float4 color : COLOR0 ) : COLOR 
{
	float4 cA = tex2D(texA, uv);
    float4 cB = tex2D(texB, uv);
    float alphaBase = mag * 2 * uv[axis] - 1;
    float alpha = max(0, min(1, time * 4 + alphaBase));
    return (cB - cA) * alpha + cA;
}

technique Wipe
{
    pass P0 {
        ColorWriteEnable = 7;
        PixelShader  = compile ps_2_0 wipe();
    }
}

technique NoEffect
{
	pass P0 {
		ColorWriteEnable = 0;
		zenable = true;
		zfunc = never;
	}
} 