diff --git a/Environment/environment.xml b/Environment/environment.xml
index ec2eae7b5..f540cb9f8 100644
--- a/Environment/environment.xml
+++ b/Environment/environment.xml
@@ -429,7 +429,8 @@
0.0
false
-
+
+
0.7
0.0
@@ -437,4 +438,14 @@
0.0
1.0
+
+
+
+ 0.015
+ 0.03
+ false
+ 1.0
+ 5.0
+
+
diff --git a/Environment/local-weather-rules.xml b/Environment/local-weather-rules.xml
index 92a4fed77..810dbe58a 100644
--- a/Environment/local-weather-rules.xml
+++ b/Environment/local-weather-rules.xml
@@ -801,4 +801,37 @@
+
+
+ EnvironmentInterpolator:Precipitation:Illumination
+ gain
+
+
+ /environment/precipitation-control/detailed-precipitation
+
+
+
+
+
+ /rendering/scene/diffuse/red
+ 0.3
+
+ /sim/rendering/als-secondary-lights/use-searchlight
+ 0.3
+
+
+ /sim/rendering/als-secondary-lights/use-landing-light
+ 0.3
+
+
+ /sim/rendering/als-secondary-lights/use-alt-landing-light
+ 0.3
+
+
+
+
+
+ 0.0
+ 1.0
+
diff --git a/Nasal/local_weather/compat_layer.nas b/Nasal/local_weather/compat_layer.nas
index 655d0da6c..bcd4f98f6 100644
--- a/Nasal/local_weather/compat_layer.nas
+++ b/Nasal/local_weather/compat_layer.nas
@@ -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
diff --git a/Nasal/local_weather/local_weather.nas b/Nasal/local_weather/local_weather.nas
index 3aa3e51ac..b95aac1af 100644
--- a/Nasal/local_weather/local_weather.nas
+++ b/Nasal/local_weather/local_weather.nas
@@ -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
diff --git a/Nasal/local_weather/weather_tiles.nas b/Nasal/local_weather/weather_tiles.nas
index 97ed28037..d7af88004 100644
--- a/Nasal/local_weather/weather_tiles.nas
+++ b/Nasal/local_weather/weather_tiles.nas
@@ -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