Edit: The project page for this has been moved to the wiki: http://wiki.flightgear.org/Atmospheric_light_scattering
After staring at a couple of sunsets (a few weeks ago, I used to get nice ones driving home from work for free), I think I have figured out what makes the various colors when the sun is near the horizon: There's very little coming from the atmosphere itself, there's red coming from haze and brighter red from high-altitude clouds. Now, after teaching this to the skydome shader, we get quite plausible results dependent on the availability of clouds and haze.
Very clear air, little clouds brings a red band close to the horizon (where the path through the atmosphere is very long) and otherwise the almost undistorted atmospheric scattering:
A bit more haze in the air increases the band close to the horizon:
A lot of water vapour in the air places us inside a thick layer characterized by diffuse scattering - as a result the rosy color spreads over the whole sky.
With a bit less diffuse water vapour, but more pronounced clouds, also spectacular colorings can appear.
Finally, light shining underneath a layer in nearly overcast conditions gives a somewhat gloomy sunrise:
Now, it doesn't look quite as nice taking off at this point, and the reason is the color mismatch. Flightgear gives us the light for the current location (i.e. in the air, where the apparent sun position is already much above the horizon, but the same light is then used to color the terrain (which I correct for in the terrain shader) and the clouds (which I don't). If anyone has a bright idea how to manage clouds getting the light of 'their' altitude rather than the average light, that'd be really cool.
In principle, I think I can put altitude computations into the cloud shader, the problem is that I'd need the same light function which flightgear runs internally, and also that the cloud shaders are not too fast to start with... So, I haven't really worked that one out yet.
Edit: For anyone who wants to try - version 1.2
is the latest copy of the shaders with the sunset/sunrise code. This makes lightfield rendering switchable (by the skydome scattering shader selector) and ignores other shaders if running.
The package is running on 2.7, for anyone who has a 2.6 release version 1.0
should be working instead.
For best effect:
* skydome scattering shader -> on
* all other special shaders (water, urban, terrain, landmass, transition,...) -> off
* random vegetation -> off
* Advanced Weather -> on
(all other settings may or may not cause rendering artefacts).
For the time being (= till I get to fix this properly everywhere and make new packages), start with --prop:/sim/rendering/scattering-shader=true