1
0
Fork 0

Terrain haze bugfixes

This commit is contained in:
Flightgear Development 2012-06-11 11:46:13 +03:00 committed by Frederic Bouvier
parent 056612e663
commit 23536748f7
6 changed files with 21 additions and 27 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/rain-layer</name>
<name>Effects/cloud-static</name>
<parameters>
<texture n ="0">
</texture>

View file

@ -13,21 +13,15 @@
</material>
<material-id>0</material-id>
<!-- BEGIN fog include -->
<visibility>
<use>/environment/ground-visibility-m</use>
</visibility>
<avisibility>
<use>/environment/visibility-m</use>
</avisibility>
<lthickness>
<use>/environment/ground-haze-thickness-m</use>
</lthickness>
<scattering>
<use>/rendering/scene/scattering</use>
</scattering>
<terminator>
<use>/environment/terminator-relative-position-m</use>
</terminator>
<visibility><use>/environment/ground-visibility-m</use></visibility>
<avisibility><use>/environment/visibility-m</use></avisibility>
<lthickness><use>/environment/ground-haze-thickness-m</use></lthickness>
<scattering><use>/rendering/scene/scattering</use></scattering>
<ground_scattering><use>/environment/surface/scattering</use></ground_scattering>
<terminator><use>/environment/terminator-relative-position-m</use></terminator>
<terrain_alt><use>/environment/mean-terrain-elevation-m</use></terrain_alt>
<overcast><use>/rendering/scene/overcast</use></overcast>
<eye_alt><use>/sim/rendering/eye-altitude-m</use></eye_alt>
<fogtype>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>

View file

@ -17,7 +17,6 @@
<technique n="8">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/skydome</property>
<or>
<less-equal>

View file

@ -30,7 +30,7 @@
<!-- float, signed-integer, integer -->
<internal-format>normalized</internal-format>
</texture>
<texture n="6">
<texture n="10">
<image>Textures.high/Terrain/snow3.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
@ -160,12 +160,12 @@
</texture-unit>
<texture-unit>
<unit>6</unit>
<image><use>texture[6]/image</use></image>
<filter><use>texture[6]/filter</use></filter>
<wrap-s><use>texture[6]/wrap-s</use></wrap-s>
<wrap-t><use>texture[6]/wrap-t</use></wrap-t>
<image><use>texture[10]/image</use></image>
<filter><use>texture[10]/filter</use></filter>
<wrap-s><use>texture[10]/wrap-s</use></wrap-s>
<wrap-t><use>texture[10]/wrap-t</use></wrap-t>
<internal-format>
<use>texture[6]/internal-format</use>
<use>texture[10]/internal-format</use>
</internal-format>
</texture-unit>
<program>

View file

@ -231,7 +231,8 @@ hazeColor.r = light_func(lightArg, 8.305e-06, 0.161, 3.827, 3.04e-05, 1.0);
// now dim the light for haze
earthShade = 0.9 * smoothstep(terminator_width+ terminator, -terminator_width + terminator, yprime_alt) + 0.1;
float eShade = earthShade;
eShade = 0.9 * smoothstep(terminator_width+ terminator, -terminator_width + terminator, yprime_alt) + 0.1;
// Mie-like factor
@ -255,7 +256,7 @@ hazeColor.y = hazeColor.y * 0.9;
// additional blue in indirect light
float fade_out = max(0.65 - 0.3 *overcast, 0.45);
intensity = length(hazeColor);
hazeColor = intensity * normalize(mix(hazeColor, 1.5* vec3 (0.45, 0.6, 0.8), 1.0 -smoothstep(0.25, fade_out,earthShade) ));
hazeColor = intensity * normalize(mix(hazeColor, 1.5* vec3 (0.45, 0.6, 0.8), 1.0 -smoothstep(0.25, fade_out,eShade) ));
// change haze color to blue hue for strong fogging
//intensity = length(hazeColor);
@ -272,7 +273,7 @@ hazeColor = mix(shadow * hazeColor, hazeColor, 0.3 + 0.7* smoothstep(250000.0, 4
//fragColor.xyz = transmission * fragColor.xyz + (1.0-transmission) * eqColorFactor * hazeColor * earthShade;
fragColor.xyz = mix(eqColorFactor * hazeColor * earthShade, fragColor.xyz,transmission);
fragColor.xyz = mix(eqColorFactor * hazeColor * eShade, fragColor.xyz,transmission);
gl_FragColor = fragColor;

View file

@ -698,7 +698,7 @@
<layout>vbox</layout>
<checkbox>
<halign>left</halign>
<label>Skydome scattering</label>
<label>Atmospheric light scattering</label>
<name>skydome-scattering</name>
<property>/sim/rendering/shaders/skydome</property>
<binding>