'The Flag' for Atmospheric Light Scattering
[fg:toms-fgdata.git] / Effects / flutter.eff
1 <?xml version="1.0" encoding="utf-8"?>
2 <PropertyList>
3         <name>Effects/flutter</name>
4         <inherits-from>Effects/model-default</inherits-from>
5         <parameters>
6                 <vertex-program-two-side type="bool">true</vertex-program-two-side>
7                 <material>
8                         <color-mode-uniform>1</color-mode-uniform>
9                         <!-- DIFFUSE -->
10                 </material>
11                 <shade-model>smooth</shade-model>
12                 <!-- unused ?
13                 <wind-speed>
14                         <!- -<use>/environment/Vinson/rel-wind-speed-kts</use>- ->
15                         <use>/environment/config/boundary/entry[0]/wind-speed-kt</use>
16                 </wind-speed>
17                 -->
18                 <offset>0.0</offset>
19                 <amplitude-factor>0.08</amplitude-factor>
20                 <windE>
21                         <use>/environment/sea/surface/wind-from-east-fps</use>
22                 </windE>
23                 <windN>
24                         <use>/environment/sea/surface/wind-from-north-fps</use>
25                 </windN>
26                 <speed-kt>0.0</speed-kt>
27                 <heading-deg>0.0</heading-deg>
28
29                 <!--  fog include -->
30                 <visibility>
31                         <use>/environment/ground-visibility-m</use>
32                 </visibility>
33                 <avisibility>
34                         <use>/environment/visibility-m</use>
35                 </avisibility>
36                 <lthickness>
37                         <use>/environment/ground-haze-thickness-m</use>
38                 </lthickness>
39                 <scattering>
40                         <use>/rendering/scene/scattering</use>
41                 </scattering>
42                 <terminator>
43                         <use>/environment/terminator-relative-position-m</use>
44                 </terminator>
45                 <fogtype>
46                         <use>/sim/rendering/shaders/skydome</use>
47                 </fogtype>
48                 <!--    END fog include -->
49
50         </parameters>
51
52         <technique n="3">
53                 <predicate>
54                         <and>
55                           <property>/sim/rendering/shaders/skydome</property>
56                                 <or>
57                                         <less-equal>
58                                                 <value type="float">2.0</value>
59                                                 <glversion/>
60                                         </less-equal>
61                                         <and>
62                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
63                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
64                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
65                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
66                                         </and>
67                                 </or>
68                         </and>
69                 </predicate>
70                 <pass>
71                         <lighting>true</lighting>
72                         <material>
73                                 <active>
74                                         <use>material/active</use>
75                                 </active>
76                                 <ambient>
77                                         <use>material/ambient</use>
78                                 </ambient>
79                                 <diffuse>
80                                         <use>material/diffuse</use>
81                                 </diffuse>
82                                 <specular>
83                                         <use>material/specular</use>
84                                 </specular>
85                                 <emissive>
86                                         <use>material/emissive</use>
87                                 </emissive>
88                                 <shininess>
89                                         <use>material/shininess</use>
90                                 </shininess>
91                                 <color-mode>
92                                         <use>material/color-mode</use>
93                                 </color-mode>
94                         </material>
95                         <blend>
96                                 <active>
97                                         <use>blend/active</use>
98                                 </active>
99                                 <source>
100                                         <use>blend/source</use>
101                                 </source>
102                                 <destination>
103                                         <use>blend/destination</use>
104                                 </destination>
105                         </blend>
106                         <shade-model>
107                                 <use>shade-model</use>
108                         </shade-model>
109                         <cull-face>
110                                 <use>cull-face</use>
111                         </cull-face>
112                         <rendering-hint>
113                                 <use>rendering-hint</use>
114                         </rendering-hint>
115                         <texture-unit>
116                                 <!-- The texture unit is always active because the shaders expect
117              that. -->
118                                 <unit>0</unit>
119                                 <!-- If there is a texture, the type in the derived effect
120         will be "2d". -->
121                                 <type>
122                                         <use>texture[0]/type</use>
123                                 </type>
124                                 <image>
125                                         <use>texture[0]/image</use>
126                                 </image>
127                                 <filter>
128                                         <use>texture[0]/filter</use>
129                                 </filter>
130                                 <wrap-s>
131                                         <use>texture[0]/wrap-s</use>
132                                 </wrap-s>
133                                 <wrap-t>
134                                         <use>texture[0]/wrap-t</use>
135                                 </wrap-t>
136                                 <!--
137         <internal-format>
138           <use>texture[0]/internal-format</use>
139         </internal-format>
140         -->
141                         </texture-unit>
142                         <texture-unit>
143                                 <unit>1</unit>
144                                 <type>noise</type>
145                         </texture-unit>
146                         <vertex-program-two-side>
147                                 <use>vertex-program-two-side</use>
148                         </vertex-program-two-side>
149                         <program>
150
151                                 <vertex-shader>Shaders/flutter-lightfield.vert</vertex-shader>
152                                 <fragment-shader>Shaders/terrain-haze.frag</fragment-shader>
153                         </program>
154                         <!--<uniform>
155                                 <name>texture</name>
156                                 <type>sampler-2d</type>
157                                 <value type="int">0</value>
158                         </uniform>-->
159                         <uniform>
160                                 <name>colorMode</name>
161                                 <type>int</type>
162                                 <value>
163                                         <use>material/color-mode-uniform</use>
164                                 </value>
165                         </uniform>
166                         <!-- uniform> unused?
167                                 <name>WindSpeed</name>
168                                 <type>float</type>
169                                 <value>
170                                         <use>wind-speed</use>
171                                 </value>
172                         </uniform-->
173                         <uniform>
174                                 <name>Offset</name>
175                                 <type>float</type>
176                                 <value>
177                                         <use>offset</use>
178                                 </value>
179                         </uniform>
180                         <uniform>
181                                 <name>AmpFactor</name>
182                                 <type>float</type>
183                                 <value>
184                                         <use>amplitude-factor</use>
185                                 </value>
186                         </uniform>
187                         <uniform>
188                                 <name>Noise</name>
189                                 <type>sampler-3d</type>
190                                 <value type="int">1</value>
191                         </uniform>
192                         <uniform>
193                                 <name>WindE</name>
194                                 <type>float</type>
195                                 <value>
196                                         <use>windE</use>
197                                 </value>
198                         </uniform>
199                         <uniform>
200                                 <name>WindN</name>
201                                 <type>float</type>
202                                 <value>
203                                         <use>windN</use>
204                                 </value>
205                         </uniform>
206                         <uniform>
207                                 <name>spd</name>
208                                 <type>float</type>
209                                 <value>
210                                         <use>speed-kt</use>
211                                 </value>
212                         </uniform>
213                         <uniform>
214                                 <name>hdg</name>
215                                 <type>float</type>
216                                 <value>
217                                         <use>heading-deg</use>
218                                 </value>
219                         </uniform>
220
221                         <!--        BEGIN fog include -->
222                         <uniform>
223                                 <name>visibility</name>
224                                 <type>float</type>
225                                 <value>
226                                         <use>visibility</use>
227                                 </value>
228                         </uniform>
229                         <uniform>
230                                 <name>avisibility</name>
231                                 <type>float</type>
232                                 <value>
233                                         <use>avisibility</use>
234                                 </value>
235                         </uniform>
236                         <uniform>
237                                 <name>hazeLayerAltitude</name>
238                                 <type>float</type>
239                                 <value>
240                                         <use>lthickness</use>
241                                 </value>
242                         </uniform>
243                         <uniform>
244                                 <name>scattering</name>
245                                 <type>float</type>
246                                 <value>
247                                         <use>scattering</use>
248                                 </value>
249                         </uniform>
250                         <uniform>
251                                 <name>terminator</name>
252                                 <type>float</type>
253                                 <value>
254                                         <use>terminator</use>
255                                 </value>
256                         </uniform>
257                         <uniform>
258                                 <name>fogType</name>
259                                 <type>int</type>
260                                 <value>
261                                         <use>fogtype</use>
262                                 </value>
263                         </uniform>
264                         <!--                    END fog include -->
265                 </pass>
266         </technique>
267
268
269
270         <technique n="9">
271                 <predicate>
272                         <and>
273                                 <property>/sim/rendering/shaders/quality-level</property>
274                                 <property>/sim/rendering/shaders/generic</property>
275                                 <or>
276                                         <less-equal>
277                                                 <value type="float">2.0</value>
278                                                 <glversion/>
279                                         </less-equal>
280                                         <and>
281                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
282                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
283                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
284                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
285                                         </and>
286                                 </or>
287                         </and>
288                 </predicate>
289                 <pass>
290                         <lighting>true</lighting>
291                         <material>
292                                 <active>
293                                         <use>material/active</use>
294                                 </active>
295                                 <ambient>
296                                         <use>material/ambient</use>
297                                 </ambient>
298                                 <diffuse>
299                                         <use>material/diffuse</use>
300                                 </diffuse>
301                                 <specular>
302                                         <use>material/specular</use>
303                                 </specular>
304                                 <emissive>
305                                         <use>material/emissive</use>
306                                 </emissive>
307                                 <shininess>
308                                         <use>material/shininess</use>
309                                 </shininess>
310                                 <color-mode>
311                                         <use>material/color-mode</use>
312                                 </color-mode>
313                         </material>
314                         <blend>
315                                 <active>
316                                         <use>blend/active</use>
317                                 </active>
318                                 <source>
319                                         <use>blend/source</use>
320                                 </source>
321                                 <destination>
322                                         <use>blend/destination</use>
323                                 </destination>
324                         </blend>
325                         <shade-model>
326                                 <use>shade-model</use>
327                         </shade-model>
328                         <cull-face>
329                                 <use>cull-face</use>
330                         </cull-face>
331                         <rendering-hint>
332                                 <use>rendering-hint</use>
333                         </rendering-hint>
334                         <texture-unit>
335                                 <!-- The texture unit is always active because the shaders expect
336              that. -->
337                                 <unit>0</unit>
338                                 <!-- If there is a texture, the type in the derived effect
339         will be "2d". -->
340                                 <type>
341                                         <use>texture[0]/type</use>
342                                 </type>
343                                 <image>
344                                         <use>texture[0]/image</use>
345                                 </image>
346                                 <filter>
347                                         <use>texture[0]/filter</use>
348                                 </filter>
349                                 <wrap-s>
350                                         <use>texture[0]/wrap-s</use>
351                                 </wrap-s>
352                                 <wrap-t>
353                                         <use>texture[0]/wrap-t</use>
354                                 </wrap-t>
355                                 <!--
356         <internal-format>
357           <use>texture[0]/internal-format</use>
358         </internal-format>
359         -->
360                         </texture-unit>
361                         <texture-unit>
362                                 <unit>1</unit>
363                                 <type>noise</type>
364                         </texture-unit>
365                         <vertex-program-two-side>
366                                 <use>vertex-program-two-side</use>
367                         </vertex-program-two-side>
368                         <program>
369 <!--                            <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
370                                 <vertex-shader n="1">Shaders/flutter.vert</vertex-shader>
371                                 <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
372                                 <fragment-shader n="1">Shaders/default.frag</fragment-shader>
373                         </program>
374                         <!--<uniform>
375                                 <name>texture</name>
376                                 <type>sampler-2d</type>
377                                 <value type="int">0</value>
378                         </uniform>-->
379                         <uniform>
380                                 <name>colorMode</name>
381                                 <type>int</type>
382                                 <value>
383                                         <use>material/color-mode-uniform</use>
384                                 </value>
385                         </uniform>
386                         <!-- uniform> unused?
387                                 <name>WindSpeed</name>
388                                 <type>float</type>
389                                 <value>
390                                         <use>wind-speed</use>
391                                 </value>
392                         </uniform-->
393                         <uniform>
394                                 <name>Offset</name>
395                                 <type>float</type>
396                                 <value>
397                                         <use>offset</use>
398                                 </value>
399                         </uniform>
400                         <uniform>
401                                 <name>AmpFactor</name>
402                                 <type>float</type>
403                                 <value>
404                                         <use>amplitude-factor</use>
405                                 </value>
406                         </uniform>
407                         <uniform>
408                                 <name>Noise</name>
409                                 <type>sampler-3d</type>
410                                 <value type="int">1</value>
411                         </uniform>
412                         <uniform>
413                                 <name>WindE</name>
414                                 <type>float</type>
415                                 <value>
416                                         <use>windE</use>
417                                 </value>
418                         </uniform>
419                         <uniform>
420                                 <name>WindN</name>
421                                 <type>float</type>
422                                 <value>
423                                         <use>windN</use>
424                                 </value>
425                         </uniform>
426                         <uniform>
427                                 <name>spd</name>
428                                 <type>float</type>
429                                 <value>
430                                         <use>speed-kt</use>
431                                 </value>
432                         </uniform>
433                         <uniform>
434                                 <name>hdg</name>
435                                 <type>float</type>
436                                 <value>
437                                         <use>heading-deg</use>
438                                 </value>
439                         </uniform>
440
441                         <!--        BEGIN fog include -->
442                         <uniform>
443                                 <name>visibility</name>
444                                 <type>float</type>
445                                 <value>
446                                         <use>visibility</use>
447                                 </value>
448                         </uniform>
449                         <uniform>
450                                 <name>avisibility</name>
451                                 <type>float</type>
452                                 <value>
453                                         <use>avisibility</use>
454                                 </value>
455                         </uniform>
456                         <uniform>
457                                 <name>hazeLayerAltitude</name>
458                                 <type>float</type>
459                                 <value>
460                                         <use>lthickness</use>
461                                 </value>
462                         </uniform>
463                         <uniform>
464                                 <name>scattering</name>
465                                 <type>float</type>
466                                 <value>
467                                         <use>scattering</use>
468                                 </value>
469                         </uniform>
470                         <uniform>
471                                 <name>terminator</name>
472                                 <type>float</type>
473                                 <value>
474                                         <use>terminator</use>
475                                 </value>
476                         </uniform>
477                         <uniform>
478                                 <name>fogType</name>
479                                 <type>int</type>
480                                 <value>
481                                         <use>fogtype</use>
482                                 </value>
483                         </uniform>
484                         <!--                    END fog include -->
485                 </pass>
486         </technique>
487
488 </PropertyList>