1
0
Fork 0

AW uses detailed precipitation control, property rule adjusts precipitation illumination

This commit is contained in:
Thorsten Renk 2014-10-22 11:00:19 +03:00
parent 37faf4a9d0
commit 4e144a16bb
5 changed files with 115 additions and 4 deletions

View file

@ -429,7 +429,8 @@
<moonlight type="double" userarchive="n">0.0</moonlight>
<!-- config for noctilucent cloud generation -->
<create-noctilucent-clouds type="bool" userarchive="n">false</create-noctilucent-clouds>
<!-- definitions for the environment at surface interface -->
<!-- definitions for the environment at surface interface -->
<surface>
<scattering type="double" userarchive="n">0.7</scattering>
<dust-cover-factor type="double" userarchive="y">0.0</dust-cover-factor>
@ -437,4 +438,14 @@
<wetness type="double" userarchive="y">0.0</wetness>
<snow-thickness-factor type="double" userarchive="y">1.0</snow-thickness-factor>
</surface>
<!-- definitions for the detailed precipitation manager -->
<precipitation-control>
<rain-droplet-size type="float" userarchive="n">0.015</rain-droplet-size>
<snow-flake-size type="float" userarchive="n">0.03</snow-flake-size>
<detailed-precipitation type="bool" userarchive="n">false</detailed-precipitation>
<illumination type="float" userarchive="n">1.0</illumination>
<clip-distance type="float" userarchive="n">5.0</clip-distance>
</precipitation-control>
</PropertyList>

View file

@ -801,4 +801,37 @@
<output>/environment/tree-season</output>
</filter>
<filter>
<name>EnvironmentInterpolator:Precipitation:Illumination</name>
<type>gain</type>
<enable>
<condition>
<property>/environment/precipitation-control/detailed-precipitation</property>
</condition>
</enable>
<input>
<expression>
<sum>
<property>/rendering/scene/diffuse/red</property>
<value>0.3</value>
<product>
<property>/sim/rendering/als-secondary-lights/use-searchlight</property>
<value>0.3</value>
</product>
<product>
<property>/sim/rendering/als-secondary-lights/use-landing-light</property>
<value>0.3</value>
</product>
<product>
<property>/sim/rendering/als-secondary-lights/use-alt-landing-light</property>
<value>0.3</value>
</product>
</sum>
</expression>
</input>
<output>/environment/precipitation-control/illumination</output>
<min>0.0</min>
<max>1.0</max>
</filter>
</PropertyList>

View file

