         double offset      = 0.0;   // in Km
         double maxLength   = 0.0;   // in Km  
 
-<<<<<<< HEAD
-        for (int i = 0; i < nSamples; i++) {
-            // Color from G-Buffer
-            //vec4 color = texelFetch(mainColorTexture, fragCoords, i);
-            vec4 color = colorArray[i];
-=======
         bool  intersectATM = false;
 
         intersectATM = dAtmosphereIntersection(planetPositionObjectCoords.xyz, ray,  
                                                 Rt - (ATM_EPSILON * 0.001), insideATM, offset, maxLength);
->>>>>>> master
             
         if ( intersectATM ) {
             // Now we check is if the atmosphere is occluded, i.e., if the distance to the pixel 

    if (groundHit) {
        return finalScatteringRadiance;
    } else {
<<<<<<< HEAD
        // The final color is given by the attenuated light arriving at the observer's eye
        // plus the scattered light in the atmosphere (only inscattered light taken into account here)
        return attenuation * (spaceColor.rgb * backgroundConstant) + finalScatteringRadiance;
=======
        //return ((r-Rg) * invRtMinusRg)*spaceColor.rgb + finalScatteringRadiance;
        return attenuation * spaceColor.rgb + finalScatteringRadiance;
        // return attenuation * spaceColor.rgb +
        // (vec3(1.0) - attenuation) * finalScatteringRadiance;
>>>>>>> master
    }
    
}

/* 

                                                color, normal.xyz, irradianceFactor, 
                                                normal.a, sunIntensityGround);
                } else {
                    // In order to get better performance, we are not tracing
                    // multiple rays per pixel when the ray doesn't intersect
                    // the ground.
