uniform float4x4	matWorld;
uniform float4x4 	matWorldViewProj;

static const int  NUM_LIGHTS = 2;

struct VS_INPUT 
{
	float4 position		: POSITION0;
	float2 uv			: TEXCOORD0;
	float3 normal 		: NORMAL0;
};

struct VS_OUTPUT 
{
	float4 position 	: POSITION0;
	float2 uv		 	: TEXCOORD0;
	float4 color		: COLOR0;
};

uniform float3 wsLightDir[NUM_LIGHTS];

VS_OUTPUT main_vs( VS_INPUT input )
{
	VS_OUTPUT output;

	output.position = mul( matWorldViewProj, input.position );
	output.uv = input.uv;

	float3 normal = normalize(mul( matWorld, input.normal ));
	float3 lightDir = normalize(wsLightDir[0]);

	float nDotL = dot(normal, lightDir); // these must be normalized for this to work
	float f = 0.6f + nDotL*0.4f; // give the dark side some light
	output.color = float4(f, f, f, 1);

	return output;
}
