Source

gltut / Tut 12 Dynamic Range / data / DiffuseSpecular.frag

Diff from to

Tut 12 Dynamic Range/data/DiffuseSpecular.frag

 	float lightDistanceSqr = dot(lightDifference, lightDifference);
 	lightDirection = lightDifference * inversesqrt(lightDistanceSqr);
 	
-	return (1 / ( 1.0 + Lgt.lightAttenuation * Lgt.lightAttenuation
-		* sqrt(lightDistanceSqr)));
+	return (1 / ( 1.0 + Lgt.lightAttenuation * lightDistanceSqr));
 }
 
 vec4 ComputeLighting(in PerLight lightData)