Improved Random building texturesa - Gabo Huerta
[fg:toms-fgdata.git] / Effects / urban.eff
1 <?xml version="1.0" encoding="utf-8"?>
2 <PropertyList>
3         <name>Effects/urban</name>
4         <inherits-from>Effects/terrain-default</inherits-from>
5         <parameters>
6                 <snow-level>
7                         <use>/environment/snow-level-m</use>
8                 </snow-level>
9                 <depth-factor type="float">0.008</depth-factor>
10                 <night-color type="vec3d">1 1 0.50</night-color>
11                 <random-buildings type="bool">
12                         <use>/sim/rendering/random-buildings</use>
13                 </random-buildings>
14                 <quality-level>
15                         <use>/sim/rendering/shaders/urban</use>
16                 </quality-level>
17                 <!--fog include-->
18                 <visibility>
19                         <use>/environment/ground-visibility-m</use>
20                 </visibility>
21                 <avisibility>
22                         <use>/environment/visibility-m</use>
23                 </avisibility>
24                 <lthickness>
25                         <use>/environment/ground-haze-thickness-m</use>
26                 </lthickness>
27                 <scattering>
28                         <use>/rendering/scene/scattering</use>
29                 </scattering>
30                 <terminator>
31                         <use>/environment/terminator-relative-position-m</use>
32                 </terminator>
33                 <fogtype>
34                         <use>/sim/rendering/shaders/skydome</use>
35                 </fogtype>
36                 <!--    END fog include -->
37         </parameters>
38         <generate>
39                 <normal type="int">15</normal>
40                 <tangent type="int">6</tangent>
41                 <!--<binormal type="int">7</binormal>-->
42         </generate>
43
44
45         <technique n="1">
46                 <predicate>
47                         <and>
48                                 <property>/sim/rendering/shaders/skydome</property>
49                                 <property>/sim/rendering/shaders/urban</property>
50                                 <less-equal>
51                                         <value type="float">4.0</value>
52                                         <float-property>/sim/rendering/shaders/urban</float-property>
53                                 </less-equal>
54                                 <or>
55                                         <less-equal>
56                                                 <value type="float">2.0</value>
57                                                 <glversion/>
58                                         </less-equal>
59                                         <and>
60                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
61                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
62                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
63                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
64                                         </and>
65                                 </or>
66                                 <or>
67                                         <extension-supported>GL_ATI_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
68                                         <extension-supported>GL_ARB_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
69                                         <extension-supported>GL_EXT_gpu_shader4</extension-supported>
70                                 </or>
71                         </and>
72                 </predicate>
73                 <pass>
74                         <lighting>true</lighting>
75                         <material>
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                                 <color-mode>ambient-and-diffuse</color-mode>
86                         </material>
87                         <blend>
88                                 <use>transparent</use>
89                         </blend>
90                         <alpha-test>
91                                 <use>transparent</use>
92                         </alpha-test>
93                         <shade-model>smooth</shade-model>
94                         <cull-face>back</cull-face>
95                         <render-bin>
96                                 <bin-number>
97                                         <use>render-bin/bin-number</use>
98                                 </bin-number>
99                                 <bin-name>
100                                         <use>render-bin/bin-name</use>
101                                 </bin-name>
102                         </render-bin>
103                         <texture-unit>
104                                 <unit>0</unit>
105                                 <image>
106                                         <use>texture[0]/image</use>
107                                 </image>
108                                 <type>
109                                   <use>texture[0]/type</use>
110                                 </type>
111                                 <filter>
112                                         <use>texture[0]/filter</use>
113                                 </filter>
114                                 <wrap-s>
115                                         <use>texture[0]/wrap-s</use>
116                                 </wrap-s>
117                                 <wrap-t>
118                                         <use>texture[0]/wrap-t</use>
119                                 </wrap-t>
120                                 <internal-format>
121                                         <use>texture[0]/internal-format</use>
122                                 </internal-format>
123                         </texture-unit>
124                         <texture-unit>
125                                 <unit>1</unit>
126                                 <image>
127                                         <use>texture[2]/image</use>
128                                 </image>
129                                 <type>
130                                   <use>texture[2]/type</use>
131                                 </type>
132                                 <filter>
133                                         <use>texture[2]/filter</use>
134                                 </filter>
135                                 <wrap-s>
136                                         <use>texture[2]/wrap-s</use>
137                                 </wrap-s>
138                                 <wrap-t>
139                                         <use>texture[2]/wrap-t</use>
140                                 </wrap-t>
141                                 <internal-format>
142                                         <use>texture[2]/internal-format</use>
143                                 </internal-format>
144                         </texture-unit>
145                         <texture-unit>
146                                 <unit>2</unit>
147                                 <image>
148                                         <use>texture[2]/image</use>
149                                 </image>
150                                 <type>
151                                   <use>texture[2]/type</use>
152                                 </type>
153                                 <filter>nearest-mipmap-nearest</filter>
154                                 <wrap-s>
155                                         <use>texture[2]/wrap-s</use>
156                                 </wrap-s>
157                                 <wrap-t>
158                                         <use>texture[2]/wrap-t</use>
159                                 </wrap-t>
160                                 <internal-format>
161                                         <use>texture[2]/internal-format</use>
162                                 </internal-format>
163                                 <mipmap-control>
164                                         <function-r>average</function-r>
165                                         <function-g>average</function-g>
166                                         <function-b>average</function-b>
167                                         <function-a>min</function-a>
168                                 </mipmap-control>
169                         </texture-unit>
170                         <texture-unit>
171                                 <unit>3</unit>
172                                 <type>noise</type>
173                         </texture-unit>
174                         <program>
175                                 <vertex-shader>Shaders/urban-lightfield.vert</vertex-shader>
176
177                                 <fragment-shader>Shaders/urban-lightfield.frag</fragment-shader>
178                                 <attribute>
179                                         <name>tangent</name>
180                                         <index>6</index>
181                                 </attribute>
182                                 <!--<attribute>
183                                         <name>binormal</name>
184                                         <index>7</index>
185                                 </attribute>-->
186                                 <attribute>
187                                         <name>normal</name>
188                                         <index>15</index>
189                                 </attribute>
190                         </program>
191                         <uniform>
192                                 <name>BaseTex</name>
193                                 <type>sampler-2d</type>
194                                 <value type="int">0</value>
195                         </uniform>
196                         <uniform>
197                                 <name>NormalTex</name>
198                                 <type>sampler-2d</type>
199                                 <value type="int">1</value>
200                         </uniform>
201                         <uniform>
202                                 <name>QDMTex</name>
203                                 <type>sampler-2d</type>
204                                 <value type="int">2</value>
205                         </uniform>
206                         <uniform>
207                                 <name>NoiseTex</name>
208                                 <type>sampler-3d</type>
209                                 <value type="int">3</value>
210                         </uniform>
211                         <uniform>
212                                 <name>depth_factor</name>
213                                 <type>float</type>
214                                 <value>
215                                         <use>depth-factor</use>
216                                 </value>
217                         </uniform>
218                         <uniform>
219                                 <name>tile_size</name>
220                                 <type>float</type>
221                                 <value>
222                                         <use>xsize</use>
223                                 </value>
224                         </uniform>
225                         <uniform>
226                                 <name>night_color</name>
227                                 <type>float-vec3</type>
228                                 <value>
229                                         <use>night-color</use>
230                                 </value>
231                         </uniform>
232                         <uniform>
233                                 <name>quality_level</name>
234                                 <type>float</type>
235                                 <value>
236                                         <use>quality-level</use>
237                                 </value>
238                         </uniform>
239                         <uniform>
240                                 <name>snowlevel</name>
241                                 <type>float</type>
242                                 <value>
243                                         <use>snow-level</use>
244                                 </value>
245                         </uniform>
246                         <uniform>
247                                 <name>max_lod_level</name>
248                                 <type>float</type>
249                                 <value>
250                                         <use>max-lod-level</use>
251                                 </value>
252                         </uniform>
253                         <uniform>
254                                 <name>random_buildings</name>
255                                 <type>bool</type>
256                                 <value type="bool">
257                                         <use>random-buildings</use>
258                                 </value>
259                         </uniform>
260                         <!--        BEGIN fog include -->
261                         <uniform>
262                                 <name>visibility</name>
263                                 <type>float</type>
264                                 <value>
265                                         <use>visibility</use>
266                                 </value>
267                         </uniform>
268                         <uniform>
269                                 <name>avisibility</name>
270                                 <type>float</type>
271                                 <value>
272                                         <use>avisibility</use>
273                                 </value>
274                         </uniform>
275                         <uniform>
276                                 <name>hazeLayerAltitude</name>
277                                 <type>float</type>
278                                 <value>
279                                         <use>lthickness</use>
280                                 </value>
281                         </uniform>
282                         <uniform>
283                                 <name>scattering</name>
284                                 <type>float</type>
285                                 <value>
286                                         <use>scattering</use>
287                                 </value>
288                         </uniform>
289                         <uniform>
290                                  <name>ground_scattering</name>
291                                  <type>float</type>
292                                  <value><use>ground_scattering</use></value>
293                         </uniform>
294                         <uniform>
295                                 <name>terminator</name>
296                                 <type>float</type>
297                                 <value>
298                                         <use>terminator</use>
299                                 </value>
300                         </uniform>
301                          <uniform>
302                                 <name>terrain_alt</name>
303                                 <type>float</type>
304                                 <value><use>terrain_alt</use></value>
305                          </uniform>
306                          <uniform>
307                                  <name>overcast</name>
308                                  <type>float</type>
309                                  <value><use>overcast</use></value>
310                           </uniform>
311                           <uniform>
312                                  <name>eye_alt</name>
313                                  <type>float</type>
314                                  <value><use>eye_alt</use></value>
315                           </uniform>
316                           <uniform>
317                                  <name>snowlevel</name>
318                                  <type>float</type>
319                                  <value><use>snow_level</use></value>
320                           </uniform>
321                           <uniform>
322                                  <name>dust_cover_factor</name>
323                                  <type>float</type>
324                                  <value>        <use>dust_cover_factor</use></value>
325                           </uniform>
326                           <uniform>
327                                  <name>wetness</name>
328                                  <type>float</type>
329                                  <value><use>wetness</use></value>
330                           </uniform>
331                           <uniform>
332                                  <name>fogstructure</name>
333                                  <type>float</type>
334                                  <value><use>fogstructure</use></value>
335                           </uniform>
336                           <uniform>
337                                   <name>cloud_self_shading</name>
338                                   <type>float</type>
339                                    <value><use>cloud_self_shading</use></value>
340                           </uniform>
341                           <uniform>
342                                   <name>moonlight</name>
343                                   <type>float</type>
344                                   <value><use>moonlight</use></value>
345                            </uniform>
346
347                         <!--                    END fog include -->
348                 </pass>
349         </technique>
350
351
352         <technique n="2">
353                 <predicate>
354                         <and>
355                                 <property>/sim/rendering/shaders/skydome</property>
356                                 <property>/sim/rendering/shaders/urban</property>
357                                 <less-equal>
358                                         <value type="float">1.0</value>
359                                         <float-property>/sim/rendering/shaders/urban</float-property>
360                                 </less-equal>
361                                 <or>
362                                         <less-equal>
363                                                 <value type="float">2.0</value>
364                                                 <glversion/>
365                                         </less-equal>
366                                         <and>
367                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
368                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
369                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
370                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
371                                         </and>
372                                 </or>
373                                 <!-- quality level below 4.0 doesn't require GL_ATI_shader_texture_lod or GL_ARB_shader_texture_lod -->
374                         </and>
375                 </predicate>
376                 <pass>
377                         <lighting>true</lighting>
378                         <material>
379                                 <ambient>
380                                         <use>material/ambient</use>
381                                 </ambient>
382                                 <diffuse>
383                                         <use>material/diffuse</use>
384                                 </diffuse>
385                                 <specular>
386                                         <use>material/specular</use>
387                                 </specular>
388                                 <color-mode>ambient-and-diffuse</color-mode>
389                         </material>
390                         <blend>
391                                 <use>transparent</use>
392                         </blend>
393                         <alpha-test>
394                                 <use>transparent</use>
395                         </alpha-test>
396                         <shade-model>smooth</shade-model>
397                         <cull-face>back</cull-face>
398                         <render-bin>
399                                 <bin-number>
400                                         <use>render-bin/bin-number</use>
401                                 </bin-number>
402                                 <bin-name>
403                                         <use>render-bin/bin-name</use>
404                                 </bin-name>
405                         </render-bin>
406                         <texture-unit>
407                                 <unit>0</unit>
408                                 <image>
409                                         <use>texture[0]/image</use>
410                                 </image>
411                                 <type>
412                                   <use>texture[0]/type</use>
413                                 </type>
414                                 <filter>
415                                         <use>texture[0]/filter</use>
416                                 </filter>
417                                 <wrap-s>
418                                         <use>texture[0]/wrap-s</use>
419                                 </wrap-s>
420                                 <wrap-t>
421                                         <use>texture[0]/wrap-t</use>
422                                 </wrap-t>
423                                 <internal-format>
424                                         <use>texture[0]/internal-format</use>
425                                 </internal-format>
426                         </texture-unit>
427                         <texture-unit>
428                                 <unit>1</unit>
429                                 <image>
430                                         <use>texture[2]/image</use>
431                                 </image>
432                                 <type>
433                                   <use>texture[2]/type</use>
434                                 </type>
435                                 <filter>
436                                         <use>texture[2]/filter</use>
437                                 </filter>
438                                 <wrap-s>
439                                         <use>texture[2]/wrap-s</use>
440                                 </wrap-s>
441                                 <wrap-t>
442                                         <use>texture[2]/wrap-t</use>
443                                 </wrap-t>
444                                 <internal-format>
445                                         <use>texture[2]/internal-format</use>
446                                 </internal-format>
447                         </texture-unit>
448                         <texture-unit>
449                                 <unit>2</unit>
450                                 <type>noise</type>
451                         </texture-unit>
452                         <program>
453                                 <vertex-shader>Shaders/urban-lightfield.vert</vertex-shader>
454                                 <fragment-shader>Shaders/urban-lightfield.frag</fragment-shader>
455
456                                 <attribute>
457                                         <name>tangent</name>
458                                         <index>6</index>
459                                 </attribute>
460                                 <!--<attribute>
461                                         <name>binormal</name>
462                                         <index>7</index>
463                                 </attribute>-->
464                                 <attribute>
465                                         <name>normal</name>
466                                         <index>15</index>
467                                 </attribute>
468                         </program>
469                         <!--        BEGIN fog include -->
470                         <uniform>
471                                 <name>visibility</name>
472                                 <type>float</type>
473                                 <value>
474                                         <use>visibility</use>
475                                 </value>
476                         </uniform>
477                         <uniform>
478                                 <name>avisibility</name>
479                                 <type>float</type>
480                                 <value>
481                                         <use>avisibility</use>
482                                 </value>
483                         </uniform>
484                         <uniform>
485                                 <name>hazeLayerAltitude</name>
486                                 <type>float</type>
487                                 <value>
488                                         <use>lthickness</use>
489                                 </value>
490                         </uniform>
491                         <uniform>
492                                 <name>scattering</name>
493                                 <type>float</type>
494                                 <value>
495                                         <use>scattering</use>
496                                 </value>
497                         </uniform>
498                         <uniform>
499                                  <name>ground_scattering</name>
500                                  <type>float</type>
501                                  <value><use>ground_scattering</use></value>
502                         </uniform>
503                         <uniform>
504                                 <name>terminator</name>
505                                 <type>float</type>
506                                 <value>
507                                         <use>terminator</use>
508                                 </value>
509                         </uniform>
510
511                          <uniform>
512                                 <name>terrain_alt</name>
513                                 <type>float</type>
514                                 <value><use>terrain_alt</use></value>
515                          </uniform>
516                          <uniform>
517                                  <name>overcast</name>
518                                  <type>float</type>
519                                  <value><use>overcast</use></value>
520                           </uniform>
521                           <uniform>
522                                  <name>eye_alt</name>
523                                  <type>float</type>
524                                  <value><use>eye_alt</use></value>
525                           </uniform>
526                           <uniform>
527                                  <name>snowlevel</name>
528                                  <type>float</type>
529                                  <value><use>snow_level</use></value>
530                           </uniform>
531                           <uniform>
532                                  <name>dust_cover_factor</name>
533                                  <type>float</type>
534                                  <value>        <use>dust_cover_factor</use></value>
535                           </uniform>
536                           <uniform>
537                                  <name>wetness</name>
538                                  <type>float</type>
539                                  <value><use>wetness</use></value>
540                           </uniform>
541                           <uniform>
542                                  <name>fogstructure</name>
543                                  <type>float</type>
544                                  <value><use>fogstructure</use></value>
545                         </uniform>
546
547                         <!--                    END fog include -->
548                         <uniform>
549                                 <name>BaseTex</name>
550                                 <type>sampler-2d</type>
551                                 <value type="int">0</value>
552                         </uniform>
553                         <uniform>
554                                 <name>NormalTex</name>
555                                 <type>sampler-2d</type>
556                                 <value type="int">1</value>
557                         </uniform>
558                         <uniform>
559                                 <name>NoiseTex</name>
560                                 <type>sampler-3d</type>
561                                 <value type="int">2</value>
562                         </uniform>
563                         <uniform>
564                                 <name>depth_factor</name>
565                                 <type>float</type>
566                                 <value>
567                                         <use>depth-factor</use>
568                                 </value>
569                         </uniform>
570                         <uniform>
571                                 <name>tile_size</name>
572                                 <type>float</type>
573                                 <value>
574                                         <use>xsize</use>
575                                 </value>
576                         </uniform>
577                         <uniform>
578                                 <name>night_color</name>
579                                 <type>float-vec3</type>
580                                 <value>
581                                         <use>night-color</use>
582                                 </value>
583                         </uniform>
584                         <uniform>
585                                 <name>quality_level</name>
586                                 <type>float</type>
587                                 <value>
588                                         <use>quality-level</use>
589                                 </value>
590                         </uniform>
591                         <uniform>
592                                 <name>snowlevel</name>
593                                 <type>float</type>
594                                 <value>
595                                         <use>snow-level</use>
596                                 </value>
597                         </uniform>
598                         <uniform>
599                                   <name>cloud_self_shading</name>
600                                   <type>float</type>
601                                    <value><use>cloud_self_shading</use></value>
602                           </uniform>
603                           <uniform>
604                                   <name>moonlight</name>
605                                   <type>float</type>
606                                   <value><use>moonlight</use></value>
607                            </uniform>
608
609                         <uniform>
610                                 <name>random_buildings</name>
611                                 <type>bool</type>
612                                 <value type="bool">
613                                         <use>random-buildings</use>
614                                 </value>
615                         </uniform>
616                 </pass>
617         </technique>
618
619
620
621         <technique n="6">
622                 <predicate>
623                         <and>
624                                 <property>/sim/rendering/rembrandt/enabled</property>
625                                 <property>/sim/rendering/shaders/urban</property>
626                                 <less-equal>
627                                         <value type="float">4.0</value>
628                                         <float-property>/sim/rendering/shaders/urban</float-property>
629                                 </less-equal>
630                                 <or>
631                                         <less-equal>
632                                                 <value type="float">2.0</value>
633                                                 <glversion/>
634                                         </less-equal>
635                                         <and>
636                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
637                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
638                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
639                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
640                                         </and>
641                                 </or>
642                                 <or>
643                                         <extension-supported>GL_ATI_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
644                                         <extension-supported>GL_ARB_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
645                                         <extension-supported>GL_EXT_gpu_shader4</extension-supported>
646                                 </or>
647                         </and>
648                 </predicate>
649                 <pass>
650                         <lighting>false</lighting>
651                         <material>
652                                 <ambient>
653                                         <use>material/ambient</use>
654                                 </ambient>
655                                 <diffuse>
656                                         <use>material/diffuse</use>
657                                 </diffuse>
658                                 <specular>
659                                         <use>material/specular</use>
660                                 </specular>
661                                 <color-mode>ambient-and-diffuse</color-mode>
662                         </material>
663                         <blend>false</blend>
664                         <alpha-test>false</alpha-test>
665                         <shade-model>smooth</shade-model>
666                         <cull-face>back</cull-face>
667                         <render-bin>
668                                 <bin-number>0</bin-number>
669                                 <bin-name>RenderBin</bin-name>
670                         </render-bin>
671                         <texture-unit>
672                                 <unit>0</unit>
673                                 <image>
674                                         <use>texture[0]/image</use>
675                                 </image>
676                                 <type>
677                                   <use>texture[0]/type</use>
678                                 </type>
679                                 <filter>
680                                         <use>texture[0]/filter</use>
681                                 </filter>
682                                 <wrap-s>
683                                         <use>texture[0]/wrap-s</use>
684                                 </wrap-s>
685                                 <wrap-t>
686                                         <use>texture[0]/wrap-t</use>
687                                 </wrap-t>
688                                 <internal-format>
689                                         <use>texture[0]/internal-format</use>
690                                 </internal-format>
691                         </texture-unit>
692                         <texture-unit>
693                                 <unit>1</unit>
694                                 <image>
695                                         <use>texture[2]/image</use>
696                                 </image>
697                                 <type>
698                                   <use>texture[2]/type</use>
699                                 </type>
700                                 <filter>
701                                         <use>texture[2]/filter</use>
702                                 </filter>
703                                 <wrap-s>
704                                         <use>texture[2]/wrap-s</use>
705                                 </wrap-s>
706                                 <wrap-t>
707                                         <use>texture[2]/wrap-t</use>
708                                 </wrap-t>
709                                 <internal-format>
710                                         <use>texture[2]/internal-format</use>
711                                 </internal-format>
712                         </texture-unit>
713                         <texture-unit>
714                                 <unit>2</unit>
715                                 <image>
716                                         <use>texture[2]/image</use>
717                                 </image>
718                                 <type>
719                                         <use>texture[2]/type</use>
720                                 </type>
721                                 <filter>nearest-mipmap-nearest</filter>
722                                 <wrap-s>
723                                         <use>texture[2]/wrap-s</use>
724                                 </wrap-s>
725                                 <wrap-t>
726                                         <use>texture[2]/wrap-t</use>
727                                 </wrap-t>
728                                 <internal-format>
729                                         <use>texture[2]/internal-format</use>
730                                 </internal-format>
731                                 <mipmap-control>
732                                         <function-r>average</function-r>
733                                         <function-g>average</function-g>
734                                         <function-b>average</function-b>
735                                         <function-a>min</function-a>
736                                 </mipmap-control>
737                         </texture-unit>
738                         <texture-unit>
739                                 <unit>3</unit>
740                                 <type>noise</type>
741                         </texture-unit>
742                         <program>
743                                 <vertex-shader>Shaders/urban-gbuffer.vert</vertex-shader>
744                                 <fragment-shader>Shaders/urban-gbuffer.frag</fragment-shader>
745                                 <fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
746                                 <fragment-shader>Shaders/gbuffer-encode.frag</fragment-shader>
747                                 <attribute>
748                                         <name>tangent</name>
749                                         <index>6</index>
750                                 </attribute>
751                                 <attribute>
752                                         <name>binormal</name>
753                                         <index>7</index>
754                                 </attribute>
755                                 <attribute>
756                                         <name>normal</name>
757                                         <index>15</index>
758                                 </attribute>
759                         </program>
760                         <uniform>
761                                 <name>BaseTex</name>
762                                 <type>sampler-2d</type>
763                                 <value type="int">0</value>
764                         </uniform>
765                         <uniform>
766                                 <name>NormalTex</name>
767                                 <type>sampler-2d</type>
768                                 <value type="int">1</value>
769                         </uniform>
770                         <uniform>
771                                 <name>QDMTex</name>
772                                 <type>sampler-2d</type>
773                                 <value type="int">2</value>
774                         </uniform>
775                         <uniform>
776                                 <name>NoiseTex</name>
777                                 <type>sampler-3d</type>
778                                 <value type="int">3</value>
779                         </uniform>
780                         <uniform>
781                                 <name>depth_factor</name>
782                                 <type>float</type>
783                                 <value>
784                                         <use>depth-factor</use>
785                                 </value>
786                         </uniform>
787                         <uniform>
788                                 <name>tile_size</name>
789                                 <type>float</type>
790                                 <value>
791                                         <use>xsize</use>
792                                 </value>
793                         </uniform>
794                         <uniform>
795                                 <name>quality_level</name>
796                                 <type>float</type>
797                                 <value>
798                                         <use>quality-level</use>
799                                 </value>
800                         </uniform>
801                         <uniform>
802                                 <name>snowlevel</name>
803                                 <type>float</type>
804                                 <value>
805                                         <use>snow-level</use>
806                                 </value>
807                         </uniform>
808                         <uniform>
809                                 <name>max_lod_level</name>
810                                 <type>float</type>
811                                 <value>
812                                         <use>max-lod-level</use>
813                                 </value>
814                         </uniform>
815                         <uniform>
816                                 <name>random_buildings</name>
817                                 <type>bool</type>
818                                 <value type="bool">
819                                         <use>random-buildings</use>
820                                 </value>
821                         </uniform>
822                 </pass>
823         </technique>
824         <technique n="7">
825                 <predicate>
826                         <and>
827                                 <property>/sim/rendering/rembrandt/enabled</property>
828                                 <property>/sim/rendering/shaders/urban</property>
829                                 <less-equal>
830                                         <value type="float">1.0</value>
831                                         <float-property>/sim/rendering/shaders/urban</float-property>
832                                 </less-equal>
833                                 <or>
834                                         <less-equal>
835                                                 <value type="float">2.0</value>
836                                                 <glversion/>
837                                         </less-equal>
838                                         <and>
839                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
840                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
841                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
842                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
843                                         </and>
844                                 </or>
845                                 <!-- quality level below 4.0 doesn't require GL_ATI_shader_texture_lod or GL_ARB_shader_texture_lod -->
846                         </and>
847                 </predicate>
848                 <pass>
849                         <lighting>false</lighting>
850                         <material>
851                                 <ambient>
852                                         <use>material/ambient</use>
853                                 </ambient>
854                                 <diffuse>
855                                         <use>material/diffuse</use>
856                                 </diffuse>
857                                 <specular>
858                                         <use>material/specular</use>
859                                 </specular>
860                                 <color-mode>ambient-and-diffuse</color-mode>
861                         </material>
862                         <blend>false</blend>
863                         <alpha-test>false</alpha-test>
864                         <shade-model>smooth</shade-model>
865                         <cull-face>back</cull-face>
866                         <render-bin>
867                                 <bin-number>0</bin-number>
868                                 <bin-name>RenderBin</bin-name>
869                         </render-bin>
870                         <texture-unit>
871                                 <unit>0</unit>
872                                 <image>
873                                         <use>texture[0]/image</use>
874                                 </image>
875                                 <type>
876                                   <use>texture[0]/type</use>
877                                 </type>
878                                 <filter>
879                                         <use>texture[0]/filter</use>
880                                 </filter>
881                                 <wrap-s>
882                                         <use>texture[0]/wrap-s</use>
883                                 </wrap-s>
884                                 <wrap-t>
885                                         <use>texture[0]/wrap-t</use>
886                                 </wrap-t>
887                                 <internal-format>
888                                         <use>texture[0]/internal-format</use>
889                                 </internal-format>
890                         </texture-unit>
891                         <texture-unit>
892                                 <unit>1</unit>
893                                 <image>
894                                         <use>texture[2]/image</use>
895                                 </image>
896                                 <type>
897                                   <use>texture[2]/type</use>
898                                 </type>
899                                 <filter>
900                                         <use>texture[2]/filter</use>
901                                 </filter>
902                                 <wrap-s>
903                                         <use>texture[2]/wrap-s</use>
904                                 </wrap-s>
905                                 <wrap-t>
906                                         <use>texture[2]/wrap-t</use>
907                                 </wrap-t>
908                                 <internal-format>
909                                         <use>texture[2]/internal-format</use>
910                                 </internal-format>
911                         </texture-unit>
912                         <texture-unit>
913                                 <unit>2</unit>
914                                 <type>noise</type>
915                         </texture-unit>
916                         <program>
917                                 <vertex-shader>Shaders/urban-gbuffer.vert</vertex-shader>
918                                 <fragment-shader>Shaders/urban-gbuffer.frag</fragment-shader>
919                                 <fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
920                                 <fragment-shader>Shaders/gbuffer-encode.frag</fragment-shader>
921                                 <attribute>
922                                         <name>tangent</name>
923                                         <index>6</index>
924                                 </attribute>
925                                 <attribute>
926                                         <name>binormal</name>
927                                         <index>7</index>
928                                 </attribute>
929                                 <attribute>
930                                         <name>normal</name>
931                                         <index>15</index>
932                                 </attribute>
933                         </program>
934                         <uniform>
935                                 <name>BaseTex</name>
936                                 <type>sampler-2d</type>
937                                 <value type="int">0</value>
938                         </uniform>
939                         <uniform>
940                                 <name>NormalTex</name>
941                                 <type>sampler-2d</type>
942                                 <value type="int">1</value>
943                         </uniform>
944                         <uniform>
945                                 <name>NoiseTex</name>
946                                 <type>sampler-3d</type>
947                                 <value type="int">2</value>
948                         </uniform>
949                         <uniform>
950                                 <name>depth_factor</name>
951                                 <type>float</type>
952                                 <value>
953                                         <use>depth-factor</use>
954                                 </value>
955                         </uniform>
956                         <uniform>
957                                 <name>tile_size</name>
958                                 <type>float</type>
959                                 <value>
960                                         <use>xsize</use>
961                                 </value>
962                         </uniform>
963                         <uniform>
964                                 <name>night_color</name>
965                                 <type>float-vec3</type>
966                                 <value>
967                                         <use>night-color</use>
968                                 </value>
969                         </uniform>
970                         <uniform>
971                                 <name>quality_level</name>
972                                 <type>float</type>
973                                 <value>
974                                         <use>quality-level</use>
975                                 </value>
976                         </uniform>
977                         <uniform>
978                                 <name>snowlevel</name>
979                                 <type>float</type>
980                                 <value>
981                                         <use>snow-level</use>
982                                 </value>
983                         </uniform>
984                         <uniform>
985                                 <name>random_buildings</name>
986                                 <type>bool</type>
987                                 <value type="bool">
988                                         <use>random-buildings</use>
989                                 </value>
990                         </uniform>
991                 </pass>
992         </technique>
993         <technique n="8">
994                 <predicate>
995                         <and>
996                                 <property>/sim/rendering/shaders/quality-level</property>
997                                 <property>/sim/rendering/shaders/urban</property>
998                                 <less-equal>
999                                         <value type="float">4.0</value>
1000                                         <float-property>/sim/rendering/shaders/urban</float-property>
1001                                 </less-equal>
1002                                 <or>
1003                                         <less-equal>
1004                                                 <value type="float">2.0</value>
1005                                                 <glversion/>
1006                                         </less-equal>
1007                                         <and>
1008                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
1009                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
1010                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
1011                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
1012                                         </and>
1013                                 </or>
1014                                 <or>
1015                                         <extension-supported>GL_ATI_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
1016                                         <extension-supported>GL_ARB_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
1017                                         <extension-supported>GL_EXT_gpu_shader4</extension-supported>
1018                                 </or>
1019                         </and>
1020                 </predicate>
1021                 <pass>
1022                         <lighting>true</lighting>
1023                         <material>
1024                                 <ambient>
1025                                         <use>material/ambient</use>
1026                                 </ambient>
1027                                 <diffuse>
1028                                         <use>material/diffuse</use>
1029                                 </diffuse>
1030                                 <specular>
1031                                         <use>material/specular</use>
1032                                 </specular>
1033                                 <color-mode>ambient-and-diffuse</color-mode>
1034                         </material>
1035                         <blend>
1036                                 <use>transparent</use>
1037                         </blend>
1038                         <alpha-test>
1039                                 <use>transparent</use>
1040                         </alpha-test>
1041                         <shade-model>smooth</shade-model>
1042                         <cull-face>back</cull-face>
1043                         <render-bin>
1044                                 <bin-number>
1045                                         <use>render-bin/bin-number</use>
1046                                 </bin-number>
1047                                 <bin-name>
1048                                         <use>render-bin/bin-name</use>
1049                                 </bin-name>
1050                         </render-bin>
1051                         <texture-unit>
1052                                 <unit>0</unit>
1053                                 <image>
1054                                         <use>texture[0]/image</use>
1055                                 </image>
1056                                 <type>
1057                                   <use>texture[0]/type</use>
1058                                 </type>
1059                                 <filter>
1060                                         <use>texture[0]/filter</use>
1061                                 </filter>
1062                                 <wrap-s>
1063                                         <use>texture[0]/wrap-s</use>
1064                                 </wrap-s>
1065                                 <wrap-t>
1066                                         <use>texture[0]/wrap-t</use>
1067                                 </wrap-t>
1068                                 <internal-format>
1069                                         <use>texture[0]/internal-format</use>
1070                                 </internal-format>
1071                         </texture-unit>
1072                         <texture-unit>
1073                                 <unit>1</unit>
1074                                 <image>
1075                                         <use>texture[2]/image</use>
1076                                 </image>
1077                                 <type>
1078                                   <use>texture[2]/type</use>
1079                                 </type>
1080                                 <filter>
1081                                         <use>texture[2]/filter</use>
1082                                 </filter>
1083                                 <wrap-s>
1084                                         <use>texture[2]/wrap-s</use>
1085                                 </wrap-s>
1086                                 <wrap-t>
1087                                         <use>texture[2]/wrap-t</use>
1088                                 </wrap-t>
1089                                 <internal-format>
1090                                         <use>texture[2]/internal-format</use>
1091                                 </internal-format>
1092                         </texture-unit>
1093                         <texture-unit>
1094                                 <unit>2</unit>
1095                                 <image>
1096                                         <use>texture[2]/image</use>
1097                                 </image>
1098                                 <type>
1099                                         <use>texture[2]/type</use>
1100                                 </type>
1101                                 <filter>nearest-mipmap-nearest</filter>
1102                                 <wrap-s>
1103                                         <use>texture[2]/wrap-s</use>
1104                                 </wrap-s>
1105                                 <wrap-t>
1106                                         <use>texture[2]/wrap-t</use>
1107                                 </wrap-t>
1108                                 <internal-format>
1109                                         <use>texture[2]/internal-format</use>
1110                                 </internal-format>
1111                                 <mipmap-control>
1112                                         <function-r>average</function-r>
1113                                         <function-g>average</function-g>
1114                                         <function-b>average</function-b>
1115                                         <function-a>min</function-a>
1116                                 </mipmap-control>
1117                         </texture-unit>
1118                         <texture-unit>
1119                                 <unit>3</unit>
1120                                 <type>noise</type>
1121                         </texture-unit>
1122                         <program>
1123 <!--                            <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
1124                                 <vertex-shader n="1">Shaders/urban.vert</vertex-shader>
1125                                 <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
1126                                 <fragment-shader n="1">Shaders/urban.frag</fragment-shader>
1127                                 <attribute>
1128                                         <name>tangent</name>
1129                                         <index>6</index>
1130                                 </attribute>
1131                                 <attribute>
1132                                         <name>binormal</name>
1133                                         <index>7</index>
1134                                 </attribute>
1135                                 <attribute>
1136                                         <name>normal</name>
1137                                         <index>15</index>
1138                                 </attribute>
1139                         </program>
1140                         <uniform>
1141                                 <name>BaseTex</name>
1142                                 <type>sampler-2d</type>
1143                                 <value type="int">0</value>
1144                         </uniform>
1145                         <uniform>
1146                                 <name>NormalTex</name>
1147                                 <type>sampler-2d</type>
1148                                 <value type="int">1</value>
1149                         </uniform>
1150                         <uniform>
1151                                 <name>QDMTex</name>
1152                                 <type>sampler-2d</type>
1153                                 <value type="int">2</value>
1154                         </uniform>
1155                         <uniform>
1156                                 <name>NoiseTex</name>
1157                                 <type>sampler-3d</type>
1158                                 <value type="int">3</value>
1159                         </uniform>
1160                         <uniform>
1161                                 <name>depth_factor</name>
1162                                 <type>float</type>
1163                                 <value>
1164                                         <use>depth-factor</use>
1165                                 </value>
1166                         </uniform>
1167                         <uniform>
1168                                 <name>tile_size</name>
1169                                 <type>float</type>
1170                                 <value>
1171                                         <use>xsize</use>
1172                                 </value>
1173                         </uniform>
1174                         <uniform>
1175                                 <name>night_color</name>
1176                                 <type>float-vec3</type>
1177                                 <value>
1178                                         <use>night-color</use>
1179                                 </value>
1180                         </uniform>
1181                         <uniform>
1182                                 <name>quality_level</name>
1183                                 <type>float</type>
1184                                 <value>
1185                                         <use>quality-level</use>
1186                                 </value>
1187                         </uniform>
1188                         <uniform>
1189                                 <name>snowlevel</name>
1190                                 <type>float</type>
1191                                 <value>
1192                                         <use>snow-level</use>
1193                                 </value>
1194                         </uniform>
1195                         <uniform>
1196                                 <name>max_lod_level</name>
1197                                 <type>float</type>
1198                                 <value>
1199                                         <use>max-lod-level</use>
1200                                 </value>
1201                         </uniform>
1202                         <uniform>
1203                                 <name>random_buildings</name>
1204                                 <type>bool</type>
1205                                 <value type="bool">
1206                                         <use>random-buildings</use>
1207                                 </value>
1208                         </uniform>
1209                         <!--        BEGIN fog include -->
1210                         <uniform>
1211                                 <name>visibility</name>
1212                                 <type>float</type>
1213                                 <value>
1214                                         <use>visibility</use>
1215                                 </value>
1216                         </uniform>
1217                         <uniform>
1218                                 <name>avisibility</name>
1219                                 <type>float</type>
1220                                 <value>
1221                                         <use>avisibility</use>
1222                                 </value>
1223                         </uniform>
1224                         <uniform>
1225                                 <name>hazeLayerAltitude</name>
1226                                 <type>float</type>
1227                                 <value>
1228                                         <use>lthickness</use>
1229                                 </value>
1230                         </uniform>
1231                         <uniform>
1232                                 <name>scattering</name>
1233                                 <type>float</type>
1234                                 <value>
1235                                         <use>scattering</use>
1236                                 </value>
1237                         </uniform>
1238                         <uniform>
1239                                 <name>terminator</name>
1240                                 <type>float</type>
1241                                 <value>
1242                                         <use>terminator</use>
1243                                 </value>
1244                         </uniform>
1245                         <uniform>
1246                                 <name>fogType</name>
1247                                 <type>int</type>
1248                                 <value>
1249                                         <use>fogtype</use>
1250                                 </value>
1251                         </uniform>
1252                         <!--                    END fog include -->
1253                 </pass>
1254         </technique>
1255         <technique n="9">
1256                 <predicate>
1257                         <and>
1258                                 <property>/sim/rendering/shaders/quality-level</property>
1259                                 <property>/sim/rendering/shaders/urban</property>
1260                                 <less-equal>
1261                                         <value type="float">1.0</value>
1262                                         <float-property>/sim/rendering/shaders/urban</float-property>
1263                                 </less-equal>
1264                                 <or>
1265                                         <less-equal>
1266                                                 <value type="float">2.0</value>
1267                                                 <glversion/>
1268                                         </less-equal>
1269                                         <and>
1270                                                 <extension-supported>GL_ARB_shader_objects</extension-supported>
1271                                                 <extension-supported>GL_ARB_shading_language_100</extension-supported>
1272                                                 <extension-supported>GL_ARB_vertex_shader</extension-supported>
1273                                                 <extension-supported>GL_ARB_fragment_shader</extension-supported>
1274                                         </and>
1275                                 </or>
1276                                 <!-- quality level below 4.0 doesn't require GL_ATI_shader_texture_lod or GL_ARB_shader_texture_lod -->
1277                         </and>
1278                 </predicate>
1279                 <pass>
1280                         <lighting>true</lighting>
1281                         <material>
1282                                 <ambient>
1283                                         <use>material/ambient</use>
1284                                 </ambient>
1285                                 <diffuse>
1286                                         <use>material/diffuse</use>
1287                                 </diffuse>
1288                                 <specular>
1289                                         <use>material/specular</use>
1290                                 </specular>
1291                                 <color-mode>ambient-and-diffuse</color-mode>
1292                         </material>
1293                         <blend>
1294                                 <use>transparent</use>
1295                         </blend>
1296                         <alpha-test>
1297                                 <use>transparent</use>
1298                         </alpha-test>
1299                         <shade-model>smooth</shade-model>
1300                         <cull-face>back</cull-face>
1301                         <render-bin>
1302                                 <bin-number>
1303                                         <use>render-bin/bin-number</use>
1304                                 </bin-number>
1305                                 <bin-name>
1306                                         <use>render-bin/bin-name</use>
1307                                 </bin-name>
1308                         </render-bin>
1309                         <texture-unit>
1310                                 <unit>0</unit>
1311                                 <image>
1312                                         <use>texture[0]/image</use>
1313                                 </image>
1314                                 <type>
1315                                   <use>texture[0]/type</use>
1316                                 </type>
1317                                 <filter>
1318                                         <use>texture[0]/filter</use>
1319                                 </filter>
1320                                 <wrap-s>
1321                                         <use>texture[0]/wrap-s</use>
1322                                 </wrap-s>
1323                                 <wrap-t>
1324                                         <use>texture[0]/wrap-t</use>
1325                                 </wrap-t>
1326                                 <internal-format>
1327                                         <use>texture[0]/internal-format</use>
1328                                 </internal-format>
1329                         </texture-unit>
1330                         <texture-unit>
1331                                 <unit>1</unit>
1332                                 <image>
1333                                         <use>texture[2]/image</use>
1334                                 </image>
1335                                 <type>
1336                                   <use>texture[2]/type</use>
1337                                 </type>
1338                                 <filter>
1339                                         <use>texture[2]/filter</use>
1340                                 </filter>
1341                                 <wrap-s>
1342                                         <use>texture[2]/wrap-s</use>
1343                                 </wrap-s>
1344                                 <wrap-t>
1345                                         <use>texture[2]/wrap-t</use>
1346                                 </wrap-t>
1347                                 <internal-format>
1348                                         <use>texture[2]/internal-format</use>
1349                                 </internal-format>
1350                         </texture-unit>
1351                         <texture-unit>
1352                                 <unit>2</unit>
1353                                 <type>noise</type>
1354                         </texture-unit>
1355                         <program>
1356 <!--                            <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
1357                                 <vertex-shader n="1">Shaders/urban.vert</vertex-shader>
1358                                 <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
1359                                 <fragment-shader n="1">Shaders/urban.frag</fragment-shader>
1360                                 <attribute>
1361                                         <name>tangent</name>
1362                                         <index>6</index>
1363                                 </attribute>
1364                                 <attribute>
1365                                         <name>binormal</name>
1366                                         <index>7</index>
1367                                 </attribute>
1368                                 <attribute>
1369                                         <name>normal</name>
1370                                         <index>15</index>
1371                                 </attribute>
1372                         </program>
1373                         <!--        BEGIN fog include -->
1374                         <uniform>
1375                                 <name>visibility</name>
1376                                 <type>float</type>
1377                                 <value>
1378                                         <use>visibility</use>
1379                                 </value>
1380                         </uniform>
1381                         <uniform>
1382                                 <name>avisibility</name>
1383                                 <type>float</type>
1384                                 <value>
1385                                         <use>avisibility</use>
1386                                 </value>
1387                         </uniform>
1388                         <uniform>
1389                                 <name>hazeLayerAltitude</name>
1390                                 <type>float</type>
1391                                 <value>
1392                                         <use>lthickness</use>
1393                                 </value>
1394                         </uniform>
1395                         <uniform>
1396                                 <name>scattering</name>
1397                                 <type>float</type>
1398                                 <value>
1399                                         <use>scattering</use>
1400                                 </value>
1401                         </uniform>
1402                         <uniform>
1403                                 <name>terminator</name>
1404                                 <type>float</type>
1405                                 <value>
1406                                         <use>terminator</use>
1407                                 </value>
1408                         </uniform>
1409                         <uniform>
1410                                 <name>fogType</name>
1411                                 <type>int</type>
1412                                 <value>
1413                                         <use>fogtype</use>
1414                                 </value>
1415                         </uniform>
1416                         <!--                    END fog include -->
1417                         <uniform>
1418                                 <name>BaseTex</name>
1419                                 <type>sampler-2d</type>
1420                                 <value type="int">0</value>
1421                         </uniform>
1422                         <uniform>
1423                                 <name>NormalTex</name>
1424                                 <type>sampler-2d</type>
1425                                 <value type="int">1</value>
1426                         </uniform>
1427                         <uniform>
1428                                 <name>NoiseTex</name>
1429                                 <type>sampler-3d</type>
1430                                 <value type="int">2</value>
1431                         </uniform>
1432                         <uniform>
1433                                 <name>depth_factor</name>
1434                                 <type>float</type>
1435                                 <value>
1436                                         <use>depth-factor</use>
1437                                 </value>
1438                         </uniform>
1439                         <uniform>
1440                                 <name>tile_size</name>
1441                                 <type>float</type>
1442                                 <value>
1443                                         <use>xsize</use>
1444                                 </value>
1445                         </uniform>
1446                         <uniform>
1447                                 <name>night_color</name>
1448                                 <type>float-vec3</type>
1449                                 <value>
1450                                         <use>night-color</use>
1451                                 </value>
1452                         </uniform>
1453                         <uniform>
1454                                 <name>quality_level</name>
1455                                 <type>float</type>
1456                                 <value>
1457                                         <use>quality-level</use>
1458                                 </value>
1459                         </uniform>
1460                         <uniform>
1461                                 <name>snowlevel</name>
1462                                 <type>float</type>
1463                                 <value>
1464                                         <use>snow-level</use>
1465                                 </value>
1466                         </uniform>
1467                 </pass>
1468         </technique>
1469 </PropertyList>