To implement rayleigh scattering, I modelled my scene with unit in kms. My scene has three spheres (earth, atmosphere and sun)
with actual radius and inter-spatial distance. Here are the properties of three objects (based on actual figures):
Earth: Radius = 6378 kms. It has been modelled as a lambertian surface with low albedo (0.3) as actual data shows that earth has around 30 % reflectivity
Atmosphere: Radius = 60 kms
Sun: Radius = 695000 kms. Distance between earth and sun = 146000000 kms
Highlights of the implementation:
I assume that there can be 1 scattering event in 100 kms and calculate 'k' factor in rayleigh scattering accordingly.
I am doing 50-50 importance sampling between uniform scattering and distribution towards light (as adjoint photons are shot).