1
0
Fork 0

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.
This commit is contained in:
Stuart Buchanan 2012-08-09 22:52:51 +01:00
parent c71e0b92f1
commit 4ec24853a8
15 changed files with 331 additions and 309 deletions

View file

@ -91,7 +91,7 @@
<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>
<mysnow_level><use>/environment/mysnow-level-m</use></mysnow_level>
<snow_level><use>/environment/snow-level-m</use></snow_level>
<dust_cover_factor><use>/environment/surface/dust-cover-factor</use></dust_cover_factor>
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
<fogstructure><use>/environment/fog-structure</use></fogstructure>

View file

@ -66,7 +66,7 @@
<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>
<mysnow_level><use>/environment/mysnow-level-m</use></mysnow_level>
<snow_level><use>/environment/snow-level-m</use></snow_level>
<dust_cover_factor><use>/environment/surface/dust-cover-factor</use></dust_cover_factor>
<wetness><use>/environment/surface/wetness</use></wetness>
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
@ -252,9 +252,9 @@
<value><use>eye_alt</use></value>
</uniform>
<uniform>
<name>mysnowlevel</name>
<name>snowlevel</name>
<type>float</type>
<value><use>mysnow_level</use></value>
<value><use>snow_level</use></value>
</uniform>
<uniform>
<name>dust_cover_factor</name>

View file

@ -27,7 +27,7 @@
<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>
<mysnow_level><use>/environment/mysnow-level-m</use></mysnow_level>
<snow_level><use>/environment/snow-level-m</use></snow_level>
<dust_cover_factor><use>/environment/surface/dust-cover-factor</use></dust_cover_factor>
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
<fogstructure><use>/environment/fog-structure</use></fogstructure>

View file

@ -303,9 +303,9 @@
<value><use>eye_alt</use></value>
</uniform>
<uniform>
<name>mysnowlevel</name>
<name>snowlevel</name>
<type>float</type>
<value><use>mysnow_level</use></value>
<value><use>snow_level</use></value>
</uniform>
<uniform>
<name>dust_cover_factor</name>
@ -500,9 +500,9 @@
<value><use>eye_alt</use></value>
</uniform>
<uniform>
<name>mysnowlevel</name>
<name>snowlevel</name>
<type>float</type>
<value><use>mysnow_level</use></value>
<value><use>snow_level</use></value>
</uniform>
<uniform>
<name>dust_cover_factor</name>

View file

@ -297,6 +297,7 @@
<metar-max-age-min type="long">240</metar-max-age-min>
<metar-updates-environment type="bool">true</metar-updates-environment>
<metar-updates-winds-aloft type="bool">true</metar-updates-winds-aloft>
<metar-updates-snow-level type="bool" userarchive="y">true</metar-updates-snow-level>
<control-fdm-atmosphere type="bool">true</control-fdm-atmosphere>
<contrail-altitude type="double">30000</contrail-altitude>
<!-- definitions for the metar generated fog/mist/haze layer -->
@ -356,7 +357,6 @@
<ground-haze-thickness-m type="double" userarchive="n">2000.0</ground-haze-thickness-m>
<terminator-relative-position-m type="double" userarchive="n">1000000.0</terminator-relative-position-m>
<mean-terrain-elevation-m type="double" userarchive="n">0.0</mean-terrain-elevation-m>
<mysnow-level-m type="double" userarchive="y">3200.0</mysnow-level-m>
<fog-structure type="double" userarchive="y">0.0</fog-structure>
<!-- definitions for the environment at surface interface -->
<surface>

View file

@ -415,6 +415,12 @@
<name>MetarController:snow-level</name>
<type>gain</type>
<gain>1.0</gain>
<enable>
<condition>
<property>/environment/params/metar-updates-snow-level</property>
<property>/environment/params/metar-updates-environment</property>
</condition>
</enable>
<input>
<condition>
<property>/environment/metar/valid</property>

View file

@ -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));
}

View file

@ -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;

View file

@ -43,6 +43,7 @@
<!-- Environment menu -->
<environment>Environment</environment>
<global-weather>Weather</global-weather>
<environment-settings>Environment Settings</environment-settings>
<time-settings>Time Settings</time-settings>
<wildfire-settings>Wildfire Settings</wildfire-settings>
<terrasync>Scenery Download</terrasync>

