texture  TexA : Diffuse
<
	string ResourceName = "G:\\TestData\\pic\\NA2B59~1.JPG";
>;

texture  TexB : Diffuse
<
	string ResourceName = "G:\\TestData\\pic\\NA2F49~1.JPG";
>;

sampler TextureSamplerA : register(s0) = sampler_state
{
	Texture = <TexA>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
};
sampler TextureSamplerB : register(s1) = sampler_state
{
	Texture = <TexB>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
};


//------------------------------------
struct vertexInput {
    float3 position				: POSITION;
    float3 normal				: NORMAL;
    float4 texCoordDiffuse		: TEXCOORD0;
};

struct vertexOutput {
    float4 hPosition		: POSITION;
    float4 texCoordDiffuse	: TEXCOORD0;
    float4 diffAmbColor		: COLOR0;
    float4 specCol			: COLOR1;
};


float tranPos 
<
	string UIName = "tranPos";
	string UIWidget = "slider";
	float UIMin = 0.0;
	float UIStep = 0.01;
	float UIMax = 1.0;
> =  0.0;
float tranDir
 <
	string UIName = "tranDir";
	string UIWidget = "slider";
	float UIMin = 0.0;
	float UIStep = 1.0;
	float UIMax = 3.0;
> =  0;
float texChoose
<
	string UIName = "texChoose";
	string UIWidget = "slider";
	float UIMin = 0.0;
	float UIStep = 1.0;
	float UIMax = 1.0;
> =  0.0;

float4 PS_Textured(float2 uv: TEXCOORD0, float4 color : COLOR0): COLOR
{
  float2 texCoord =  uv;
  if ((tranDir >= -0.5) && (tranDir < 0.5))
  {
  	    if (uv.x < tranPos)
  			texCoord.x = tranPos;
  }
  else if ((tranDir >= 0.5) && (tranDir < 1.5)) 
  {
        if (uv.x > tranPos)
  			texCoord.x = tranPos;
  }
  else  if ((tranDir >= 1.5) && (tranDir < 2.5))
  {
  	    if (uv.y < tranPos)
  			texCoord.y = tranPos;
  }
  else if (tranDir >= 2.5)
  {
        if (uv.y > tranPos)
  			texCoord.y = tranPos;
  }
 
  float4 retColor;
  if (texChoose <= 0.5)
   	 retColor = tex2D( TextureSamplerA, texCoord );
  else
 	 retColor = tex2D( TextureSamplerB, texCoord );
 	 
  return retColor;
}

//-----------------------------------
technique BlurTransition_PS
{
    pass p0 
    {				
		PixelShader  = compile ps_2_0 PS_Textured();
    }
}