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