 	vec2 newUV = uv;
 	
 	// While the current layer is above the surface (ie smaller than depth), we march.
-	float currentLayerId = 0.0;
 	while (currentLayer < currentDepth) {
 		// We update the UV, going further away from the viewer.
 		newUV -= shiftUV;

	float finalDepth = mix(currentDepth, previousDepth, mixRatio);

	// Ouptut distance covered along the view direction.
	float finalDist = PARALLAX_SCALE * (currentLayerId - mixRatio) / (layersCount - 1.0); 
	shiftDistance = finalDist;
	return finalUV;
}


		currentDepth = texture(sampler2D(depth, sRepeatLinearLinear), newUV).r;
		// Update current layer.
		currentLayer += layerHeight;
	}
	
	// Perform interpolation between the current depth layer and the previous one to refine the UV shift.