View file

@ -0,0 +1,259 @@
<?xml version="1.0"?>
<PropertyList>
<name>environment-settings</name>
<modal>false</modal>
<resizable>false</resizable>
<layout>vbox</layout>
<default-padding>3</default-padding>
<!-- Title bar with close button -->
<group>
<layout>hbox</layout>
<default-padding>1</default-padding>
<empty>
<stretch>true</stretch>
</empty>
<text>
<label>Environmental Settings</label>
</text>
<empty>
<stretch>true</stretch>
</empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<border>2</border>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>table</layout>
<text>
<row>0</row>
<col>0</col>
<label>Ground textures:</label>
<halign>right</halign>
</text>
<combo>
<row>0</row>
<col>1</col>
<name>season</name>
<halign>left</halign>
<live>true</live>
<property>/sim/startup/season</property>
<value>summer</value>
<value>winter</value>
<binding>
<command>dialog-apply</command>
<object-name>season</object-name>
</binding>
</combo>
<button>
<row>0</row>
<col>2</col>
<legend>Reload Scenery</legend>
<binding>
<command>reinit</command>
<subsystem>tile-manager</subsystem>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>table</layout>
<text>
<row>0</row>
<col>0</col>
<colspan>4</colspan>
<halign>left</halign>
<label>Ground conditions (requires shaders effects)</label>
</text>
<checkbox>
<row>1</row>
<col>0</col>
<colspan>4</colspan>
<halign>left</halign>
<label>Set snow level from METAR</label>
<name>metar-snow</name>
<property>/environment/params/metar-updates-snow-level</property>
<binding>
<command>dialog-apply</command>
<object-name>metar-snow</object-name>
</binding>
</checkbox>
<text>
<label>Snow line</label>
<halign>left</halign>
<row>2</row>
<col>0</col>
</text>
<text>
<label>-425m</label>
<halign>right</halign>
<row>2</row>
<col>1</col>
</text>
<slider>
<name>snow-level</name>
<row>2</row>
<col>2</col>
<min>-425.0</min>
<max>7500.0</max>
<live>true</live>
<property>/environment/snow-level-m</property>
<binding>
<command>dialog-apply</command>
<object-name>snow-level</object-name>
</binding>
</slider>
<text>
<label>7500m</label>
<halign>left</halign>
<row>2</row>
<col>3</col>
</text>
<text>
<row>2</row>
<col>4</col>
<label>12345678</label>
<format>%.fm</format>
<live>true</live>
<property>/environment/snow-level-m</property>
</text>
<text>
<label>Dust cover</label>
<halign>left</halign>
<row>3</row>
<col>0</col>
</text>
<text>
<label>none</label>
<halign>right</halign>
<row>3</row>
<col>1</col>
</text>
<slider>
<name>dust-level</name>
<row>3</row>
<col>2</col>
<min>0.0</min>
<max>0.7</max>
<live>true</live>
<property>/environment/surface/dust-cover-factor</property>
<binding>
<command>dialog-apply</command>
<object-name>dust-level</object-name>
</binding>
</slider>
<text>
<label>dusty</label>
<halign>left</halign>
<row>3</row>
<col>3</col>
</text>
<text>
<label>Wetness</label>
<halign>left</halign>
<row>4</row>
<col>0</col>
</text>
<text>
<label>dry</label>
<halign>right</halign>
<row>4</row>
<col>1</col>
</text>
<slider>
<name>wetness</name>
<row>4</row>
<col>2</col>
<min>0.0</min>
<max>0.7</max>
<live>true</live>
<property>/environment/surface/wetness</property>
<binding>
<command>dialog-apply</command>
<object-name>wetness</object-name>
</binding>
</slider>
<text>
<label>wet</label>
<halign>left</halign>
<row>4</row>
<col>3</col>
</text>
</group>
<hrule/>
<group>
<empty>
<stretch>true</stretch>
</empty>
<layout>hbox</layout>
<button>
<legend>OK</legend>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<legend>Apply</legend>
<binding>
<command>dialog-apply</command>
</binding>
</button>
<button>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
<empty>
<stretch>true</stretch>
</empty>
</group>
</PropertyList>

