From 4c4044b15c9791f38f7ca909034e07a41f7811ab Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Mon, 21 Dec 2015 13:49:23 +0200 Subject: [PATCH] AW sets parameters for scattering phenomena --- Nasal/local_weather/local_weather.nas | 24 ++++++++++++++++++++++++ Nasal/local_weather/weather_tiles.nas | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Nasal/local_weather/local_weather.nas b/Nasal/local_weather/local_weather.nas index 6dfce61c9..f16b58118 100644 --- a/Nasal/local_weather/local_weather.nas +++ b/Nasal/local_weather/local_weather.nas @@ -792,6 +792,30 @@ compat_layer.setDewpoint(D); if (p>0.0) {compat_layer.setPressure(p);} +# determine whether low haze is icy and whether we see scattering + +var ice_hex_sheet = 0.0; +var ice_hex_column = 0.0; + +if (T < -5.0) + { + ice_hex_column = (-T - 5.0) /10.0; + ice_hex_sheet = (-T - 10.0 + (T-D)) /20.0; + + + var sheet_bias = (T-D)/ 20; + if (sheet_bias > 1.0) {sheet_bias = 1.0;} + ice_hex_column = ice_hex_column * sheet_bias; + + if (ice_hex_sheet > 1.0) {ice_hex_sheet = 1.0;} + if (ice_hex_column > 1.0) {ice_hex_column = 1.0;} + } + #print("Col: ",ice_hex_column); + #print("Sheet: ", ice_hex_sheet); + +setprop("/environment/scattering-phenomena/ice-hexagonal-column-factor", ice_hex_column); +setprop("/environment/scattering-phenomena/ice-hexagonal-sheet-factor", ice_hex_sheet); + # now determine the local wind diff --git a/Nasal/local_weather/weather_tiles.nas b/Nasal/local_weather/weather_tiles.nas index 9ff43d635..f409bb802 100644 --- a/Nasal/local_weather/weather_tiles.nas +++ b/Nasal/local_weather/weather_tiles.nas @@ -1701,7 +1701,7 @@ calc_geo(blat); var vis = 9000.0 + rand() * 10000.0; var T = 10.0 + rand() * 15.0; -var spread = 6.0 + 2.0 * rand(); +var spread = 8.0 + 4.0 * rand(); var D = T - spread; var p = 1000 + rand() * 10.0; p = adjust_p(p);