// Mikkel Gjøl, s971661 'at' student 'dot' dtu 'dot' dk
/////////////////////////////////////////

struct v2f {
	float4 position  : POSITION;
	float3 es_normal : TEXCOORD0;
	float4 color0 : COLOR0;
};

void main( in v2f IN,
					 out float4 colOut : COLOR0,
					 in uniform float inv ) {

	const float3 norm = normalize(IN.es_normal);
	const float diffuse  = dot( float3(0,0,1), norm );

	const float pwd = pow(diffuse,5);

	if(inv>0.5f)
		colOut = float4(float3(1-pwd), 1);
	else
		colOut = float4(1,1,1, pwd);

	//DEBUG
	//colOut = IN.color0;
}
