// hornet 'at' loopit 'dot' dk

struct v2f {
	float4 pos : POSITION;
  float2 texcoords : TEXCOORD0;

	float3 color : TEXCOORD1;
	float intensity : TEXCOORD2;
};

void main( in v2f IN,
					 in const uniform float3 min_color,
					 in const uniform float3 max_color,
					 in uniform sampler2D difftex : TEXUNIT0,
					 out float4 colOut : COLOR0)
{
	const float4 difftexcol = tex2D( difftex, IN.texcoords );
	const float3 grading = lerp( min_color, max_color, IN.intensity );

	const float3 col = float3(difftexcol.rgb * grading );
	colOut = float4( col, difftexcol.a );
	
	//DEBUG
	//colOut = float4(1,0,0,1);
}
