1
0
Fork 0

AW drives diurnal terrain temperature differences

This commit is contained in:
Thorsten Renk 2016-04-08 10:49:55 +03:00
parent 552a2a9393
commit 5134fa2a61
3 changed files with 57 additions and 36 deletions

View file

@ -254,41 +254,41 @@
<type>float</type> <type>float</type>
<value><use>gamma</use></value> <value><use>gamma</use></value>
</uniform> </uniform>
<uniform> <uniform>
<name>brightness</name> <name>brightness</name>
<type>float</type> <type>float</type>
<value><use>brightness</use></value> <value><use>brightness</use></value>
</uniform> </uniform>
<uniform> <uniform>
<name>use_filtering</name> <name>use_filtering</name>
<type>bool</type> <type>bool</type>
<value><use>use_filtering</use></value> <value><use>use_filtering</use></value>
</uniform> </uniform>
<uniform> <uniform>
<name>use_night_vision</name> <name>use_night_vision</name>
<type>bool</type> <type>bool</type>
<value><use>use_night_vision</use></value> <value><use>use_night_vision</use></value>
</uniform> </uniform>
<uniform> <uniform>
<name>use_IR_vision</name> <name>use_IR_vision</name>
<type>bool</type> <type>bool</type>
<value><use>use_IR_vision</use></value> <value><use>use_IR_vision</use></value>
</uniform> </uniform>
<uniform> <uniform>
<name>delta_T</name> <name>delta_T</name>
<type>float</type> <type>float</type>
<value><use>delta_T</use></value> <value><use>delta_T</use></value>
</uniform> </uniform>
<uniform> <uniform>
<name>display_xsize</name> <name>display_xsize</name>
<type>int</type> <type>int</type>
<value><use>display_xsize</use></value> <value><use>display_xsize</use></value>
</uniform> </uniform>
<uniform> <uniform>
<name>display_ysize</name> <name>display_ysize</name>
<type>int</type> <type>int</type>
<value><use>display_ysize</use></value> <value><use>display_ysize</use></value>
</uniform> </uniform>
<!-- END fog include --> <!-- END fog include -->
</pass> </pass>
</technique> </technique>

View file

@ -82,6 +82,7 @@
<fogstructure><use>/environment/fog-structure</use></fogstructure> <fogstructure><use>/environment/fog-structure</use></fogstructure>
<cloud_self_shading><use>/environment/cloud-self-shading</use></cloud_self_shading> <cloud_self_shading><use>/environment/cloud-self-shading</use></cloud_self_shading>
<moonlight><use>/environment/moonlight</use></moonlight> <moonlight><use>/environment/moonlight</use></moonlight>
<delta_T><use>/environment/surface/delta-T-rock</use></delta_T>
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level> <quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level> <tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
<raise_vertex type="bool">false</raise_vertex> <raise_vertex type="bool">false</raise_vertex>

View file

@ -715,6 +715,27 @@ else
{var ovcst = 0.0;} {var ovcst = 0.0;}
# compute heating and cooling of various terrain and object types
var time = getprop("sim/time/utc/day-seconds");
time = time + getprop("sim/time/local-offset");
# low thermal inertia follows the Sun more or less directly
# high thermal inertia takes some time to reach full heat
var t_factor1 = 0.5 * (1.0-math.cos((time * sec_to_rad)));
var t_factor2 = 0.5 * (1.0-math.cos((time * sec_to_rad)-0.4));
var t_factor3 = 0.5 * (1.0-math.cos((time * sec_to_rad)-0.9));
var amp = scatt_max;
setprop("/environment/surface/delta-T-soil", amp * (-5.0 + 10.0 * t_factor2));
setprop("/environment/surface/delta-T-vegetation", amp * (-5.0 + 10.0 * t_factor1));
setprop("/environment/surface/delta-T-rock", amp * (-7.0 + 14.0 * t_factor1));
setprop("/environment/surface/delta-T-water", amp * (-1.0 + 2.0* t_factor3));
setprop("/environment/surface/delta-T-structure", amp * 10.0* t_factor1);
setprop("/environment/surface/delta-T-cloud", amp * (-2.0 + 2.0* t_factor3));
# compute base turbulence # compute base turbulence
var base_turbulence = 0.0; var base_turbulence = 0.0;
@ -2282,7 +2303,6 @@ var detail_flag = detailed_clouds_flag;
alpha = alpha * math.pi/180.0; # the tile orientation alpha = alpha * math.pi/180.0; # the tile orientation
#var sec_to_rad = 2.0 * math.pi/86400; # conversion factor for sinusoidal dependence on daytime
# current aircraft position # current aircraft position