From a6ff6a6199f41e269e4d613750b74819f79a432b Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Mon, 17 Nov 2014 13:35:48 +0200 Subject: [PATCH] Undulatus-based AW clouds make use of transparency parameter --- .../cloud_placement_lowlevel.nas | 13 ++++++------ Nasal/local_weather/weather_tiles.nas | 20 ++++++++++++++++--- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Nasal/local_weather/cloud_placement_lowlevel.nas b/Nasal/local_weather/cloud_placement_lowlevel.nas index 4813be8fd..1c42859ec 100644 --- a/Nasal/local_weather/cloud_placement_lowlevel.nas +++ b/Nasal/local_weather/cloud_placement_lowlevel.nas @@ -119,7 +119,7 @@ for (i=0; i< max_num_streaks; i=i+1) y = y - arg.Dy + 2.0 * rand() * arg.Dy; var flag = 0; - var bias =1.0 - (1.0* math.abs(i-0.5 * max_num_streaks)/max_num_streaks + 1.0* math.abs(j-0.5 * aspect_num_clouds)/aspect_num_clouds); + var bias =1.0 - (math.abs(i-0.5 * max_num_streaks)/max_num_streaks + math.abs(j-0.5 * aspect_num_clouds)/aspect_num_clouds); var comp = -.25 * rnd_array[j] + 0.75 * bias; comp = comp + arg.size_bias; @@ -133,6 +133,9 @@ for (i=0; i< max_num_streaks; i=i+1) flag = 1; path = select_cloud_model(arg.type,"small") } + + var edge = math.pow(bias, arg.edge_power); + local_weather.alpha_factor = edge * arg.core_alpha + (1.0-edge) * arg.edge_alpha; var lat = arg.blat + m_to_lat * (y * math.cos(arg.dir) - x * math.sin(arg.dir)); var lon = arg.blon + m_to_lon * (x * math.cos(arg.dir) + y * math.sin(arg.dir)); @@ -145,7 +148,7 @@ for (i=0; i< max_num_streaks; i=i+1) } #print("Cloud count: ",counter); - + local_weather.alpha_factor = 1.0; } @@ -232,7 +235,7 @@ for (var j=0; j 0.9) { @@ -681,8 +681,10 @@ if (rn > 0.9) #y = 2.0 * (rand()-0.5) * 5000; #local_weather.create_streak("Altocumulus",blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 12000.0+alt+alt_offset,1500.0,30,1000.0,0.2,1200.0,30,1000.0,0.2,1200.0,alpha ,1.0); - #create_2_8_altocumulus_domains(blat, blon, alt+alt_offset +12000.0, alpha); -create_2_8_cirrocumulus_domains(blat, blon, alt+alt_offset +12000.0, alpha); + create_2_8_altocumulus_domains(blat, blon, alt+alt_offset +12000.0, alpha); + + + # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); @@ -3140,6 +3142,9 @@ arg.balt = alt; arg.alt_var = 0.0; arg.dir = alpha; arg.size_bias = 0.5; +arg.core_alpha = 0.8; +arg.edge_alpha = 0.0; +arg.edge_power = 1.0; arg.type = "Stratus (thin)"; local_weather.create_adv_undulatus(arg); @@ -3760,6 +3765,9 @@ arg.balt = alt; arg.alt_var = 0.0; arg.dir = alpha; arg.size_bias = 0.0; +arg.core_alpha = 1.0; +arg.edge_alpha = 0.0; +arg.edge_power = 2.0; arg.type = "Cirrostratus (small)"; local_weather.create_adv_undulatus(arg); @@ -3789,6 +3797,9 @@ arg.balt = alt; arg.alt_var = 0.0; arg.dir = alpha; arg.size_bias = 0.0; +arg.core_alpha = 1.0; +arg.edge_alpha = 0.0; +arg.edge_power = 2.0; arg.type = "Cirrocumulus (cloudlet)"; local_weather.create_adv_undulatus(arg); @@ -4118,6 +4129,9 @@ arg.balt = alt; arg.alt_var = 0.0; arg.dir = alpha; arg.size_bias = 0.0; +arg.core_alpha = 1.0; +arg.edge_alpha = 0.0; +arg.edge_power = 3.0; arg.type = "Cirrocumulus (new)"; #arg.type = "Fogpatch";