#ifdef VSPS_3
shared float4x4 projTM: register(c0);
shared float4x4 worldTM: register(c4);
shared float4x4 worldITM: register(c8);
shared float4x4 Bones[ 32 ]: register(c12);
shared float4 eyePosns[ 32 ]: register(c140);
shared float4 lightPosns[ 32 ]: register(c172);
shared float4 eyePos: register(c204);
shared float4 lightPos: register(c205);

shared float4 uvOffset_0: register(c206);
shared float4 uvOffset_1: register(c207);

shared float4 combo: register(c208);
// shared float Reflect_amt: register(c208);
// shared float Lighting: register(c209);
// shared float Bump: register(c210);
// shared float uvOffsetY: register(c211);
shared float4 Color_1: register(c212);
shared float4 Color_2: register(c213);
shared float4 Specular_Color: register(c214);
#else
shared float4x4 projTM;
shared float4x4 worldTM;
shared float4x4 worldITM;
shared float4x4 Bones[ 32 ];
shared float4 eyePosns[ 32 ];
shared float4 lightPosns[ 32 ];
shared float4 eyePos;
shared float4 lightPos;

shared float4 uvOffset_0;
shared float4 uvOffset_1;

shared float4 combo;
// shared float Reflect_amt;
// shared float Lighting;
// shared float Bump;
// shared float uvOffsetY;
shared float4 Color_1;
shared float4 Color_2;
shared float4 Specular_Color;
#endif


struct Technique1_Pass1_VS_OUT 
{
	float4 position : POSITION;
	float2 uv0 : TEXCOORD0;
	float2 uv1 : TEXCOORD1;
	float2 uv2 : TEXCOORD2;
	float2 uv3 : TEXCOORD3;
};

struct Technique2_Pass1_VS_OUT 
{
	float4 position : POSITION;
	float2 uv0 : TEXCOORD0;
};

Technique1_Pass1_VS_OUT Technique1_Pass1_VS(
float4 pos : POSITION,
float2 uv0 : TEXCOORD0)
{
	Technique1_Pass1_VS_OUT OUT;
	OUT.position = mul(pos,projTM);
	OUT.uv0 = uv0+uvOffset_0.xy;
	OUT.uv1 = uv0+uvOffset_0.zw;
	OUT.uv2 = uv0+uvOffset_1.xy;
	OUT.uv3 = uv0+uvOffset_1.zw;			
	return OUT;
}

Technique2_Pass1_VS_OUT Technique2_Pass1_VS(
float4 pos : POSITION,
float2 uv0 : TEXCOORD0)
{
	Technique2_Pass1_VS_OUT OUT;
	OUT.position = mul(pos,projTM);
	OUT.uv0 = uv0;		
	return OUT;
}

sampler2D TextureSampler0: register(s0);
sampler2D TextureSampler1: register(s1);
sampler2D TextureSampler2: register(s2);
sampler2D TextureSampler3: register(s3);


float4 Technique1_Pass1_PS_AlphaBlur(
float2 uv0 : TEXCOORD0,
float2 uv1 : TEXCOORD1,
float2 uv2 : TEXCOORD2,
float2 uv3 : TEXCOORD3
) : COLOR
{
float4 average = {0.25f,0.25f,0.25f,0.25f};
float4 combiner;

	combiner = average*tex2D(TextureSampler0,uv0);
	combiner += average*tex2D(TextureSampler1,uv1);
	combiner += average*tex2D(TextureSampler2,uv2);
	combiner += average*tex2D(TextureSampler3,uv3);
	combiner.a = Color_1.a;
	return combiner;		
}

float4 Technique3_Pass1_PS() : COLOR
{
	return Color_1;		
}

technique Technique2
{
	pass Pass1
	{
#ifdef VSPS_3
		VertexShader = compile vs_3_0 Technique1_Pass1_VS();	
		PixelShader = compile ps_3_0 Technique1_Pass1_PS_AlphaBlur();
#else
		VertexShader = compile vs_2_0 Technique1_Pass1_VS();	
		PixelShader = compile ps_2_0 Technique1_Pass1_PS_AlphaBlur();
#endif
	}
}

technique Fade
{
	pass Pass1
	{
#ifdef VSPS_3
		VertexShader = compile vs_3_0 Technique2_Pass1_VS();
		PixelShader = compile ps_3_0 Technique3_Pass1_PS();
#else
		VertexShader = compile vs_2_0 Technique2_Pass1_VS();
		PixelShader = compile ps_2_0 Technique3_Pass1_PS();
#endif
	}
}

