Cancel specular highlights due to sun at night
[fg:toms-fgdata.git] / Environment / interpolator.xml
1 <?xml version="1.0" ?>
2 <!--
3  This file is part of FlightGear, the free flight simulator
4  http://www.flightgear.org/
5
6  Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de
7
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  General Public License for more details.
17 -->
18 <!--
19   Interpolate the values of /environment/interpolated/* over time
20   and write the results to /environment/*, the environment of our
21   aircraft
22   All filters are enabled on /environment/config/enabled=true
23 -->
24 <PropertyList>
25
26   <filter>
27     <name>EnvironmentInterpolator:temperature-sea-level-degc</name>
28     <enable>
29       <property>/environment/config/enabled</property>
30     </enable>
31     <input>/environment/config/interpolated/temperature-sea-level-degc</input>
32     <output>/environment/temperature-sea-level-degc</output>
33     <type>noise-spike</type>
34     <max-rate-of-change>0.1667</max-rate-of-change>
35   </filter>
36
37   <filter>
38     <name>EnvironmentInterpolator:dewpoint-sea-level-degc</name>
39     <enable>
40       <property>/environment/config/enabled</property>
41     </enable>
42     <input>/environment/config/interpolated/dewpoint-sea-level-degc</input>
43     <output>/environment/dewpoint-sea-level-degc</output>
44     <type>noise-spike</type>
45     <max-rate-of-change>0.1667</max-rate-of-change>
46   </filter>
47
48   <filter>
49     <!--
50       transfer the interpolated QNH to the global environment
51       limit the rate of change to approx 1hpa/sec
52     -->
53     <name>EnvironmentInterpolator:pressure-sea-level-inhg</name>
54     <type>noise-spike</type>
55     <max-rate-of-change>0.03</max-rate-of-change>
56     <enable>
57       <property>/environment/config/enabled</property>
58     </enable>
59     <input>/environment/config/interpolated/pressure-sea-level-inhg</input>
60     <output>/environment/pressure-sea-level-inhg</output>
61   </filter>
62
63   <filter>
64     <name>EnvironmentInterpolator:visibility-m</name>
65     <enable>
66       <property>/environment/config/enabled</property>
67     </enable>
68     <input>
69       <condition>
70         <property>/environment/config/presets/visibility-m-override</property>
71       </condition>
72       <property>/environment/config/presets/visibility-m</property>
73     </input>
74     <input>/environment/config/interpolated/visibility-m</input>
75     <output>/environment/visibility-m</output>
76     <type>exponential</type>
77     <filter-time>2</filter-time>
78   </filter>
79
80   <!-- 
81     filter the wind vector by filtering the cartesian representation
82   -->
83   <filter>
84     <name>EnvironmentInterpolator:wind-from-north</name>
85     <enable>
86       <property>/environment/config/enabled</property>
87     </enable>
88     <input>
89       <condition>
90         <property>/environment/config/presets/wind-override</property>
91       </condition>
92       <property>/environment/config/presets/wind-from-north-fps</property>
93     </input>
94     <input>/environment/config/interpolated/wind-from-north-fps</input>
95     <output>/environment/wind-from-north-fps</output>
96     <type>noise-spike</type>
97     <max-rate-of-change>0.5</max-rate-of-change>
98   </filter>
99
100   <filter>
101     <name>EnvironmentInterpolator:wind-from-east</name>
102     <enable>
103       <property>/environment/config/enabled</property>
104     </enable>
105     <input>
106       <condition>
107         <property>/environment/config/presets/wind-override</property>
108       </condition>
109       <property>/environment/config/presets/wind-from-east-fps</property>
110     </input>
111     <input>/environment/config/interpolated/wind-from-east-fps</input>
112     <output>/environment/wind-from-east-fps</output>
113     <type>noise-spike</type>
114     <max-rate-of-change>0.5</max-rate-of-change>
115   </filter>
116
117   <filter>
118     <name>EnvironmentInterpolator:wind-from-down</name>
119     <input>
120       <expression>
121         <sum>
122           <property>/environment/thermal-lift-fps</property>
123           <property>/environment/ridge-lift-fps</property>
124           <property>/environment/local-weather-lift-fps</property>
125         </sum>
126       </expression>
127     </input>
128     <output>/environment/wind-from-down-fps</output>
129     <type>noise-spike</type>
130     <max-rate-of-change>2.0</max-rate-of-change>
131   </filter>
132
133   <filter>
134     <name>EnvironmentInterpolator:turbulence-raw-magnitude</name>
135     <enable>
136       <property>/environment/config/enabled</property>
137     </enable>
138     <input>
139       <condition>
140         <property>/environment/config/presets/turbulence-magnitude-norm-override</property>
141       </condition>
142       <property>/environment/config/presets/turbulence-magnitude-norm</property>
143     </input>
144     <input>
145       <property>/environment/config/interpolated/turbulence/magnitude-norm</property>
146     </input>
147     <output>/environment/turbulence/raw-magnitude-norm</output>
148     <type>noise-spike</type>
149     <max-rate-of-change>0.2</max-rate-of-change>
150   </filter>
151
152   <filter>
153     <name>EnvironmentInterpolator:turbulence-magnitude</name>
154     <enable>
155       <property>/environment/config/enabled</property>
156     </enable>
157     <input>
158       <expression>
159         <pow>
160           <property>/environment/turbulence/raw-magnitude-norm</property>
161           <property>/environment/turbulence/sensitivity</property>
162         </pow>
163       </expression>
164     </input>
165     <output>/environment/turbulence/magnitude-norm</output>
166     <type>gain</type>
167     <gain>1</gain>
168   </filter>
169
170   <filter>
171     <name>EnvironmentInterpolator:turbulence-rate</name>
172     <enable>
173       <property>/environment/config/enabled</property>
174     </enable>
175     <input>/environment/config/interpolated/turbulence/rate-hz</input>
176     <output>/environment/turbulence/rate-hz</output>
177     <type>exponential</type>
178     <filter-time>1</filter-time>
179   </filter>
180
181   <!-- replace weather-utility.nas -->
182   <!--
183     #this utility is a workaround for the fact that a shader uses listeners which cannot
184     # be used with a tied property
185   -->
186   <filter>
187     <name>EnvironmentInterpolator:wave:wind-from-east-fps</name>
188     <input>/environment/config/boundary/entry[0]/wind-from-east-fps</input>
189     <output>/environment/sea/surface/wind-from-east-fps</output>
190     <type>noise-spike</type>
191     <max-rate-of-change>/environment/sea/config/wind-filter-time</max-rate-of-change>
192   </filter>
193
194   <filter>
195     <name>EnvironmentInterpolator:wave:wind-from-north-fps</name>
196     <input>/environment/config/boundary/entry[0]/wind-from-north-fps</input>
197     <output>/environment/sea/surface/wind-from-north-fps</output>
198     <type>noise-spike</type>
199     <max-rate-of-change>/environment/sea/config/wind-filter-time</max-rate-of-change>
200   </filter>
201
202   <!--filter> unused?
203     <name>EnvironmentInterpolator:wave:wind-from-heading-deg</name>
204     <input>/environment/config/boundary/entry[0]/wind-from-heading-deg</input>
205     <output>/environment/sea/surface/wind-from-deg</output>
206     <type>gain</type>
207     <gain>1</gain>
208   </filter-->
209
210   <!--filter> unused?
211     <name>EnvironmentInterpolator:wave:wind-speed-kt</name>
212     <input>/environment/config/boundary/entry[0]/wind-speed-kt</input>
213     <output>/environment/sea/surface/wind-speed-kt</output>
214     <type>gain</type>
215     <gain>1</gain>
216   </filter-->
217
218   <logic>
219     <name>EnvironmentInterpolator:wave:enabled</name>
220     <input>/environment/config/enabled</input>
221     <output>/environment/sea/config/enabled</output>
222   </logic>
223
224   <filter>
225     <name>EnvironmentInterpolator:model:heading</name>
226     <input>/orientation/heading-deg</input>
227     <output>/orientation/model/heading-deg</output>
228     <type>gain</type>
229     <gain>1</gain>
230   </filter>
231
232   <filter>
233     <name>EnvironmentInterpolator:model:pitch</name>
234     <input>/orientation/pitch-deg</input>
235     <output>/orientation/model/pitch-deg</output>
236     <type>gain</type>
237     <gain>1</gain>
238   </filter>
239
240   <filter>
241     <name>EnvironmentInterpolator:model:roll</name>
242     <type>gain</type>
243     <gain>1</gain>
244     <input>/orientation/roll-deg</input>
245     <output>/orientation/model/roll-deg</output>
246   </filter>
247
248   <filter>
249     <name>EnvironmentInterpolator:wave:amp</name>
250     <type>gain</type>
251     <gain>1</gain>
252     <input>
253       <expression>
254         <sum>
255           <value>1.0</value>
256           <product>
257             <value>0.02</value>
258             <property>/environment/config/boundary/entry[0]/wind-speed-kt</property>
259           </product>
260         </sum>
261       </expression>
262     </input>
263     <output>/environment/wave/amp</output>
264     <min>1.0</min>
265     <max>2.0</max>
266   </filter>
267
268   <filter>
269     <name>EnvironmentInterpolator:wave:angle</name>
270     <type>gain</type>
271     <gain>1</gain>
272     <input>
273       <expression>
274         <sum>
275           <value>35.0</value>
276           <product>
277             <value>0.2</value>
278             <property>/environment/config/boundary/entry[0]/wind-speed-kt</property>
279           </product>
280         </sum>
281       </expression>
282     </input>
283     <output>/environment/wave/angle</output>
284   </filter>
285
286   <filter>
287     <name>EnvironmentInterpolator:wave:dangle</name>
288     <type>gain</type>
289     <gain>1</gain>
290     <input>
291       <expression>
292         <difference>
293           <value>20.0</value>
294           <product>
295             <value>0.4</value>
296             <property>/environment/config/boundary/entry[0]/wind-speed-kt</property>
297           </product>
298         </difference>
299       </expression>
300     </input>
301     <output>/environment/wave/dangle</output>
302   </filter>
303
304   <filter>
305     <name>EnvironmentInterpolator:wave:freq</name>
306     <type>gain</type>
307     <gain>1</gain>
308     <input>
309       <expression>
310         <sum>
311           <value>0.01</value>
312           <product>
313             <value>0.0008</value>
314             <property>/environment/config/boundary/entry[0]/wind-speed-kt</property>
315           </product>
316         </sum>
317       </expression>
318     </input>
319     <output>/environment/wave/freq</output>
320     <min>0.01</min>
321     <max>0.015</max>
322   </filter>
323
324   <filter>
325     <name>EnvironmentInterpolator:wave:factor</name>
326     <type>gain</type>
327     <gain>1</gain>
328     <input>
329       <expression>
330         <difference>
331           <value>0.0004</value>
332           <product>
333             <value>0.00001</value>
334             <property>/environment/config/boundary/entry[0]/wind-speed-kt</property>
335           </product>
336         </difference>
337       </expression>
338     </input>
339     <output>/environment/wave/factor</output>
340     <min>0.0001</min>
341     <max>0.0004</max>
342   </filter>
343
344   <filter>
345     <name>EnvironmentInterpolator:wave:sharp</name>
346     <type>gain</type>
347     <gain>1</gain>
348     <input>
349       <expression>
350         <sum>
351           <value>1.0</value>
352           <product>
353             <value>0.02</value>
354             <property>/environment/config/boundary/entry[0]/wind-speed-kt</property>
355           </product>
356         </sum>
357       </expression>
358     </input>
359     <output>/environment/wave/sharp</output>
360     <min>1.0</min>
361     <max>2.0</max>
362   </filter>
363
364 </PropertyList>