Quality slider overwrites custom shader settings. All effects now listen to the new...
[fg:toms-fgdata.git] / Effects / transition.eff
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- Transition effect  starting from the base texture of the scenery, and changing textures according to slope in one or two steps.
3
4 parameters :
5     texture[0] -> base texture from the scenery
6     texture[2] -> intermediate texture if transitions is set to 2
7     texture[3] -> texture you want to transition to
8     texture[4] -> snow texture you want applied above snow-limit (I recommend using the corespondent winter texture for the base texture that you can find in terrain.winter)
9
10    transitions -> transitions number can be set to 1 or 2 (if set to 2 will allow for an intermediate step)
11        inverse -> if this is set to 1 will keep the base texture on steep slopes and transition to the texture you want (useful to add some grass patches in rocky areas)
12 -->
13
14 <PropertyList>
15         <name>Effects/transition</name>
16         <inherits-from>Effects/terrain-default</inherits-from>
17         <parameters>
18                 <texture n="2">
19                         <image>Textures.high/Terrain/transition1.dds</image>
20                         <filter>linear-mipmap-linear</filter>
21                         <wrap-s>repeat</wrap-s>
22                         <wrap-t>repeat</wrap-t>
23                         <internal-format>normalized</internal-format>
24                 </texture>
25                 <texture n="3">
26                         <image>Textures.high/Terrain/transition2.dds</image>
27                         <filter>linear-mipmap-linear</filter>
28                         <wrap-s>repeat</wrap-s>
29                         <wrap-t>repeat</wrap-t>
30                         <internal-format>normalized</internal-format>
31                 </texture>
32                 <texture n="4">
33                         <image>Textures.high/Terrain/snow3.dds</image>
34                         <filter>linear-mipmap-linear</filter>
35                         <wrap-s>repeat</wrap-s>
36                         <wrap-t>repeat</wrap-t>
37                         <internal-format>normalized</internal-format>
38                 </texture>
39
40                 <rain-norm>
41                         <use>/environment/rain-norm</use>
42                 </rain-norm>
43                 <snow-level>
44                         <use>/environment/snow-level-m</use>
45                 </snow-level>
46
47                 <cloud-cover0>
48                         <use>/environment/clouds/layer[0]/coverage-type</use>
49                 </cloud-cover0>
50                 <cloud-cover1>
51                         <use>/environment/clouds/layer[1]/coverage-type</use>
52                 </cloud-cover1>
53                 <cloud-cover2>
54                         <use>/environment/clouds/layer[2]/coverage-type</use>
55                 </cloud-cover2>
56                 <cloud-cover3>
57                         <use>/environment/clouds/layer[3]/coverage-type</use>
58                 </cloud-cover3>
59                 <cloud-cover4>
60                         <use>/environment/clouds/layer[4]/coverage-type</use>
61                 </cloud-cover4>
62
63                 <transitions type="float">2.0</transitions>
64                 <inverse type="float">0.0</inverse>
65
66                 <!--    fog include -->
67                 <visibility>
68                         <use>/environment/ground-visibility-m</use>
69                 </visibility>
70                 <avisibility>
71                         <use>/environment/visibility-m</use>
72                 </avisibility>
73                 <lthickness>
74                         <use>/environment/ground-haze-thickness-m</use>
75                 </lthickness>
76                 <scattering>
77                         <use>/rendering/scene/scattering</use>
78                 </scattering>
79                 <terminator>
80                         <use>/environment/terminator-relative-position-m</use>
81                 </terminator>
82                 <fogtype>
83                         <use>/sim/rendering/shaders/skydome</use>
84                 </fogtype>
85                 <!--    END fog include -->
86         </parameters>
87
88         <!--<generate>
89         <tangent type="int">6</tangent>
90         <binormal type="int">7</binormal>
91     </generate>-->
92
93         <technique n="9">
94                 <predicate>
95                         <and>
96                                 <property>/sim/rendering/shaders/transition</property>
97                                 <or>
98                                         <less-equal>
99                                                 <value type="float">2.0</value>
100                                                 <glversion/>
101                                         </less-equal>
102                                         <and>
103                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
104                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
105                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
106                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
107                                         </and>
108                                 </or>
109                         </and>
110                 </predicate>
111
112                 <pass>
113                         <lighting>true</lighting>
114                         <!-- Use material values that are either inherited from the
115             terrain-default effect or supplied by an effect derived
116             from this one e.g., one created in the materials library. -->
117                         <material>
118                                 <ambient>
119                                         <use>material/ambient</use>
120                                 </ambient>
121                                 <diffuse>
122                                         <use>material/diffuse</use>
123                                 </diffuse>
124                                 <specular>
125                                         <use>material/specular</use>
126                                 </specular>
127                                 <color-mode>ambient-and-diffuse</color-mode>
128                         </material>
129
130                         <blend>
131                                 <use>transparent</use>
132                         </blend>
133
134                         <alpha-test>
135                                 <use>transparent</use>
136                         </alpha-test>
137
138                         <shade-model>smooth</shade-model>
139                         <cull-face>back</cull-face>
140
141                         <render-bin>
142                                 <bin-number>
143                                         <use>render-bin/bin-number</use>
144                                 </bin-number>
145                                 <bin-name>
146                                         <use>render-bin/bin-name</use>
147                                 </bin-name>
148                         </render-bin>
149
150                         <texture-unit>
151                                 <unit>0</unit>
152                                 <image>
153                                         <use>texture[0]/image</use>
154                                 </image>
155                                 <filter>
156                                         <use>texture[0]/filter</use>
157                                 </filter>
158                                 <wrap-s>
159                                         <use>texture[0]/wrap-s</use>
160                                 </wrap-s>
161                                 <wrap-t>
162                                         <use>texture[0]/wrap-t</use>
163                                 </wrap-t>
164                                 <internal-format>
165                                         <use>texture[0]/internal-format</use>
166                                 </internal-format>
167                         </texture-unit>
168
169                         <texture-unit>
170                                 <unit>1</unit>
171                                 <image>
172                                         <use>texture[2]/image</use>
173                                 </image>
174                                 <filter>
175                                         <use>texture[2]/filter</use>
176                                 </filter>
177                                 <wrap-s>
178                                         <use>texture[2]/wrap-s</use>
179                                 </wrap-s>
180                                 <wrap-t>
181                                         <use>texture[2]/wrap-t</use>
182                                 </wrap-t>
183                                 <internal-format>
184                                         <use>texture[2]/internal-format</use>
185                                 </internal-format>
186                         </texture-unit>
187
188                         <texture-unit>
189                                 <unit>2</unit>
190                                 <image>
191                                         <use>texture[3]/image</use>
192                                 </image>
193                                 <filter>
194                                         <use>texture[3]/filter</use>
195                                 </filter>
196                                 <wrap-s>
197                                         <use>texture[3]/wrap-s</use>
198                                 </wrap-s>
199                                 <wrap-t>
200                                         <use>texture[3]/wrap-t</use>
201                                 </wrap-t>
202                                 <internal-format>
203                                         <use>texture[3]/internal-format</use>
204                                 </internal-format>
205                         </texture-unit>
206
207                         <texture-unit>
208                                 <unit>3</unit>
209                                 <image>
210                                         <use>texture[4]/image</use>
211                                 </image>
212                                 <filter>
213                                         <use>texture[4]/filter</use>
214                                 </filter>
215                                 <wrap-s>
216                                         <use>texture[4]/wrap-s</use>
217                                 </wrap-s>
218                                 <wrap-t>
219                                         <use>texture[4]/wrap-t</use>
220                                 </wrap-t>
221                                 <internal-format>
222                                         <use>texture[4]/internal-format</use>
223                                 </internal-format>
224                         </texture-unit>
225
226                         <texture-unit>
227                                 <unit>4</unit>
228                                 <type>noise</type>
229                         </texture-unit>
230
231                         <program>
232                                 <vertex-shader>Shaders/include_fog.vert</vertex-shader>
233                                 <vertex-shader>Shaders/transition.vert</vertex-shader>
234                                 <fragment-shader>Shaders/include_fog.frag</fragment-shader>
235                                 <fragment-shader>Shaders/transition.frag</fragment-shader>
236                         </program>
237
238                         <uniform>
239                                 <name>BaseTex</name>
240                                 <type>sampler-2d</type>
241                                 <value type="int">0</value>
242                         </uniform>
243
244                         <uniform>
245                                 <name>SecondTex</name>
246                                 <type>sampler-2d</type>
247                                 <value type="int">1</value>
248                         </uniform>
249
250                         <uniform>
251                                 <name>ThirdTex</name>
252                                 <type>sampler-2d</type>
253                                 <value type="int">2</value>
254                         </uniform>
255
256                         <uniform>
257                                 <name>SnowTex</name>
258                                 <type>sampler-2d</type>
259                                 <value type="int">3</value>
260                         </uniform>
261
262                         <uniform>
263                                 <name>NoiseTex</name>
264                                 <type>sampler-3d</type>
265                                 <value type="int">4</value>
266                         </uniform>
267
268                         <uniform>
269                                 <name>RainNorm</name>
270                                 <type>float</type>
271                                 <value>
272                                         <use>rain-norm</use>
273                                 </value>
274                         </uniform>
275
276                         <uniform>
277                                 <name>SnowLevel</name>
278                                 <type>float</type>
279                                 <value>
280                                         <use>snow-level</use>
281                                 </value>
282                         </uniform>
283
284                         <uniform>
285                                 <name>Transitions</name>
286                                 <type>float</type>
287                                 <value>
288                                         <use>transitions</use>
289                                 </value>
290                         </uniform>
291
292                         <uniform>
293                                 <name>InverseSlope</name>
294                                 <type>float</type>
295                                 <value>
296                                         <use>inverse</use>
297                                 </value>
298                         </uniform>
299
300                         <uniform>
301                                 <name>CloudCover0</name>
302                                 <type>float</type>
303                                 <value>
304                                         <use>cloud-cover0</use>
305                                 </value>
306                         </uniform>
307
308                         <uniform>
309                                 <name>CloudCover1</name>
310                                 <type>float</type>
311                                 <value>
312                                         <use>cloud-cover1</use>
313                                 </value>
314                         </uniform>
315
316                         <uniform>
317                                 <name>CloudCover2</name>
318                                 <type>float</type>
319                                 <value>
320                                         <use>cloud-cover2</use>
321                                 </value>
322                         </uniform>
323
324                         <uniform>
325                                 <name>CloudCover3</name>
326                                 <type>float</type>
327                                 <value>
328                                         <use>cloud-cover3</use>
329                                 </value>
330                         </uniform>
331
332                         <uniform>
333                                 <name>CloudCover4</name>
334                                 <type>float</type>
335                                 <value>
336                                         <use>cloud-cover4</use>
337                                 </value>
338                         </uniform>
339
340                         <!--        BEGIN fog include -->
341                         <uniform>
342                                 <name>visibility</name>
343                                 <type>float</type>
344                                 <value>
345                                         <use>visibility</use>
346                                 </value>
347                         </uniform>
348                         <uniform>
349                                 <name>avisibility</name>
350                                 <type>float</type>
351                                 <value>
352                                         <use>avisibility</use>
353                                 </value>
354                         </uniform>
355                         <uniform>
356                                 <name>hazeLayerAltitude</name>
357                                 <type>float</type>
358                                 <value>
359                                         <use>lthickness</use>
360                                 </value>
361                         </uniform>
362                         <uniform>
363                                 <name>scattering</name>
364                                 <type>float</type>
365                                 <value>
366                                         <use>scattering</use>
367                                 </value>
368                         </uniform>
369                         <uniform>
370                                 <name>terminator</name>
371                                 <type>float</type>
372                                 <value>
373                                         <use>terminator</use>
374                                 </value>
375                         </uniform>
376                         <uniform>
377                                 <name>fogType</name>
378                                 <type>int</type>
379                                 <value>
380                                         <use>fogtype</use>
381                                 </value>
382                         </uniform>
383                         <!--                    END fog include -->
384                 </pass>
385         </technique>
386 </PropertyList>