#include "Interface.fx"

/*******************************************************************/

struct vsMid
{
	float4	pos		: POSITION;
	float2	tex0	: TEXCOORD0;
	float2	tex1	: TEXCOORD1;
	float2	tex2	: TEXCOORD2;
	float2	tex3	: TEXCOORD3;
};

struct vsDst
{
	float4	color	: COLOR0;
};

/*******************************************************************/

vsMid VS(vsPDT2 src)
{
	vsMid dst;
	
	float4 pos = float4(src.pos.x, - src.pos.y, src.pos.z, 1);

	dst.pos		= mul(pos, argOrtho);
	dst.tex0	= float2(src.tex0.x - 0.0020f, src.tex0.y - 0.0020f);
	dst.tex1	= float2(src.tex0.x + 0.0020f, src.tex0.y - 0.0020f);
	dst.tex2	= float2(src.tex0.x + 0.0020f, src.tex0.y + 0.0020f);
	dst.tex3	= float2(src.tex0.x - 0.0020f, src.tex0.y + 0.0020f);

	return dst;
}

/*******************************************************************/

vsDst PS(vsMid src)
{
	vsDst dst;

// Read texture:

	float4 tex0 = tex2D(Sampler0L, src.tex0);
	float4 tex1 = tex2D(Sampler1L, src.tex1);
	float4 tex2 = tex2D(Sampler2L, src.tex2);
	float4 tex3 = tex2D(Sampler3L, src.tex3);

// Set color:

	dst.color = 0.25f * tex0 + 0.25f * tex1 + 0.25f * tex2 + 0.25f * tex3;

	return dst;
}

/*******************************************************************/

technique VS11PS13
{
	pass P0
	{
		PixelShader		= compile ps_1_3 PS();
		VertexShader	= compile vs_1_1 VS();
		ZEnable			= False;
	}
}