View file

@ -1,189 +0,0 @@
<?xml version="1.0"?>
<PropertyList>
<name>local_weather_environment</name>
<width>400</width>
<height>210</height>
<modal>false</modal>
<text>
<x>5</x>
<y>180</y>
<label>Environment parameters (only used by detailed shaders)</label>
</text>
<text>
<x>5</x>
<y>150</y>
<label>Snow line:</label>
</text>
<text>
<x>120</x>
<y>150</y>
<label>0 m </label>
</text>
<slider>
<x>190</x>
<y>150</y>
<width>90</width>
<height>20</height>
<min>0.0</min>
<max>7500.0</max>
<property>/environment/mysnow-level-m</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<x>290</x>
<y>150</y>
<label>7500 m</label>
</text>
<text>
<x>340</x>
<y>150</y>
<label>12345678</label>
<format>%.fm</format>
<live>true</live>
<property>/environment/mysnow-level-m</property>
</text>
<text>
<x>5</x>
<y>120</y>
<label>Terrain dust cover:</label>
</text>
<text>
<x>120</x>
<y>120</y>
<label>none </label>
</text>
<slider>
<x>190</x>
<y>120</y>
<width>90</width>
<height>20</height>
<min>0.0</min>
<max>0.7</max>
<property>/environment/surface/dust-cover-factor</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<x>290</x>
<y>120</y>
<label>dusty</label>
</text>
<text>
<x>5</x>
<y>90</y>
<label>Fog properties:</label>
</text>
<text>
<x>120</x>
<y>90</y>
<label>smooth </label>
</text>
<slider>
<x>190</x>
<y>90</y>
<width>90</width>
<height>20</height>
<min>0.0</min>
<max>12.0</max>
<property>/environment/fog-structure</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<x>290</x>
<y>90</y>
<label>structured</label>
</text>
<text>
<x>5</x>
<y>60</y>
<label>Terrain wetness:</label>
</text>
<text>
<x>120</x>
<y>60</y>
<label>dry </label>
</text>
<slider>
<x>190</x>
<y>60</y>
<width>90</width>
<height>20</height>
<min>0.0</min>
<max>0.7</max>
<property>/environment/surface/wetness</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<x>290</x>
<y>60</y>
<label>wet</label>
</text>
<group>
<x>10</x>
<y>10</y>
<button>
<x>0</x>
<y>0</y>
<legend>OK</legend>
<!--<default>true</default>-->
<equal>true</equal>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<x>265</x>
<y>0</y>
<legend>Cancel</legend>
<equal>true</equal>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>

View file

@ -430,19 +430,51 @@
<row>3</row>
<col>0</col>
<halign>right</halign>
<label>Max. visibility</label>
<label>Fog properties</label>
</text>
<text>
<row>3</row>
<col>1</col>
<halign>right</halign>
<label>20 km</label>
<label>smooth</label>
</text>
<slider>
<row>3</row>
<col>2</col>
<min>0.0</min>
<max>12.0</max>
<property>/environment/fog-structure</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<row>3</row>
<col>3</col>
<halign>left</halign>
<label>structured</label>
</text>
<text>
<row>4</row>
<col>0</col>
<halign>right</halign>
<label>Max. visibility</label>
</text>
<text>
<row>4</row>
<col>1</col>
<halign>right</halign>
<label>20 km</label>
</text>
<slider>
<row>4</row>
<col>2</col>
<min>9.90348</min>
<max>12.429216196</max>
<property>/local-weather/config/aux-max-vis-range-m</property>
@ -452,14 +484,14 @@
</slider>
<text>
<row>3</row>
<row>4</row>
<col>3</col>
<halign>left</halign>
<label>250 km</label>
</text>
<text>
<row>3</row>
<row>4</row>
<col>4</col>
<halign>left</halign>
<label>12345678</label>
@ -579,17 +611,6 @@
</binding>
</button>
<button>
<legend>Advanced...</legend>
<binding>
<command>dialog-show</command>
<dialog-name>local_weather_environment</dialog-name>
</binding>
<binding>
<command>dialog-apply</command>
</binding>
</button>
<empty>
<stretch>true</stretch>
</empty>

