             discard;
         }
         //renderTarget = vec4(1.0, 0.0, 0.0, 1.0);
-        
     }
 }
 

    if (groundHit) {
        return finalScatteringRadiance;
    } else {
        return ((r-Rg) * invRtMinusRg)*spaceColor.rgb * backgroundConstant + finalScatteringRadiance;
    }
    
}

        //float Rt2 = Rt * Rt; // in Km
        //float Rg2 = Rg * Rg; // in Km

        for (int i = 0; i < nSamples; i++) {
            // Color from G-Buffer
            //vec4 color = texelFetch(mainColorTexture, fragCoords, i);
