     float dist = length(eyeLightDir);
     // compute attenuation
     float attenuation = getLightAttenuation(dist, lightAttenuation);
-    if (attenuation != 0.0)
-        {
-            // compute direction
-            eyeLightDir = dist > 0.0 ? eyeLightDir / dist :  vec3( 0.0, 1.0, 0.0 );
-            if (lightCosSpotCutoff > 0.0)
-                {
-                    //compute lightSpotBlend
-                    vec3 lightSpotDirectionEye = normalize(mat3(vec3(lightInvMatrix[0]), vec3(lightInvMatrix[1]), vec3(lightInvMatrix[2]))*lightSpotDirection);
-
-                    float cosCurAngle = dot(-eyeLightDir, lightSpotDirectionEye);
-                    float diffAngle = cosCurAngle - lightCosSpotCutoff;
-                    float spot = 1.0;
-                    if ( diffAngle < 0.0 ) {
-                        spot = 0.0;
-                    } else {
-                        if ( lightSpotBlend > 0.0 )
-                            spot = cosCurAngle * smoothstep(0.0, 1.0, (cosCurAngle - lightCosSpotCutoff) / (lightSpotBlend));
-                    }
-
-                    if (spot > 0.0)
-                        {
-                            // compute NdL
-                            NdotL = dot(eyeLightDir, normal);
-                            if (NdotL > 0.0)
-                                {
-                                    lighted = true;
-                                    vec3 diffuseContrib;
-                                    lambert(NdotL, materialDiffuse, lightDiffuse, diffuseContrib);
-                                    vec3 specularContrib;
-                                    specularCookTorrance(normal, eyeLightDir, eyeVector, materialShininess, materialSpecular, lightSpecular, specularContrib);
-                                    return spot * attenuation * (diffuseContrib + specularContrib);
-                                }
-                        }
+    if (attenuation != 0.0) {
+        // compute direction
+        eyeLightDir = dist > 0.0 ? eyeLightDir / dist :  vec3( 0.0, 1.0, 0.0 );
+        if (lightCosSpotCutoff > 0.0) {
+            //compute lightSpotBlend
+            vec3 lightSpotDirectionEye = normalize(mat3(vec3(lightInvMatrix[0]), vec3(lightInvMatrix[1]), vec3(lightInvMatrix[2]))*lightSpotDirection);
+
+            float cosCurAngle = dot(-eyeLightDir, lightSpotDirectionEye);
+            float diffAngle = cosCurAngle - lightCosSpotCutoff;
+            float spot = 1.0;
+            if ( diffAngle < 0.0 ) {
+                spot = 0.0;
+            } else {
+                if ( lightSpotBlend > 0.0 )
+                    spot = cosCurAngle * smoothstep(0.0, 1.0, (cosCurAngle - lightCosSpotCutoff) / (lightSpotBlend));
+            }
+
+            if (spot > 0.0) {
+                // compute NdL
+                NdotL = dot(eyeLightDir, normal);
+                if (NdotL > 0.0) {
+                    lighted = true;
+                    vec3 diffuseContrib;
+                    lambert(NdotL, materialDiffuse, lightDiffuse, diffuseContrib);
+                    vec3 specularContrib;
+                    specularCookTorrance(normal, eyeLightDir, eyeVector, materialShininess, materialSpecular, lightSpecular, specularContrib);
+                    return spot * attenuation * (diffuseContrib + specularContrib);
                 }
+            }
         }
+    }
     return vec3(0.0);
 }
 
 vec3 computePointLightShading(
-                              const in vec3 normal,
-                              const in vec3 eyeVector,
-
-                              const in vec3 materialAmbient,
-                              const in vec3 materialDiffuse,
-                              const in vec3 materialSpecular,
-                              const in float materialShininess,
-
-                              const in vec3 lightAmbient,
-                              const in vec3 lightDiffuse,
-                              const in vec3 lightSpecular,
-
-                              const in vec4 lightPosition,
-                              const in vec4 lightAttenuation,
-
-                              const in mat4 lightMatrix,
-
-                              out vec3 eyeLightPos,
-                              out vec3 eyeLightDir,
-                              out float NdotL,
-                              out bool lighted)
-{
+    const in vec3 normal,
+    const in vec3 eyeVector,
+
+    const in vec3 materialAmbient,
+    const in vec3 materialDiffuse,
+    const in vec3 materialSpecular,
+    const in float materialShininess,
+
+    const in vec3 lightAmbient,
+    const in vec3 lightDiffuse,
+    const in vec3 lightSpecular,
+
+    const in vec4 lightPosition,
+    const in vec4 lightAttenuation,
+
+    const in mat4 lightMatrix,
+
+    out vec3 eyeLightPos,
+    out vec3 eyeLightDir,
+    out float NdotL,
+    out bool lighted) {
 
     eyeLightPos =  vec3(lightMatrix * lightPosition);
     eyeLightDir = eyeLightPos - vViewVertex.xyz;

////////////////
// ATTENUATION
/////////////
float getLightAttenuation(const in float dist, const in vec4 lightAttenuation)
{
    // lightAttenuation(constantEnabled, linearEnabled, quadraticEnabled)
    // TODO find a vector alu instead of 4 scalar
    float constant = lightAttenuation.x;


    out vec3 eyeLightDir,
    out float NdotL,
    out bool lighted) {
    lighted = false;

    eyeLightDir = normalize( vec3(lightMatrix * lightPosition ) );
