     {
         // Compute range attenuation
         vec3 ldir = v_vertexToSpotLightDirection[i] * u_spotLightRangeInverse[i];
-        float att = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0);
+        float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0);
         vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection[i]);
 
         // TODO: 


vec3 computeLighting(vec3 normalVector, vec3 lightDirection, vec3 lightColor, float attenuation)
{
    float diffuse = clamp(dot(normalVector, lightDirection), 0.0, 1.0);
    vec3 diffuseColor = lightColor * _baseColor.rgb * diffuse;

    #if defined(SPECULAR)

	// Blinn-Phong shading
    vec3 vertexToEye = normalize(v_cameraDirection); 
    vec3 halfDirection = normalize(lightDirection + v_cameraDirection);
    float specularAngle = max(dot(halfDirection, normalVector), 0.0);
    vec3 specularColor = vec3(pow(specularAngle, u_specularExponent));

    return (diffuseColor + specularColor) * attenuation;

    #else
    
        return diffuseColor * attenuation;
    
    #endif
}

        float spotCurrentAngleCos = dot(spotLightDirection, -vertexToSpotLightDirection);

		// Apply spot attenuation
        attenuation *= smoothstep(u_spotLightOuterAngleCos[i], u_spotLightInnerAngleCos[i], spotCurrentAngleCos);
        combinedColor += computeLighting(normalVector, vertexToSpotLightDirection, u_spotLightColor[i], attenuation);
    }
    #endif
    
