Bugfix correcting tree fog lighting for cloudy days and low sun
This commit is contained in:
parent
3a9ddfa5ab
commit
d13d72b2f7
2 changed files with 15 additions and 3 deletions
|
@ -32,6 +32,7 @@
|
||||||
<dust_cover_factor><use>/environment/surface/dust-cover-factor</use></dust_cover_factor>
|
<dust_cover_factor><use>/environment/surface/dust-cover-factor</use></dust_cover_factor>
|
||||||
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
|
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
|
||||||
<fogstructure><use>/environment/fog-structure</use></fogstructure>
|
<fogstructure><use>/environment/fog-structure</use></fogstructure>
|
||||||
|
<cloud_self_shading><use>/environment/cloud-self-shading</use></cloud_self_shading>
|
||||||
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
|
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
|
||||||
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
||||||
<wind_effects><use>/sim/rendering/shaders/wind-effects</use></wind_effects>
|
<wind_effects><use>/sim/rendering/shaders/wind-effects</use></wind_effects>
|
||||||
|
@ -104,6 +105,11 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value><use>ground_scattering</use></value>
|
<value><use>ground_scattering</use></value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>cloud_self_shading</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value><use>cloud_self_shading</use></value>
|
||||||
|
</uniform>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>terminator</name>
|
<name>terminator</name>
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
|
@ -246,6 +252,11 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value><use>ground_scattering</use></value>
|
<value><use>ground_scattering</use></value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>cloud_self_shading</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value><use>cloud_self_shading</use></value>
|
||||||
|
</uniform>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>terminator</name>
|
<name>terminator</name>
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
|
|
|
@ -15,6 +15,7 @@ varying float yprime_alt;
|
||||||
uniform float visibility;
|
uniform float visibility;
|
||||||
uniform float avisibility;
|
uniform float avisibility;
|
||||||
uniform float scattering;
|
uniform float scattering;
|
||||||
|
uniform float cloud_self_shading;
|
||||||
uniform float terminator;
|
uniform float terminator;
|
||||||
uniform float terrain_alt;
|
uniform float terrain_alt;
|
||||||
uniform float hazeLayerAltitude;
|
uniform float hazeLayerAltitude;
|
||||||
|
@ -131,7 +132,7 @@ void main()
|
||||||
mie_angle = gl_Color.a;
|
mie_angle = gl_Color.a;
|
||||||
vec4 texel = texture2D(texture, gl_TexCoord[0].st);
|
vec4 texel = texture2D(texture, gl_TexCoord[0].st);
|
||||||
|
|
||||||
|
float effective_scattering = min(scattering, cloud_self_shading);
|
||||||
|
|
||||||
if (quality_level > 3)
|
if (quality_level > 3)
|
||||||
{
|
{
|
||||||
|
@ -238,14 +239,14 @@ if (visibility < avisibility)
|
||||||
{
|
{
|
||||||
transmission_arg = transmission_arg + (distance_in_layer/visibility);
|
transmission_arg = transmission_arg + (distance_in_layer/visibility);
|
||||||
// this combines the Weber-Fechner intensity
|
// this combines the Weber-Fechner intensity
|
||||||
eqColorFactor = 1.0 - 0.1 * delta_zv/visibility - (1.0 -scattering);
|
eqColorFactor = 1.0 - 0.1 * delta_zv/visibility - (1.0 -effective_scattering);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
transmission_arg = transmission_arg + (distance_in_layer/avisibility);
|
transmission_arg = transmission_arg + (distance_in_layer/avisibility);
|
||||||
// this combines the Weber-Fechner intensity
|
// this combines the Weber-Fechner intensity
|
||||||
eqColorFactor = 1.0 - 0.1 * delta_zv/avisibility - (1.0 -scattering);
|
eqColorFactor = 1.0 - 0.1 * delta_zv/avisibility - (1.0 -effective_scattering);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue