#include "Interface.fx"

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

struct vsMid
{
	float4	pos		: POSITION;
	float4	color	: COLOR0;
};

struct vsDst
{
	float4	color	: COLOR0;
};

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

vsMid VS(vsPND src)
{
	vsMid dst;
	
	float3	dV = normalize(argCameraPo - src.pos);
	float	dL = abs(dot(src.normal, dV));
	
	dst.pos		= mul(float4(src.pos, 1), argMVP);
	dst.color	= float4(src.color.r, src.color.g, dL * src.color.b, dL * src.color.a);

	return dst;
}

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

vsDst PS(vsMid src)
{
	vsDst dst;

	dst.color = src.color;

	return dst;
}

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

technique VS11PS13
{
	pass P0
	{
		CullMode		= CW;
		DestBlend		= One;
//		DestBlend		= Zero;
		PixelShader		= compile ps_1_3 PS();
		SrcBlend		= SrcAlpha;
//		SrcBlend		= One;
		VertexShader	= compile vs_1_1 VS();
		ZWriteEnable	= False;
	}
}
