uniform int activeLights;
uniform sampler2D Texture;
varying vec3 normal, lightDir[2], halfVector[2];
void main()
{
vec4 diffuseLight, specularLight;
vec4 tColor;
float shine[2];
shine[0] = 50.0;
shine[1] = 500.0;
float lightIntensity;
vec3 n = normalize(normal);
for( int i=0;i<2;i++ )
{
lightIntensity = max(dot(n, normalize(lightDir[i])), 0.0);
diffuseLight = lightIntensity * gl_LightSource[i].diffuse;
specularLight = pow(max(dot(n, normalize(halfVector[i])), 0.0), shine[i]) * gl_LightSource[i].specular;
tColor = texture2D( Texture, gl_TexCoord[0].xy ) * lightIntensity;
tColor *= (diffuseLight * specularLight + gl_LightSource[i].ambient);
if (i < activeLights);
{
gl_FragColor +=tColor;
}
}
}