View file

@ -207,31 +207,8 @@
<group>
<layout>table</layout>
<text>
<row>0</row>
<col>0</col>
<colspan>2</colspan>
<label>Season (ground textures): </label>
<halign>right</halign>
</text>
<combo>
<row>0</row>
<col>2</col>
<colspan>2</colspan>
<name>season</name>
<halign>left</halign>
<live>true</live>
<property>/sim/startup/season</property>
<value>summer</value>
<value>winter</value>
<binding>
<command>dialog-apply</command>
<object-name>season</object-name>
</binding>
</combo>
<checkbox>
<row>1</row>
<row>0</row>
<col>0</col>
<halign>left</halign>
<label>Animated jetways</label>
@ -244,7 +221,7 @@
</checkbox>
<checkbox>
<row>2</row>
<row>1</row>
<col>0</col>
<halign>left</halign>
<label>Random buildings</label>
@ -257,7 +234,7 @@
</checkbox>
<text>
<row>2</row>
<row>1</row>
<col>1</col>
<colspan>3</colspan>
<color>
@ -269,7 +246,7 @@
</text>
<checkbox>
<row>3</row>
<row>2</row>
<col>0</col>
<halign>left</halign>
<label>Random objects</label>
@ -282,7 +259,7 @@
</checkbox>
<checkbox>
<row>4</row>
<row>3</row>
<col>0</col>
<halign>left</halign>
<label>Random vegetation</label>
@ -294,7 +271,7 @@
</binding>
</checkbox>
<text>
<row>4</row>
<row>3</row>
<col>1</col>
<label>density</label>
<enable>
@ -302,7 +279,7 @@
</enable>
</text>
<slider>
<row>4</row>
<row>3</row>
<col>2</col>
<name>vegetation-density</name>
<min>0</min>
@ -315,7 +292,7 @@
</binding>
</slider>
<text>
<row>4</row>
<row>3</row>
<col>3</col>
<label>12345678</label>
<format>%.1f</format>

View file

@ -372,67 +372,6 @@
</binding>
</input>
<text>
<label>Snow line</label>
<row>2</row>
<col>0</col>
<enable>
<and>
<property>/sim/rendering/shaders/quality-level</property>
<or>
<property>/sim/rendering/shaders/crop</property>
<property>/sim/rendering/shaders/landmass</property>
<property>/sim/rendering/shaders/transition</property>
<property>/sim/rendering/shaders/urban</property>
</or>
</and>
</enable>
</text>
<slider>
<name>snow-level</name>
<row>2</row>
<col>1</col>
<enable>
<and>
<property>/sim/rendering/shaders/quality-level</property>
<or>
<property>/sim/rendering/shaders/crop</property>
<property>/sim/rendering/shaders/landmass</property>
<property>/sim/rendering/shaders/transition</property>
<property>/sim/rendering/shaders/urban</property>
</or>
</and>
</enable>
<min>-425.0</min>
<max>5000.0</max>
<live>true</live>
<property>/environment/snow-level-m</property>
<binding>
<command>dialog-apply</command>
<object-name>snow-level</object-name>
</binding>
</slider>
<text>
<row>2</row>
<col>2</col>
<enable>
<and>
<property>/sim/rendering/shaders/quality-level</property>
<or>
<property>/sim/rendering/shaders/crop</property>
<property>/sim/rendering/shaders/landmass</property>
<property>/sim/rendering/shaders/transition</property>
<property>/sim/rendering/shaders/urban</property>
</or>
</and>
</enable>
<label>12345678</label>
<format>%.fm</format>
<live>true</live>
<property>/environment/snow-level-m</property>
</text>
</group>

View file

@ -281,6 +281,14 @@
</binding>
</item>
<item>
<name>environment-settings</name>
<binding>
<command>dialog-show</command>
<dialog-name>environment-settings</dialog-name>
</binding>
</item>
<item>
<name>time-settings</name>
<binding>