FlightGear's Atmospheric Light Scattering Rendering Framework

Many Hues of Light FlightGear's Atmospheric Light Scattering Rendering Framework By Thorsten Renk

The sky above us (while often taken for granted), is one the most beautiful sights visible to the human eye. Think of a perfect sunrise, a rainbow, or the subtle play of the Auroa Borealis and it is no wonder that it's 'what's above' which attracts many us into becoming real or virtual pilots. Yet, at the heart of almost all of this, is the wondrous phenomenon known as light scattering.

One of the three rendering engines FlightGear (FG) offers, excels in this area and is designed to capture the beauty of the sky - the Atmospheric Light Scattering (ALS) framework. It does this, not in an artistic way using pre-created textures, but rather by solving real-time approximations of the whole light scattering equations in the atmosphere.

Think of it like a generator, one which produces (depending on weather and atmospheric conditions) an infinite amount of lighting conditions.

The Main Phenomenas - Rayleigh And Mie Scattering

The richness of the sky's visuals comes mostly from the fact that there are numerous types of light scattering phenomena at play. Let us first consider Rayleigh scattering.

Rayleigh scattering only happens on small particles (smaller than the wavelength of light). The scattering has no preferred direction, but is wavelength dependent - blue light is affected more than red light. It is because of this (diffuse Rayleigh scattering) that the sky appears blue. Rayleigh scattering also happens on air molecules, which means that even in perfectly clear air at sea level, you cannot hope to see farther than 200-300 km before everything fades into Rayleigh blue.

The following example shows how the sky would look if there were only Rayleigh scattering:

The image above looks fairly familiar except for one thing; there's no bright halo around the sun. Such a halo is created by Mie scattering. This happens on larger particles (usually fluid droplets) which are comparable in size with the wavelength of light. As a result, the scattering is independent of color, but becomes more strongly directional (under small angles the effect is much stronger). As the example below shows, Mie scattering creates a characteristic halo around bright light sources, but (importantly) does not cause the sky to be blue.

Only when the two channels are combined do we finally see the familiar visuals of daylight:

Once these types of non-uniformities (scatterers) get so dense that multiple scatterings occur, the net result is described as diffuse scattering (shows neither directional nor wavelength dependence). The light under an overcast sky is a good example of diffuse scattering as the sunlight gradually 'trickles' through the clouds and most of the intensity is lost.

In addition to these main phenomenas, there's also a host of less known scattering processes with their own characteristics, some of which we will meet below.