// Copyright 2006-2010 (C) - Frictional Games
//
// This file is part of HPL1 Engine
//
// For conditions of distribution and use, see copyright notice in LICENSE-shaders
//

///////////////////////////////////////////////////////
/// DIFFUSE SPOT LIGHTING FRAGMENT PROGRAM /////////////
///////////////////////////////////////////////////////

in vec4 vLightColor;
in vec2 vUv;
in vec3 vLightDir;
in vec4 vSpotlightUv;

OUTPUT

uniform sampler1D tex0; //falloffMap
uniform sampler1D tex1; //spotNegRejectMap

void main()
{
	float attenuation = texture1D(tex0, dot(vLightDir,vLightDir)).x;
	float rejectNeg = texture1D(tex1, vSpotlightUv.z + 0.5).x;

	outColor.w = attenuation * rejectNeg;
	outColor.xyz = vec3(0.0);
}
