• 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

    5 Comments
    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

    Ralie25

    Getting an Object Placer to Work FSX Steam Edition

    Thread Starter: Ralie25

    Hi there, So I have tried countless times to get an object placer to work in my version of FSX. I use FSX Steam on the Steam app and neither...

    Last Post By: tiger1962 Today, 06:57 AM Go to last post
    il2crashesnfails

    My crashes and fails in Battle of stalingrad

    Thread Starter: il2crashesnfails

    I usually compile my crashes and explosions

    Last Post By: il2crashesnfails Today, 05:23 AM Go to last post
    CessnaFlyer

    Cpu fan failure???

    Thread Starter: CessnaFlyer

    I heard a loud pop come from my desktop computer last night. and then this morning I go to go flying and I got a CPU FAN FAILURE message. so does...

    Last Post By: CRJ_simpilot Today, 01:02 AM Go to last post
    Stans2Low

    Taking the bridge

    Thread Starter: Stans2Low

    The Bay Bridge fly-through: would be better at night with traffic turned on. Vincent Thomas Bridge fly-through: Looks cooler when you're inside...

    Last Post By: CRJ_simpilot Today, 12:46 AM Go to last post