Realistic atmosphere trials

I'm having a really hard time setting the lighting fade in and out distances and the night fade in and out distances (with globe enableLighting = true) to values that produce the most physically accurate results when viewed from low altitudes, near sea level. We want to have accurate lighting during day, night and dusk conditions.

I have interpreted the distances to be meant as distances wrt the Camera. When I set lightingFadeInDistance to 0 and lightingFadeOutDistance to near infinity am I correct in assuming that lighting (with attenuation) should be applied from distance 0 from the camera to infinity?

So far I have only been able to create a very dark and grey looking earth surface while the sun is clearly visible in the sky which looks a little unrealistic. This is in winter time when the sun is not at its highest position in the sky. It seems the fog color is added to the ground color and the fog color goes to grey when going toward night time. Also with above mentioned values of lightingFadeInDistance = 0 and lightingFadeOutDistance = near infinity, the grey darkening of the fog/earth disappears when the camera gets below a few hundred metres above the surface. I might me interpreting the values wrong but if I'm not it might be a bug in the distance calculations.

Can someone please explain to me with respect to what the lighting fade in and out distances and the night fade in and out distances are calculated, what exact effect they are supposed to have and maybe give example values that produce a realistic result?

I'm running the build from branch master29324, but the effect is nearly identical in 1.50.

The distances are from the camera to the surface of the WGS84 ellipsoid. I can’t explain the values better than the documentation, so I’ll point you to where they are used in the shader:

Lighting fade in/out distances:

Night fade in/out distances:

For example, if you always want the night side of the earth to be completely dark, the value of sunlitAtmosphereIntensity should be 1.0. So, you can set nightFadeOutDistance to 0.0 and nightFadeInDistance to 1.0;

I hope that helps.