@ -170,9 +170,13 @@ setprop("/environment/clouds/layer[0]/elevation-ft",0.0);
# layer wrapping off
setprop("/sim/rendering/clouds3d-wrap",0);
# rain altitude limit off
# rain altitude limit off, detailed precipitation control on
props.globals.getNode("/environment/params/use-external-precipitation-level").setBoolValue("true");
props.globals.getNode("/environment/precipitation-control/detailed-precipitation").setBoolValue("true");
# set skydome unloading off
setprop("/sim/rendering/minimum-sky-visibility", 0.0);
@ -246,7 +250,7 @@ setprop("/environment/local-weather-lift-fps",lift);
}
####################################
# set rain to given value
# set rain properties
####################################
var setRain = func (rain) {
@ -254,8 +258,14 @@ var setRain = func (rain) {
setprop("/environment/rain-norm", rain);
}
var setRainDropletSize = func (size) {
setprop("/environment/precipitation-control/rain-droplet-size", size);
}
####################################
# set snow to given value
# set snow properties
####################################
var setSnow = func (snow) {
@ -263,6 +273,12 @@ var setSnow = func (snow) {
setprop("/environment/snow-norm", snow);
}
var setSnowFlakeSize = func (size) {
setprop("/environment/precipitation-control/snow-flake-size", size);
}
####################################
# set turbulence to given value

View file

@ -1746,6 +1746,10 @@ weather_tiles.rnd_store = rand();
setprop("/sim/rendering/clouds3d-wrap",1);
# hand precipitation control back to automatic
props.globals.getNode("/environment/precipitation-control/detailed-precipitation").setBoolValue("false");
# indicate that we are no longer running

View file

@ -2900,6 +2900,14 @@ else
x=-24000.0; y=-15000.0 +rand() *30000.0;
local_weather.create_streak("Nimbus",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt_eff,500.0,4,1310.0,0.0,1500.0,12,1310.0,0.2,500.0,alpha,1.0);
# rain droplet size for Nimbus clouds is medium
local_weather.setRainDropletSize(0.015 + rand() * 0.005);
# set the precipitation effect volumes
if (rain > 0.1)
{
local_weather.create_effect_volume(3, lat, lon, 20000.0, 20000.0, alpha, 0.0, alt+900.0, 500.0 + (1.0 - 0.5 * rain) * 5500.0, 0.5 * rain , -1, -1, -1,0 ,0.95);
@ -2937,6 +2945,13 @@ var create_8_8_stratus_rain = func (lat, lon, alt, alpha, rain) {
create_8_8_stratus(lat, lon, alt, alpha);
# rain droplet size for Stratus clouds is small
local_weather.setRainDropletSize(0.01 + rand() * 0.005);
# set the precipitation effect volumes
if (rain > 0.1)
{
local_weather.create_effect_volume(3, lat, lon, 20000.0, 20000.0, alpha, 0.0, alt, 500.0 + (1.0 - 0.5 * rain) * 5500.0, 0.5 * rain , -1, -1, -1,0 ,-1);
@ -2990,6 +3005,13 @@ var alt_cloud = alt;
if (local_weather.hardcoded_clouds_flag == 1) {alt_cloud = alt_cloud - 3000.0;}
# rain droplet size for Nimbus clouds is medium
local_weather.setRainDropletSize(0.017 + rand() * 0.007);
# set the precipitation effect volumes
for (var i = 0; i < 3; i = i + 1)
{
var x = 2.0 * (rand()-0.5) * 2000.0 + i * 12000.0 - 12000.0;
@ -2998,6 +3020,11 @@ for (var i = 0; i < 3; i = i + 1)
local_weather.create_layer("Nimbus", lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt_cloud, 500.0, 12000.0, 7000.0, beta, 1.0, 0.2, 1, 1.0);
if (rain > 0.1)
{
local_weather.create_effect_volume(2, lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), 10000.0, 6000.0, beta, 0.0, alt+900, 500.0 + (1.0-0.5*rain) * 5500.0, 0.5 * rain, -1, -1, -1,0,0.95 );
@ -3034,6 +3061,14 @@ var alt_cloud = alt;
if (local_weather.hardcoded_clouds_flag == 1) {alt_cloud = alt_cloud - local_weather.offset_map["Stratus"];}
# rain droplet size for Stratus clouds is small
local_weather.setRainDropletSize(0.01 + rand() * 0.005);
# set the precipitation effect volumes
for (var i = 0; i < 3; i = i + 1)
{
var x = 2.0 * (rand()-0.5) * 2000.0 + i * 12000.0 - 12000.0;
@ -4370,6 +4405,11 @@ local_weather.create_layer("Cumulonimbus (cloudlet)", lat, lon, alt_eff+3000.0,
# set the exclusion region for the Cumulus layer
append(elat, lat); append(elon, lon); append(erad, 4000.0 * scale * 1.2);
# rain droplet size for Cumulonimbus clouds is large
local_weather.setRainDropletSize(0.025 + rand() * 0.015);
# set the precipitation effect volumes
# set precipitation, visibility, updraft and turbulence in the cloud
local_weather.create_effect_volume(1, lat, lon, 4000.0 * 0.7 * scale, 4000.0 * 0.7 * scale , 0.0, 0.0, 20000.0, 1100.0, 0.8, -1, 0.6, 15.0,1 ,-1);
@ -4405,6 +4445,9 @@ local_weather.create_layer("Cumulonimbus (cloudlet)", lat, lon, alt_eff+10000, 1
# set the exclusion region for the Cumulus layer
append(elat, lat); append(elon, lon); append(erad, 6000.0 * scale * 1.2);
# rain droplet size for Cumulonimbus clouds is large
local_weather.setRainDropletSize(0.025 + rand() * 0.015);
# set precipitation, visibility, updraft and turbulence in the cloud
local_weather.create_effect_volume(1, lat, lon, 6000.0 * 0.7 * scale, 6000.0 * 0.7 * scale , 0.0, 0.0, 20000.0, 1100.0, 1.0, -1, 0.8, 20.0,1,-1 );
@ -4449,6 +4492,10 @@ local_weather.create_layer("Stratus (thin)", lat+get_lat(0,-4000,phi), lon+get_l
# set the exclusion region for the Cumulus layer
append(elat, lat); append(elon, lon); append(erad, 7500.0 * scale * 1.2);
# rain droplet size for Cumulonimbus clouds is large
local_weather.setRainDropletSize(0.025 + rand() * 0.015);
# create the precipitation effect volume
local_weather.create_effect_volume(1, lat, lon, 7500.0 * 0.7 * scale, 7500.0 * 0.7 * scale , 0.0, 0.0, 20000.0, 1100.0, 1.0, -1, 1.0, 25.0,1,-1 );
# set the wxradar echo