     // Detecting where to apply AA:
     // ============================
 
-    // Luma at the current fragment
-    float lumaCenter = getLum(colorCenter.rgb);
-
-    // Luma at the four direct neighbours of the current fragment.
-    float lumaDown  = getLum(textureOffset(renderedTexture, texCoord, ivec2(0,-1)).rgb);
-    float lumaUp    = getLum(textureOffset(renderedTexture, texCoord, ivec2(0,1)).rgb);
-    float lumaLeft  = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,0)).rgb);
-    float lumaRight = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,0)).rgb);
-    
-    // Find the maximum and minimum luma around the current fragment.
-    float lumaMin = min(lumaCenter, min(min(lumaDown, lumaUp), min(lumaLeft, lumaRight)));
-    float lumaMax = max(lumaCenter, max(max(lumaDown, lumaUp), max(lumaLeft, lumaRight)));
-
-    // Compute the delta.
-    float lumaRange = lumaMax - lumaMin;
-
-    // If the luma variation is lower that a threshold (or if we are in a really dark area), 
+    float pixelLumCenter = getLum(colorCenter.rgb);
+    float pixelLumDown   = getLum(textureOffset(renderedTexture, texCoord, ivec2(0,-1)).rgb);
+    float pixelLumUp     = getLum(textureOffset(renderedTexture, texCoord, ivec2(0,1)).rgb);
+    float pixelLumLeft   = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,0)).rgb);
+    float pixelLumRight  = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,0)).rgb);
+    
+    float pixelLumMin = min(pixelLumCenter, min(min(pixelLumDown, pixelLumUp), min(pixelLumLeft, pixelLumRight)));
+    float pixelLumMax = max(pixelLumCenter, max(max(pixelLumDown, pixelLumUp), max(pixelLumLeft, pixelLumRight)));
+
+    // Delta.
+    float pixelLumRange = pixelLumMax - pixelLumMin;
+
+    // If the pixelLum variation is lower that a threshold (or if we are in a really dark area), 
     // we are not on an edge, don't perform any AA.
-    if (lumaRange < max(EDGE_THRESHOLD_MIN, lumaMax * EDGE_THRESHOLD_MAX)) {
+    if (pixelLumRange < max(EDGE_THRESHOLD_MIN, pixelLumMax * EDGE_THRESHOLD_MAX)) {
         aaFinalColor = colorCenter;
         return;
     }

                uv2 += offset * QUALITY[i];
            }

            // If both sides have been reached, stop the exploration.
            if (reachedBoth) { 
                break;
            }

        uv2 += offset;
    }   

    // Still exploring
    if (!reachedBoth) {
        for (int i = 2; i < ITERATIONS; i++) {
            // If needed, read pixelLum in 1st direction, compute delta.
            if (!reached1) {
                pixelLumEnd1 = getLum(texture(renderedTexture, uv1).rgb);
                pixelLumEnd1 = pixelLumEnd1 - pixelLumLocalAverage;
            }
            // If needed, read pixelLum in opposite direction, compute delta.
            if (!reached2) {
                pixelLumEnd2 = getLum(texture(renderedTexture, uv2).rgb);
                pixelLumEnd2 = pixelLumEnd2 - pixelLumLocalAverage;
            }
            reached1 = abs(pixelLumEnd1) >= gradientScaled;
            reached2 = abs(pixelLumEnd2) >= gradientScaled;
            reachedBoth = reached1 && reached2;

            // If the side is not reached
            if (!reached1) {
                uv1 -= offset * QUALITY[i];
            }
