         return false;
     }
 
-    double m2 = l2 - s*s;
+    float m2 = l2 - s*s;
 
     // Ray misses atmospere
     if (m2 > r2) {

    // We already now the ray hits the atmosphere

    // If q = 0.0f, there is only one intersection
    double q = sqrt(r2 - m2);

    // If l2 < r2, the ray origin is inside the sphere
    if (l2 > r2) {

                // when using their positions later, one must convert them to the planet's coords
                
                // Get data from G-Buffer
                vec4 normal   = texelFetch(mainNormalTexture, fragCoords, i);
                // Data in the mainPositionTexture are written in view space (view plus camera rig)
                vec4 position = texelFetch(mainPositionTexture, fragCoords, i);
               
                // OS Eye to World coords                
                dvec4 tmpRInvPos       = dInverseSGCTEyeToTmpRotTransformMatrix * position;
                dvec4 fragWorldCoords  = dvec4(dvec3(tmpRInvPos) + dCampos, 1.0);
                
                // World to Object (Normal and Position in meters)
                dvec4 fragObjectCoords = dInverseModelTransformMatrix * fragWorldCoords;
                
                // Distance of the pixel in the gBuffer to the observer
                // JCC (12/12/2017): AMD distance function is buggy.
