I've tested and optimized the shaders over the last couple of days, and while I could squeeze a few more fps out and was able to eliminate a few rendering artefacts, I fear it is now as fast as I can make it, and that means vertex count is the overall governing factor. I'll do a few more checks, then comment the code properly and release a version 1.1.
It's worth spending the framerate on this in my opinion - even if basically all other shaders have to be off. A feature gallery of how the weather system, the skydome, the terrain haze and the lightfield functions mesh together to create atmospheric light:
A panorama of the French Alps in broken cloud cover. Note how the clouds at the horizon blend into the haze layer, leaving the question somewhat open if there'd be more clouds or not coming.
With the terrain effect functionality of Local Weather, clouds tend to attach to mountaintops as convection seeds. This can make low flying through mountain passes a bit of a challenge. Here I'm crossing near the Massif de la Valoise towards Courchevel airport (LFLJ) - if you haven't seen that one, try it out (using the custom model by the Custom France scenery maintainers) - the runway is steeply inclined and looks a bit like a skijump.
Flying the Italian Alps near Bolzano with the P-51D on a bright clear summer day - lots of convection, this would also be an awsome day to go soaring. The P-51D is fun to fly low through valleys and canyons.
With the F-16 over the Italian Alps while the sun illuminates the broken cloud layer. Note the fine gradient of the light from left to right - this is what we spend a lot of GPU power to get right.
Flying alpine valleys with the F-16 - this picture illustrates nicely what the terrain haze is for and how it meshes with the weather system: It represents the moisture in the air which is usually present below the first cloud layer, but blocked by the inversion to get higher, so the view is much reduced below the cloud layer.
A 777ER on a morning departure from San Francisco enroute to Las Vegas (I know it's designed to fly longer routes, but I don't have the patience...) - note how the hills stick out of the morning haze in the background and how clouds and haze blend into the light gradient.
Stratocumulus fields and lots of haze as we descend into the Las Vegas area. Note how the summit of Mt. Charleston sticks above the haze, and also how far we can draw the cloud cover.
With the F-16 above Maui. This again illustrates perfectly the effect I wanted to achieve with the haze layer - but this time, the haze also has to inherit the correct light for this scene to work (it is *much* easier to render this at noon) - shade and low visibility beneath the cloud layer, clear sky above.
Pulling up to fly between two layers (I always like when I find a situation like this - seeing just cloudscape).
Hazy evening light over Grenoble - apparently the gliders are done for the day. Note how the light reduction by haze and cloud cover makes the light violet rather than red.
Diffuse haze over the French Alps. Notice the appearance of the haze layer top as blurred line - I am close to the boundary here, as I descend the line blurs more and more and eventually disappears.
Eerie evening light over the French Alps with strong fog in the valleys and a scattered cloud cover.
An F-16 pulling up into the cloud cover over the ocean. The rendering artefacts over ocean tiles are gone
Note the effect of the position-differential light which keeps the sea surface dark while illuminating the clouds, and how the light gradient changes in altitude. A lot of effort goes into making these things not noticed in the final scene - it's very easy to produce an unnatural appearance.