From 4ec24853a86ebf7f6a8842b7fdf70fab32962197 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 9 Aug 2012 22:52:51 +0100 Subject: [PATCH] Create an Environment Settings dialog for non-weather environment settings such as snow level, dust, wetness, and texture set. Also add a parameter to control whether the snow level moves with METAR, and retire /environment/mysnow-level-m. --- Effects/building.eff | 2 +- Effects/terrain-default.eff | 6 +- Effects/tree.eff | 2 +- Effects/urban.eff | 8 +- Environment/environment.xml | 2 +- Environment/metarinterpolator.xml | 6 + Shaders/terrain-haze-detailed.frag | 4 +- Shaders/urban-lightfield.frag | 2 +- Translations/en/menu.xml | 1 + gui/dialogs/environment-settings.xml | 259 ++++++++++++++++++++++ gui/dialogs/local_weather_environment.xml | 189 ---------------- gui/dialogs/local_weather_tiles.xml | 51 +++-- gui/dialogs/rendering.xml | 39 +--- gui/dialogs/weather-configuration.xml | 61 ----- gui/menubar.xml | 8 + 15 files changed, 331 insertions(+), 309 deletions(-) create mode 100644 gui/dialogs/environment-settings.xml delete mode 100644 gui/dialogs/local_weather_environment.xml diff --git a/Effects/building.eff b/Effects/building.eff index 65a599a42..9edc822b2 100644 --- a/Effects/building.eff +++ b/Effects/building.eff @@ -91,7 +91,7 @@ /environment/mean-terrain-elevation-m /rendering/scene/overcast /sim/rendering/eye-altitude-m - /environment/mysnow-level-m + /environment/snow-level-m /environment/surface/dust-cover-factor /sim/rendering/shaders/skydome /environment/fog-structure diff --git a/Effects/terrain-default.eff b/Effects/terrain-default.eff index 42823e4f3..62c2a4f0a 100644 --- a/Effects/terrain-default.eff +++ b/Effects/terrain-default.eff @@ -66,7 +66,7 @@ /environment/mean-terrain-elevation-m /rendering/scene/overcast /sim/rendering/eye-altitude-m - /environment/mysnow-level-m + /environment/snow-level-m /environment/surface/dust-cover-factor /environment/surface/wetness /sim/rendering/shaders/skydome @@ -252,9 +252,9 @@ eye_alt - mysnowlevel + snowlevel float - mysnow_level + snow_level dust_cover_factor diff --git a/Effects/tree.eff b/Effects/tree.eff index a7c207983..80514ef9b 100644 --- a/Effects/tree.eff +++ b/Effects/tree.eff @@ -27,7 +27,7 @@ /environment/mean-terrain-elevation-m /rendering/scene/overcast /sim/rendering/eye-altitude-m - /environment/mysnow-level-m + /environment/snow-level-m /environment/surface/dust-cover-factor /sim/rendering/shaders/skydome /environment/fog-structure diff --git a/Effects/urban.eff b/Effects/urban.eff index f6a3130dd..168d5e702 100644 --- a/Effects/urban.eff +++ b/Effects/urban.eff @@ -303,9 +303,9 @@ eye_alt - mysnowlevel + snowlevel float - mysnow_level + snow_level dust_cover_factor @@ -500,9 +500,9 @@ eye_alt - mysnowlevel + snowlevel float - mysnow_level + snow_level dust_cover_factor diff --git a/Environment/environment.xml b/Environment/environment.xml index 9983f727d..6a8692b2b 100644 --- a/Environment/environment.xml +++ b/Environment/environment.xml @@ -297,6 +297,7 @@ 240 true true + true true 30000 @@ -356,7 +357,6 @@ 2000.0 1000000.0 0.0 - 3200.0 0.0 diff --git a/Environment/metarinterpolator.xml b/Environment/metarinterpolator.xml index 7499bd699..375eb7744 100644 --- a/Environment/metarinterpolator.xml +++ b/Environment/metarinterpolator.xml @@ -415,6 +415,12 @@ MetarController:snow-level gain 1.0 + + + /environment/params/metar-updates-snow-level + /environment/params/metar-updates-environment + + /environment/metar/valid diff --git a/Shaders/terrain-haze-detailed.frag b/Shaders/terrain-haze-detailed.frag index 2cb314665..4f7114d75 100644 --- a/Shaders/terrain-haze-detailed.frag +++ b/Shaders/terrain-haze-detailed.frag @@ -28,7 +28,7 @@ uniform float terrain_alt; uniform float hazeLayerAltitude; uniform float overcast; uniform float eye_alt; -uniform float mysnowlevel; +uniform float snowlevel; uniform float dust_cover_factor; uniform float wetness; uniform float fogstructure; @@ -262,7 +262,7 @@ void main() // mix snow snow_alpha = smoothstep(0.75, 0.85, abs(steepness)); - texel = mix(texel, snow_texel, smoothstep(mysnowlevel, mysnowlevel+200.0, snow_alpha * (relPos.z + eye_alt)+ (noise_2000m + 0.1 * noise_10m -0.55) *400.0)); + texel = mix(texel, snow_texel, smoothstep(snowlevel, snowlevel+200.0, snow_alpha * (relPos.z + eye_alt)+ (noise_2000m + 0.1 * noise_10m -0.55) *400.0)); } diff --git a/Shaders/urban-lightfield.frag b/Shaders/urban-lightfield.frag index 1bd947488..2980701b7 100644 --- a/Shaders/urban-lightfield.frag +++ b/Shaders/urban-lightfield.frag @@ -43,7 +43,7 @@ uniform float terrain_alt; uniform float hazeLayerAltitude; uniform float overcast; uniform float eye_alt; -uniform float mysnowlevel; +uniform float snowlevel; uniform float dust_cover_factor; uniform float wetness; uniform float fogstructure; diff --git a/Translations/en/menu.xml b/Translations/en/menu.xml index 8f797bb7d..61311cafe 100644 --- a/Translations/en/menu.xml +++ b/Translations/en/menu.xml @@ -43,6 +43,7 @@ Environment Weather + Environment Settings Time Settings Wildfire Settings Scenery Download diff --git a/gui/dialogs/environment-settings.xml b/gui/dialogs/environment-settings.xml new file mode 100644 index 000000000..bfbe35d7a --- /dev/null +++ b/gui/dialogs/environment-settings.xml @@ -0,0 +1,259 @@ + + + + environment-settings + false + false + vbox + 3 + + + + hbox + 1 + + + true + + + + + + + + true + + + + + + + + + table + + + 0 + 0 + + right + + + 0 + 1 + season + left + true + /sim/startup/season + summer + winter + + dialog-apply + season + + + + + + + + + + + + table + + + 0 + 0 + 4 + left + + + + + 1 + 0 + 4 + left + + metar-snow + /environment/params/metar-updates-snow-level + + dialog-apply + metar-snow + + + + + + left + 2 + 0 + + + + + right + 2 + 1 + + + + snow-level + 2 + 2 + -425.0 + 7500.0 + true + /environment/snow-level-m + + dialog-apply + snow-level + + + + + + left + 2 + 3 + + + + 2 + 4 + + %.fm + true + /environment/snow-level-m + + + + + left + 3 + 0 + + + + + right + 3 + 1 + + + + dust-level + 3 + 2 + 0.0 + 0.7 + true + /environment/surface/dust-cover-factor + + dialog-apply + dust-level + + + + + + left + 3 + 3 + + + + + left + 4 + 0 + + + + + right + 4 + 1 + + + + wetness + 4 + 2 + 0.0 + 0.7 + true + /environment/surface/wetness + + dialog-apply + wetness + + + + + + left + 4 + 3 + + + + + + + + + true + + hbox + + + + + + + + true + + + + diff --git a/gui/dialogs/local_weather_environment.xml b/gui/dialogs/local_weather_environment.xml deleted file mode 100644 index d6ca7bd28..000000000 --- a/gui/dialogs/local_weather_environment.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - local_weather_environment - 400 - 210 - false - - - 5 - 180 - - - - - - 5 - 150 - - - - - 120 - 150 - - - - - 190 - 150 - 90 - 20 - 0.0 - 7500.0 - /environment/mysnow-level-m - - dialog-apply - - - - - 290 - 150 - - - - - - 340 - 150 - - %.fm - true - /environment/mysnow-level-m - - - - - 5 - 120 - - - - - 120 - 120 - - - - - 190 - 120 - 90 - 20 - 0.0 - 0.7 - /environment/surface/dust-cover-factor - - dialog-apply - - - - - 290 - 120 - - - - - - 5 - 90 - - - - - 120 - 90 - - - - - 190 - 90 - 90 - 20 - 0.0 - 12.0 - /environment/fog-structure - - dialog-apply - - - - - 290 - 90 - - - - - - 5 - 60 - - - - - 120 - 60 - - - - - 190 - 60 - 90 - 20 - 0.0 - 0.7 - /environment/surface/wetness - - dialog-apply - - - - - 290 - 60 - - - - - - 10 - 10 - - - - - - - - - - diff --git a/gui/dialogs/local_weather_tiles.xml b/gui/dialogs/local_weather_tiles.xml index 2db727b86..dffb8c7b5 100644 --- a/gui/dialogs/local_weather_tiles.xml +++ b/gui/dialogs/local_weather_tiles.xml @@ -430,19 +430,51 @@ 3 0 right - + 3 1 right - + 3 2 + 0.0 + 12.0 + /environment/fog-structure + + dialog-apply + + + + + 3 + 3 + left + + + + + 4 + 0 + right + + + + + 4 + 1 + right + + + + + 4 + 2 9.90348 12.429216196 /local-weather/config/aux-max-vis-range-m @@ -452,14 +484,14 @@ - 3 + 4 3 left - 3 + 4 4 left @@ -579,17 +611,6 @@ - - true diff --git a/gui/dialogs/rendering.xml b/gui/dialogs/rendering.xml index 81ec277da..680758b62 100644 --- a/gui/dialogs/rendering.xml +++ b/gui/dialogs/rendering.xml @@ -207,31 +207,8 @@ table - - 0 - 0 - 2 - - right - - - 0 - 2 - 2 - season - left - true - /sim/startup/season - summer - winter - - dialog-apply - season - - - - 1 + 0 0 left @@ -244,7 +221,7 @@ - 2 + 1 0 left @@ -257,7 +234,7 @@ - 2 + 1 1 3 @@ -269,7 +246,7 @@ - 3 + 2 0 left @@ -282,7 +259,7 @@ - 4 + 3 0 left @@ -294,7 +271,7 @@ - 4 + 3 1 @@ -302,7 +279,7 @@ - 4 + 3 2 vegetation-density 0 @@ -315,7 +292,7 @@ - 4 + 3 3 %.1f diff --git a/gui/dialogs/weather-configuration.xml b/gui/dialogs/weather-configuration.xml index ca321c892..56e062391 100644 --- a/gui/dialogs/weather-configuration.xml +++ b/gui/dialogs/weather-configuration.xml @@ -372,67 +372,6 @@ - - - 2 - 0 - - - /sim/rendering/shaders/quality-level - - /sim/rendering/shaders/crop - /sim/rendering/shaders/landmass - /sim/rendering/shaders/transition - /sim/rendering/shaders/urban - - - - - - - snow-level - 2 - 1 - - - /sim/rendering/shaders/quality-level - - /sim/rendering/shaders/crop - /sim/rendering/shaders/landmass - /sim/rendering/shaders/transition - /sim/rendering/shaders/urban - - - - -425.0 - 5000.0 - true - /environment/snow-level-m - - dialog-apply - snow-level - - - - - 2 - 2 - - - /sim/rendering/shaders/quality-level - - /sim/rendering/shaders/crop - /sim/rendering/shaders/landmass - /sim/rendering/shaders/transition - /sim/rendering/shaders/urban - - - - - %.fm - true - /environment/snow-level-m - diff --git a/gui/menubar.xml b/gui/menubar.xml index f58ade722..912669d71 100644 --- a/gui/menubar.xml +++ b/gui/menubar.xml @@ -281,6 +281,14 @@ + + environment-settings + + dialog-show + environment-settings + + + time-settings