Atmospheric light scattering: Difference between revisions

Jump to navigation Jump to search
Line 54: Line 54:


Thus, as the visibility increases from zero to infinity, the horizon first gets lighter until it reaches a brilliant white, then it darkens again.
Thus, as the visibility increases from zero to infinity, the horizon first gets lighter until it reaches a brilliant white, then it darkens again.
=== Visibility and fog function ===
In aviation weather, the visibility is defined as the distance out to which objects are still recognizable in fog or haze. In physics, the visibility is usually defined as one attenuation length of the light, i.e. the distance by which only the fraction of 1/e or about 36% of the original light is left. The two definitions are obviously not identical - it appears that about 2-3 attenuation lengths are needed to meet the criterion that distinct objects are no longer recognized (this also depends on other factors).
In reality, in a fog of constant density, the fraction of the original light (pixel color) left after a distance ''d'' is  exp[-''d''/λ] - this is exponential fogging. Since the visibility range is about 3λ, this implies for 3d rendering that the majority of scenery loaded will be more than 80% fogged and badly visible. Since this is very inefficient, the pure exponential fogging is not always used.
An alternative is quadratic exponential fogging, i.e. a function ~exp[-''d^2''/λ^2]. This leads to less fogging for ''d''<λ but much more fogging for ''d'>λ and thus the visible terrain is less fogged whereas the faraway terrain is rapidly becoming so strongly fogged that it doesn't need to be loaded - in essence it tends to makes terrain either visible or not.
A different strategy is exponential fading with a cutoff, i.e. a function ~exp[-''d''/λ - ''d^4''/λ^4] - this fogs with a physically correct attenuation within the visibility range but cuts off everything beyond that range rapidly to that it doesn't have to be loaded. The choice of fog function is hence a balance between fast rendering and realism.


== Basic atmosphere model elements ==
== Basic atmosphere model elements ==
1,360

edits

Navigation menu