
For the past few days, I've been working on a Atmospheric Scattering shader to simulate the atmosphere in the Flight Simulator Project.
The previous model was based on a simple vertical interpolation between two colors, haze and atmosphere with a certain exponential component. This time, I wanted to try something new and actually simulate the difference in vertical space but also in the horizontal space, to see a difference between facing the sun and facing the penumbra at sunrise for example.
I won't go into too much details here, I'll probably write something about this algorithm later, but I think I can pretty much say that it's very simple and easy to understand. Almost everything happens at the pixel shader level using a couple of lerps and dot products here and there...
This model is capable of simulating different times of day, dense fog or light haze. The haze layer height can be adjusted, and setting the view point above the haze impacts how muchs blue sky is visible.
Right now, it only works in FX Composer 2, but the entry points and vertex format are exactly the same as the ones I use for my Common Shader, so it'll be easy to integrate it.