Atmospheric light scattering: Difference between revisions

Jump to navigation Jump to search
Line 56: Line 56:


Perception effects require thus some amount of postprocessing in the shaders.
Perception effects require thus some amount of postprocessing in the shaders.
== Light scattering during the day ==
When the sun is high enough in the sky, the situation to render is as follows: Light penetrates the thin upper atmosphere, as it filters through, Rayleigh and some Mie scattering create the blue sky. Dependent on the model for the amount of high haze and water vapour to be specified by the weather system, this is handled by the skydome shader.
As the light reaches the first significant cloud layer, light intensity is much reduced. As clouds are drawn outside the terrain and skydome shading codes, this can not be explicitly computed by the shader, neither is it computationally feasible to compute the shadow cast by each cloudlet by ray tracing in real time. Thus, the relevant parameters (<b>rendering/scene/scattering</b> for the light intensity reduction at the position of the aircraft and <b>/environment/surface/scattering</b> for the light reduction on the ground) must be modelled by the weather system (which knows the cloud layer position) and passed to the shaders.
After passing through the cloud layer (usually the lowest layer beneath which the ground haze layer starts), the light is attenuated due to the diffuse scattering in the layer, which leads to additional intensity reduction by fog self-shading which can be computed in the shader.
This, however, is tricky, because fog does not really have a position, rather what the eye sees is the integrated effect of fog along a ray, and so the brightness of fog is really a weighted integral of fog brightness along the whole ray. This, however, can be approximated by taking the brightness at one attenuation length as a proxy (incidentially, this is the reason that two scattering parameters for the effect of clouds are passed - the light reduction at the aircraft position is a better proxy for fog shadowing due to clouds, the exact position-dependent light reduction can be used for the ground which has a definite position).
The altitude-dependent light reduction due to the clouds is the first instance of the <b>lightfield</b> technique, i.e. that the sunlight is represented as a series of functions r(x,y,z), g(x,y,z), b(x,y,z) in which the individual color channels are functions of vertex position in the scene.
1,360

edits

Navigation menu