FlightGear Newsletter January 2012: Difference between revisions

Jump to navigation Jump to search
Line 19: Line 19:


Read on at [[Bounty (Overview)]].
Read on at [[Bounty (Overview)]].
== Lightfield shaders ==
As part of the ongoing efforts to make the skydome scattering shader blend seamlessly into the terrain under all conditions, substantial work on getting sunrise and sunset conditions right has been done.
The eventual solution to the problems are lightfield shaders - the shader doesn not assume a single light source for the whole scene, but computes the incident light intensity and hue for each point of the scene dependent on position and altitude. This turns out particularly tricky for the fog, as the visible fog color is really a line integral along points with very different lighting - which is too slow to do real-time, so a good approximation scheme has to be used. The development effort for the lightfield shaders is easily 5 times the effort for the original terrain haze shader which handles everything during daytime - which illustrates a bit how complex problems sunrises are.
The shaders handle a variety of conditions and generate spectacular scenes, from the first glow of the predawn sky, via high altitude clouds lighting up before the terrain to full daylight.
{|
|[[File:Lightfield_shader12.jpg|200px|thumb|Predawn sky light]]
|[[File:Lightfield_shader02.jpg|200px|thumb|Takeoff in predawn light]]
|[[File:Lightfield_shader05.jpg|200px|thumb|High altitude cloud glow]]
|}
Among other things, the lightfield allows mountain summits and high altitude clouds to be illuminated by morning light before the lower terrain lights up. The scene is rendered faithfully from ground level up to low Earth orbit where the terminator line becomes visible, distorted by the terrain elevation pattern. As an example, here's the Alaska range from 24.000 ft and from 240.000 ft:
{|
|[[File:Lightfield_shader01.jpg|200px|thumb|Alaska range from 24.000 ft]]
|[[File:Lightfield_shader04.jpg|200px|thumb|Alaska range from 240.000 ft]]
|}
The action of the shaders interfaces with the environment conditions. For instance, high altitude haze makes the indirect ground light more red than blue since it causes substantial backscatter to the ground.
{|
|[[File:Lightfield_shader06.jpg|200px|thumb|Sunrise without high altitude haze]]
|[[File:Lightfield_shader03.jpg|200px|thumb|Sunrise with high altitude haze]]
|}
Cloud cover blocks the incident direct light on the haze layer and cause a change in hue of the haze illumination. The Local Weather system provides the necessary interface information - for instance at the egde of a cloud layer, direct light can reach underneath the layer and illuminate the haze, causing a change in the shader response. Also, the self-shading of the haze layer leads to a different haze hue on the ground and at higher altitude.
{|
|[[File:Lightfield_shader07.jpg|200px|thumb|Sunrise in moderate cloud cover]]
|[[File:Lightfield_shader10.jpg|200px|thumb|Sunrise in thick Stratus cloud cover]]
|[[File:Lightfield_shader11.jpg|200px|thumb|Sunrise in strong cloud cover at layer edge]]
|}
For low sun, additional shading of the terrain occurs - this is not shading of the terrain itself (which would be reasonably easy to approximate) but shading of the haze by the terrain. This effect goes away when the light attenuation in the fog is too strong:
{|
|[[File:Lightfield_shader08.jpg|200px|thumb|Haze shading for high visibility]]
|[[File:Lightfield_shader09.jpg|200px|thumb|Haze shading for low visibility]]
|}
All these effects do not currently mesh with other shaders. While eventually an integration with other projects is discussed, the lightfield shader code will hopefully make its appearance on GIT soon as an optional feature.
As a preview, here's what may come next - a mode detailed light attenuation model in which the darker hue of the fog beneath clouds is really prominent.
[[File:Lightfield_shader_next.jpg|200px|thumb|left|More detailed attenuation model]]


== Interview with a contributor (Durk Talsma) ==
== Interview with a contributor (Durk Talsma) ==
1,360

edits

Navigation menu