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"?> <?xml version="1.0" encoding="utf-8"?>
<PropertyList> <PropertyList>
<name>Effects/rain-layer</name> <name>Effects/cloud-static</name>
<parameters> <parameters>
<texture n ="0"> <texture n ="0">
</texture> </texture>

View file

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

View file

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

View file

@ -30,7 +30,7 @@
<!-- float, signed-integer, integer --> <!-- float, signed-integer, integer -->
<internal-format>normalized</internal-format> <internal-format>normalized</internal-format>
</texture> </texture>
<texture n="6"> <texture n="10">
<image>Textures.high/Terrain/snow3.dds</image> <image>Textures.high/Terrain/snow3.dds</image>
<filter>linear-mipmap-linear</filter> <filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s> <wrap-s>repeat</wrap-s>
@ -160,12 +160,12 @@
</texture-unit> </texture-unit>
<texture-unit> <texture-unit>
<unit>6</unit> <unit>6</unit>
<image><use>texture[6]/image</use></image> <image><use>texture[10]/image</use></image>
<filter><use>texture[6]/filter</use></filter> <filter><use>texture[10]/filter</use></filter>
<wrap-s><use>texture[6]/wrap-s</use></wrap-s> <wrap-s><use>texture[10]/wrap-s</use></wrap-s>
<wrap-t><use>texture[6]/wrap-t</use></wrap-t> <wrap-t><use>texture[10]/wrap-t</use></wrap-t>
<internal-format> <internal-format>
<use>texture[6]/internal-format</use> <use>texture[10]/internal-format</use>
</internal-format> </internal-format>
</texture-unit> </texture-unit>
<program> <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 // 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 // Mie-like factor
@ -255,7 +256,7 @@ hazeColor.y = hazeColor.y * 0.9;
// additional blue in indirect light // additional blue in indirect light
float fade_out = max(0.65 - 0.3 *overcast, 0.45); float fade_out = max(0.65 - 0.3 *overcast, 0.45);
intensity = length(hazeColor); 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 // change haze color to blue hue for strong fogging
//intensity = length(hazeColor); //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 = 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; gl_FragColor = fragColor;

View file

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