Source

gltut / Tut 16 Gamma and Textures / data / litTexture.frag

Diff from to

Tut 16 Gamma and Textures/data/litTexture.frag

 	vec4 lightIntensity;
 };
 
-const int numberOfLights = 1;
-
 uniform Light
 {
 	vec4 ambientIntensity;
 	float lightAttenuation;
 	float maxIntensity;
-	PerLight lights[numberOfLights];
+	PerLight lights[4];
 } Lgt;
 
+uniform int numberOfLights;
 
 float CalcAttenuation(in vec3 cameraSpacePosition,
 	in vec3 cameraSpaceLightPos,
 {
 	vec4 diffuseColor = texture(diffuseColorTex, colorCoord);
 	
-	/*
 	vec4 accumLighting = diffuseColor * Lgt.ambientIntensity;
 	for(int light = 0; light < numberOfLights; light++)
 	{
 		accumLighting += ComputeLighting(diffuseColor, Lgt.lights[light]);
 	}
 	
-	accumLighting = accumLighting / Lgt.maxIntensity;
-	*/
+	outputColor = accumLighting / Lgt.maxIntensity;
 
-	outputColor = diffuseColor;
+//	outputColor = diffuseColor;
 }