• 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.

    Tags: flightgear

    1. tiger1962's Avatar
      tiger1962 -
      An absolutely stunning series of achievements, not only in flightsim development but in game engine development as a whole - the FlightGear team are becoming leaders and it's a joy to watch!
      We've always been told that cloud shadows cannot be done, I wonder what the FlightGear team will show the world next?
    1. Nels_Anderson's Avatar
      Nels_Anderson -
      I don't know about anyone else, but I found the details in this article fascinating. Who knew there was so much involved in displaying light properly? Reading this should make us appreciate all the work that goes into the simulators we use.
    1. Semjase's Avatar
      Semjase -
      I don't know but I tried flight gear and found it generally horrible in all aspects.
    1. RonaldVermeij's Avatar
      RonaldVermeij -
      Amazing result guys. Keep up the good work Flight Gear team.
      Show the world what can be accomplished by sharing passion, knowledge and good teamwork!
    1. zangg's Avatar
      zangg -
      Awesome! I`m delighted! My congratulations to Author! And Best Regards!
  • Recent Forum Activity


    Journeys up the Boot: Bari, Puglia

    Thread Starter: azzaro

    For all you non-Italians the city is Bari (baa ree) and the province is Puglia (poo lee a). Here endeth the lesson. Continuing on from last time I...

    Last Post By: ColR1948 Today, 11:07 AM Go to last post

    Avro Shacklton

    Thread Starter: ColR1948

    The Avro Shacklton, long range maritime patrol aircraft. developed from the Avro Lincoln bomber. Introduced in 1951 and retired in 1991. I found...

    Last Post By: ColR1948 Today, 11:03 AM Go to last post

    Article: Op-Ed: Let's Talk About Microsoft Flight Simulator

    Thread Starter: Nels_Anderson

    You can view the page at https://www.flightsim.com/vbfs/content.php?20028-Op-Ed-Let-s-Talk-About-Microsoft-Flight-Simulator

    Last Post By: loki Today, 10:35 AM Go to last post

    Avro-679 Manchester Bomber

    Thread Starter: ColR1948

    First flight was in 1939, it was under powered and deemed not reliable for the job and retired in 1942, later redesigned with 4 engines and became...

    Last Post By: peer01 Today, 10:24 AM Go to last post