Quality slider overwrites custom shader settings. All effects now listen to the new...
[fg:toms-fgdata.git] / Effects / reflect-bump-spec.eff
1 <?xml version="1.0" encoding="utf-8"?>\r
2 <!-- Reflections + Bumpmapping + specular\r
3 \r
4 PARAMETERS: There are two forms of cube map texture:- vertical cross and 6 images.\r
5 Either can be used - alternative forms are shown in <parameters> and in <texture-unit>\r
6 \r
7 The reflection is set proportional to the shininess of the material. Thus by\r
8 varying the material shininess value over or between objects the amount of\r
9 refection can be controlled. The overall amount of reflection may be\r
10 adjusted by the use of <refl_correction> -1.0 (fully transparent)- 1.0 (fully opaque).\r
11 \r
12 The overall values of the noisiness, coloured fringing or fresnel effect may be adjusted\r
13 by the use of <noisiness>, <rainbowiness> and <fresneliness>.\r
14 \r
15 If your result is too dark/too light the overall ambient light value can be adjusted\r
16 by the use of <ambient_correction>. This correction also takes out some of the blueness\r
17 added as default to compensate for the lack of reflection.\r
18 \r
19 To use a reflection map set <reflect_map> to 1,and the path to the map texture in\r
20 <texture n="8">\r
21 \r
22 A default, null, bumpspec is specified as texture unit 4. To provide a custom bumpspec map,\r
23 define <texture n="4"> in the derived effect file\r
24 \r
25 If you are using Direct Draw Surface (.dds) files for your bumpmap set <normalmap_dds> to 1.\r
26 \r
27 USE:    To use the default reflection effect (controlled by material shininess values) use\r
28 \r
29         <effect>\r
30                         <inherits-from>Effects/reflect-bump-spec</inherits-from>\r
31                         <object-name>Fuselage</object-name>\r
32         </effect>\r
33 \r
34                         To use your own reflection effect, use\r
35 \r
36         <effect>\r
37                 <inherits-from>Aircraft/Lightning/Models/Effects/lightningreflect</inherits-from>\r
38                 <object-name>Fuselage</object-name>\r
39         </effect>\r
40 \r
41 in your model file.\r
42 \r
43 To use your own effect place your efffect file containing something like this:\r
44 \r
45         <name>Effects/lightningreflect</name>\r
46         <inherits-from>Effects/reflect-bump-spec</inherits-from>\r
47 \r
48         and the the modified tags in the path as above\r
49 \r
50 EXAMPLES: You can find examples of both usages in the Hunter and Lightning models.\r
51 -->\r
52 <PropertyList>\r
53         <name>Effects/reflect-bump-spec</name>\r
54         <inherits-from>Effects/model-default</inherits-from>\r
55 \r
56         <parameters>\r
57                 <texture n="4">\r
58                         <image>Aircraft/Generic/Effects/null_bumpspec.png</image>\r
59                         <filter>linear-mipmap-linear</filter>\r
60                         <wrap-s>repeat</wrap-s>\r
61                         <wrap-t>repeat</wrap-t>\r
62                         <internal-format>normalized</internal-format>\r
63                 </texture>\r
64                 <texture n="5">\r
65                         <type>cubemap</type>\r
66                         <!-- use this form for a cube cross -->\r
67                         <!--<image>Aircraft/Generic/Effects/CubeCrosses/blue_sky_big.jpg</image>-->\r
68 \r
69                         <!-- use this form for a 6 image cube map -->\r
70                         <images>\r
71                                 <positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>\r
72                                 <negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>\r
73                                 <positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>\r
74                                 <negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>\r
75                                 <positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>\r
76                                 <negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>\r
77                         </images>\r
78 \r
79                 </texture>\r
80                 <texture n="6">\r
81                         <image>Aircraft/Generic/Effects/Rainbow.png</image>\r
82                         <filter>linear-mipmap-linear</filter>\r
83                         <wrap-s>repeat</wrap-s>\r
84                         <wrap-t>repeat</wrap-t>\r
85                         <internal-format>normalized</internal-format>\r
86                 </texture>\r
87                 <texture n="7">\r
88                         <image>Aircraft/Generic/Effects/FresnelLookUp.png</image>\r
89                         <filter>linear-mipmap-linear</filter>\r
90                         <wrap-s>repeat</wrap-s>\r
91                         <wrap-t>repeat</wrap-t>\r
92                         <internal-format>normalized</internal-format>\r
93                 </texture>\r
94                 <texture n="8">\r
95                         <image>Aircraft/Generic/Effects/ReflectMaps/reflectmap.png</image>\r
96                         <filter>linear-mipmap-linear</filter>\r
97                         <wrap-s>repeat</wrap-s>\r
98                         <wrap-t>repeat</wrap-t>\r
99                         <internal-format>normalized</internal-format>\r
100                 </texture>\r
101                 <rendering-hint>transparent</rendering-hint>\r
102                 <shade-model>smooth</shade-model>\r
103                 <rainbowiness type="float">0.01</rainbowiness>\r
104                 <fresneliness>0.1</fresneliness>\r
105                 <noisiness>0.25</noisiness>\r
106                 <refl_correction>0.0</refl_correction>\r
107                 <ambient_correction>0.05</ambient_correction>\r
108                 <reflect_map>0</reflect_map>\r
109                 <normalmap_dds>0</normalmap_dds>\r
110                 <visibility>\r
111                         <use>/environment/ground-visibility-m</use>\r
112                 </visibility>\r
113                 <avisibility>\r
114                         <use>/environment/visibility-m</use>\r
115                 </avisibility>\r
116                 <lthickness>\r
117                         <use>/environment/ground-haze-thickness-m</use>\r
118                 </lthickness>\r
119                 <scattering>\r
120                         <use>/rendering/scene/scattering</use>\r
121                 </scattering>\r
122                 <terminator>\r
123                         <use>/environment/terminator-relative-position-m</use>\r
124                 </terminator>\r
125                 <fogtype>\r
126                         <use>/sim/rendering/shaders/skydome</use>\r
127                 </fogtype>\r
128         </parameters>\r
129 \r
130         <generate>\r
131                 <tangent type="int">6</tangent>\r
132                 <binormal type="int">7</binormal>\r
133         </generate>\r
134 \r
135         <technique n="9">\r
136                 <predicate>\r
137                         <and>\r
138                                 <property>/sim/rendering/shaders/model</property>\r
139                                 <or>\r
140                                         <less-equal>\r
141                                                 <value type="float">2.0</value>\r
142                                                 <glversion/>\r
143                                         </less-equal>\r
144                                         <and>\r
145                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>\r
146                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>\r
147                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>\r
148                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>\r
149                                         </and>\r
150                                 </or>\r
151                         </and>\r
152                 </predicate>\r
153 \r
154                 <pass>\r
155                         <lighting>true</lighting>\r
156                         <material>\r
157                                 <active>\r
158                                         <use>material/active</use>\r
159                                 </active>\r
160                                 <ambient>\r
161                                         <use>material/ambient</use>\r
162                                 </ambient>\r
163                                 <diffuse>\r
164                                         <use>material/diffuse</use>\r
165                                 </diffuse>\r
166                                 <specular>\r
167                                         <use>material/specular</use>\r
168                                 </specular>\r
169                                 <emissive>\r
170                                         <use>material/emissive</use>\r
171                                 </emissive>\r
172                                 <shininess>\r
173                                         <use>material/shininess</use>\r
174                                 </shininess>\r
175                                 <color-mode>\r
176                                         <use>material/color-mode</use>\r
177                                 </color-mode>\r
178                         </material>\r
179                         <blend>\r
180                                 <active>\r
181                                         <use>blend/active</use>\r
182                                 </active>\r
183                                 <source>\r
184                                         <use>blend/source</use>\r
185                                 </source>\r
186                                 <destination>\r
187                                         <use>blend/destination</use>\r
188                                 </destination>\r
189                         </blend>\r
190                         <shade-model>\r
191                                 <use>shade-model</use>\r
192                         </shade-model>\r
193                         <cull-face>\r
194                                 <use>cull-face</use>\r
195                         </cull-face>\r
196                         <rendering-hint>\r
197                                 <use>rendering-hint</use>\r
198                         </rendering-hint>\r
199 \r
200                         <texture-unit>\r
201                                 <unit>0</unit>\r
202                                 <image>\r
203                                         <use>texture[0]/image</use>\r
204                                 </image>\r
205                                 <filter>\r
206                                         <use>texture[0]/filter</use>\r
207                                 </filter>\r
208                                 <wrap-s>\r
209                                         <use>texture[0]/wrap-s</use>\r
210                                 </wrap-s>\r
211                                 <wrap-t>\r
212                                         <use>texture[0]/wrap-t</use>\r
213                                 </wrap-t>\r
214                                 <internal-format>\r
215                                         <use>texture[0]/internal-format</use>\r
216                                 </internal-format>\r
217                         </texture-unit>\r
218 \r
219                         <texture-unit>\r
220                                 <unit>4</unit>\r
221                                 <image>\r
222                                         <use>texture[4]/image</use>\r
223                                 </image>\r
224                                 <filter>\r
225                                         <use>texture[4]/filter</use>\r
226                                 </filter>\r
227                                 <wrap-s>\r
228                                         <use>texture[4]/wrap-s</use>\r
229                                 </wrap-s>\r
230                                 <wrap-t>\r
231                                         <use>texture[4]/wrap-t</use>\r
232                                 </wrap-t>\r
233                                 <internal-format>\r
234                                         <use>texture[4]/internal-format</use>\r
235                                 </internal-format>\r
236                         </texture-unit>\r
237 \r
238                         <texture-unit>\r
239                                 <unit>5</unit>\r
240                                 <type>\r
241                                         <use>texture[5]/type</use>\r
242                                 </type>\r
243 \r
244                                 <!-- use this form for a cube cross -->\r
245                                 <!--<image><use>texture[5]/image</use></image>-->\r
246 \r
247                                 <!-- use this form for a 6 image cube map -->\r
248                                 <images>\r
249                                         <use>texture[5]/images</use>\r
250                                 </images>\r
251                         </texture-unit>\r
252 \r
253                         <texture-unit>\r
254                                 <unit>6</unit>\r
255                                 <type>\r
256                                         <use>texture[6]/type</use>\r
257                                 </type>\r
258                                 <image>\r
259                                         <use>texture[6]/image</use>\r
260                                 </image>\r
261                                 <filter>\r
262                                         <use>texture[6]/filter</use>\r
263                                 </filter>\r
264                                 <wrap-s>\r
265                                         <use>texture[6]/wrap-s</use>\r
266                                 </wrap-s>\r
267                                 <wrap-t>\r
268                                         <use>texture[6]/wrap-t</use>\r
269                                 </wrap-t>\r
270                         </texture-unit>\r
271 \r
272                         <texture-unit>\r
273                                 <unit>7</unit>\r
274                                 <type>\r
275                                         <use>texture[7]/type</use>\r
276                                 </type>\r
277                                 <image>\r
278                                         <use>texture[7]/image</use>\r
279                                 </image>\r
280                                 <filter>\r
281                                         <use>texture[7]/filter</use>\r
282                                 </filter>\r
283                                 <wrap-s>\r
284                                         <use>texture[7]/wrap-s</use>\r
285                                 </wrap-s>\r
286                                 <wrap-t>\r
287                                         <use>texture[7]/wrap-t</use>\r
288                                 </wrap-t>\r
289                         </texture-unit>\r
290 \r
291                         <texture-unit>\r
292                                 <unit>8</unit>\r
293                                 <image>\r
294                                         <use>texture[8]/image</use>\r
295                                 </image>\r
296                                 <filter>\r
297                                         <use>texture[8]/filter</use>\r
298                                 </filter>\r
299                                 <wrap-s>\r
300                                         <use>texture[8]/wrap-s</use>\r
301                                 </wrap-s>\r
302                                 <wrap-t>\r
303                                         <use>texture[8]/wrap-t</use>\r
304                                 </wrap-t>\r
305                                 <internal-format>\r
306                                         <use>texture[0]/internal-format</use>\r
307                                 </internal-format>\r
308                         </texture-unit>\r
309 \r
310                         <texture-unit>\r
311                                 <unit>9</unit>\r
312                                 <type>noise</type>\r
313                         </texture-unit>\r
314 \r
315 \r
316                         <program>\r
317                                 <vertex-shader>Shaders/include_fog.vert</vertex-shader>\r
318                                 <vertex-shader>Shaders/reflect-bump-spec.vert</vertex-shader>\r
319                                 <fragment-shader>Shaders/include_fog.frag</fragment-shader>\r
320                                 <fragment-shader>Shaders/reflect-bump-spec.frag</fragment-shader>\r
321                                 <attribute>\r
322                                         <name>tangent</name>\r
323                                         <index>6</index>\r
324                                 </attribute>\r
325                                 <attribute>\r
326                                         <name>binormal</name>\r
327                                         <index>7</index>\r
328                                 </attribute>\r
329                         </program>\r
330 \r
331                         <uniform>\r
332                                 <name>BaseTex</name>\r
333                                 <type>sampler-2d</type>\r
334                                 <value type="int">0</value>\r
335                         </uniform>\r
336 \r
337                         <uniform>\r
338                                 <name>NormalTex</name>\r
339                                 <type>sampler-2d</type>\r
340                                 <value type="int">4</value>\r
341                         </uniform>\r
342 \r
343                         <uniform>\r
344                                 <name>Environment</name>\r
345                                 <type>sampler-cube</type>\r
346                                 <value type="int">5</value>\r
347                         </uniform>\r
348 \r
349                         <uniform>\r
350                                 <name>Rainbow</name>\r
351                                 <type>sampler-2d</type>\r
352                                 <value type="int">6</value>\r
353                         </uniform>\r
354 \r
355                         <uniform>\r
356                                 <name>Fresnel</name>\r
357                                 <type>sampler-2d</type>\r
358                                 <value type="int">7</value>\r
359                         </uniform>\r
360 \r
361                         <uniform>\r
362                                 <name>Map</name>\r
363                                 <type>sampler-2d</type>\r
364                                 <value type="int">8</value>\r
365                         </uniform>\r
366 \r
367                         <uniform>\r
368                                 <name>Noise</name>\r
369                                 <type>sampler-3d</type>\r
370                                 <value type="int">9</value>\r
371                         </uniform>\r
372 \r
373                         <!-- set the amount of fringing colour 0.0 - 1.0 -->\r
374                         <uniform>\r
375                                 <name>rainbowiness</name>\r
376                                 <type>float</type>\r
377                                 <value>\r
378                                         <use>rainbowiness</use>\r
379                                 </value>\r
380                         </uniform>\r
381 \r
382                         <!-- set the amount of fresnel effect colour 0.0 - 1.0 -->\r
383                         <uniform>\r
384                                 <name>fresneliness</name>\r
385                                 <type>float</type>\r
386                                 <value>\r
387                                         <use>fresneliness</use>\r
388                                 </value>\r
389                         </uniform>\r
390 \r
391                         <!-- set the amount of noisiness 0.0 - 1.0 -->\r
392                         <uniform>\r
393                                 <name>noisiness</name>\r
394                                 <type>float</type>\r
395                                 <value>\r
396                                         <use>noisiness</use>\r
397                                 </value>\r
398                         </uniform>\r
399 \r
400                         <!-- The reflection is set proportional to the shininess of the material.\r
401                         The amount of reflection may be adjusted by the use of this correction\r
402                         -1.0 (fully transparent)- 1.0 (fully opaque) -->\r
403                         <uniform>\r
404                                 <name>refl_correction</name>\r
405                                 <type>float</type>\r
406                                 <value>\r
407                                         <use>refl_correction</use>\r
408                                 </value>\r
409                         </uniform>\r
410 \r
411                         <!-- set the amount of ambient light correction 0.0 - 1.0  -->\r
412                         <uniform>\r
413                                 <name>ambient_correction</name>\r
414                                 <type>float</type>\r
415                                 <value>\r
416                                         <use>ambient_correction</use>\r
417                                 </value>\r
418                         </uniform>\r
419 \r
420                         <!-- use a reflection map-->\r
421                         <uniform>\r
422                                 <name>reflect_map</name>\r
423                                 <type>float</type>\r
424                                 <value>\r
425                                         <use>reflect_map</use>\r
426                                 </value>\r
427                         </uniform>\r
428 \r
429                         <!-- normalmap is .dds-->\r
430                         <uniform>\r
431                                 <name>normalmap_dds</name>\r
432                                 <type>float</type>\r
433                                 <value>\r
434                                         <use>normalmap_dds</use>\r
435                                 </value>\r
436                         </uniform>\r
437 \r
438                         <uniform>\r
439                                 <name>visibility</name>\r
440                                 <type>float</type>\r
441                                 <value>\r
442                                         <use>visibility</use>\r
443                                 </value>\r
444                         </uniform>\r
445                         <uniform>\r
446                                 <name>avisibility</name>\r
447                                 <type>float</type>\r
448                                 <value>\r
449                                         <use>avisibility</use>\r
450                                 </value>\r
451                         </uniform>\r
452                         <uniform>\r
453                                 <name>hazeLayerAltitude</name>\r
454                                 <type>float</type>\r
455                                 <value>\r
456                                         <use>lthickness</use>\r
457                                 </value>\r
458                         </uniform>\r
459                         <uniform>\r
460                                 <name>scattering</name>\r
461                                 <type>float</type>\r
462                                 <value>\r
463                                         <use>scattering</use>\r
464                                 </value>\r
465                         </uniform>\r
466                         <uniform>\r
467                                 <name>terminator</name>\r
468                                 <type>float</type>\r
469                                 <value>\r
470                                         <use>terminator</use>\r
471                                 </value>\r
472                         </uniform>\r
473                         <uniform>\r
474                                 <name>fogType</name>\r
475                                 <type>int</type>\r
476                                 <value>\r
477                                         <use>fogtype</use>\r
478                                 </value>\r
479                         </uniform>\r
480                 </pass>\r
481         </technique>\r
482 </PropertyList>