     // ============================
     // Estimating the gradient:
     // ============================
-    // Query the 4 remaining corners lumas.
-    float lumaDownLeft = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,-1)).rgb);
-    float lumaUpRight = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,1)).rgb);
-    float lumaUpLeft = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,1)).rgb);
-    float lumaDownRight = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,-1)).rgb);
-
-    // Combine the four edges lumas (using intermediary variables for future computations 
-    // with the same values).
-    float lumaDownUp = lumaDown + lumaUp;
-    float lumaLeftRight = lumaLeft + lumaRight;
-
-    // Same for corners
-    float lumaLeftCorners  = lumaDownLeft + lumaUpLeft;
-    float lumaDownCorners  = lumaDownLeft + lumaDownRight;
-    float lumaRightCorners = lumaDownRight + lumaUpRight;
-    float lumaUpCorners    = lumaUpRight + lumaUpLeft;
-
-    // Compute an estimation of the gradient along the horizontal and vertical axis.
-    float edgeHorizontal = abs(-2.0 * lumaLeft + lumaLeftCorners) + 
-        abs(-2.0 * lumaCenter + lumaDownUp ) * 2.0 + abs(-2.0 * lumaRight + lumaRightCorners);
-    float edgeVertical = abs(-2.0 * lumaUp + lumaUpCorners) + 
-        abs(-2.0 * lumaCenter + lumaLeftRight) * 2.0  + abs(-2.0 * lumaDown + lumaDownCorners);
-
-    // Is the local edge horizontal or vertical ?
+    float pixelLumDownLeft  = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,-1)).rgb);
+    float pixelLumUpRight   = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,1)).rgb);
+    float pixelLumUpLeft    = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,1)).rgb);
+    float pixelLumDownRight = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,-1)).rgb);
+
+    float pixelLumDownUp       = pixelLumDown + pixelLumUp;
+    float pixelLumLeftRight    = pixelLumLeft + pixelLumRight;
+    float pixelLumLeftCorners  = pixelLumDownLeft + pixelLumUpLeft;
+    float pixelLumDownCorners  = pixelLumDownLeft + pixelLumDownRight;
+    float pixelLumRightCorners = pixelLumDownRight + pixelLumUpRight;
+    float pixelLumUpCorners    = pixelLumUpRight + pixelLumUpLeft;
+
+    // Compute an estimation of the gradient
+    float edgeHorizontal = abs(-2.0 * pixelLumLeft + pixelLumLeftCorners) + 
+        abs(-2.0 * pixelLumCenter + pixelLumDownUp ) * 2.0 + abs(-2.0 * pixelLumRight + pixelLumRightCorners);
+    float edgeVertical = abs(-2.0 * pixelLumUp + pixelLumUpCorners) + 
+        abs(-2.0 * pixelLumCenter + pixelLumLeftRight) * 2.0  + abs(-2.0 * pixelLumDown + pixelLumDownCorners);
+
+    // ============================
+    // Choosing Edge Orientation:
+    // ============================
     bool isHorizontal = (edgeHorizontal >= edgeVertical);
-
-    // ============================
-    // Choosing Edge Orientation:
-    // ============================
-    // Select the two neighboring texels lumas in the opposite direction to the local edge.
-    float luma1 = isHorizontal ? lumaDown : lumaLeft;
-    float luma2 = isHorizontal ? lumaUp : lumaRight;
-    
-    // Compute gradients in this direction.
-    float gradient1 = luma1 - lumaCenter;
-    float gradient2 = luma2 - lumaCenter;
-
-    // Which direction is the steepest ?
+    float pixelLum1  = isHorizontal ? pixelLumDown : pixelLumLeft;
+    float pixelLum2  = isHorizontal ? pixelLumUp : pixelLumRight;
+    
+    // Gradients
+    float gradient1 = pixelLum1 - pixelLumCenter;
+    float gradient2 = pixelLum2 - pixelLumCenter;
+
     bool is1Steepest = abs(gradient1) >= abs(gradient2);
-
-    // Gradient in the corresponding direction, normalized.
     float gradientScaled = 0.25 * max(abs(gradient1), abs(gradient2));
 
-    // Choose the step size (one pixel) according to the edge direction.
+    // Step size (one pixel) according to the edge direction.
     float stepLength = isHorizontal ? inverseScreenSize.y : inverseScreenSize.x;
 
-    // Average luma in the correct direction.
-    float lumaLocalAverage = 0.0;
+    float pixelLumLocalAverage = 0.0;
 
     if (is1Steepest) {
-        // Switch the direction
         stepLength = - stepLength;
-        lumaLocalAverage = 0.5 * (luma1 + lumaCenter);
+        pixelLumLocalAverage = 0.5 * (pixelLum1 + pixelLumCenter);
     } else {
-        lumaLocalAverage = 0.5 * (luma2 + lumaCenter);
-    }
-
-    // Shift UV in the correct direction by half a pixel.
+        pixelLumLocalAverage = 0.5 * (pixelLum2 + pixelLumCenter);
+    }
+
     vec2 currentUv = texCoord;
     if (isHorizontal) {
         currentUv.y += stepLength * 0.5;

                uv2 += offset * QUALITY[i];
            }

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

    // ============================
    // Iterations:
    // ============================
    vec2 offset = isHorizontal ? vec2(inverseScreenSize.x, 0.0) : vec2(0.0, inverseScreenSize.y);
    
    vec2 uv1 = currentUv - offset;
    vec2 uv2 = currentUv + offset;

    // Read the pixelLums at both current extremities of the exploration segment, 
    // and compute the delta wrt to the local average pixelLum.
    float pixelLumEnd1 = getLum(texture(renderedTexture, uv1).rgb);
    float pixelLumEnd2 = getLum(texture(renderedTexture, uv2).rgb);
    pixelLumEnd1 -= pixelLumLocalAverage;
    pixelLumEnd2 -= pixelLumLocalAverage;

    bool reached1 = abs(pixelLumEnd1) >= gradientScaled;
    bool reached2 = abs(pixelLumEnd2) >= gradientScaled;
    bool reachedBoth = reached1 && reached2;

    if (!reached1) {
        uv1 -= offset;
    }
