Restore QDM urban shader technique for quality level >= 4
[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><use>/sim/rendering/snow-level-m</use></snow-level>
7     <depth-factor type="float">0.008</depth-factor>
8     <night-color type="vec3d">0.75 0.59 0.05</night-color>
9     <quality-level><use>/sim/rendering/quality-level</use></quality-level>
10   </parameters>
11   <generate>
12     <normal type="int">15</normal>
13     <tangent type="int">6</tangent>
14     <binormal type="int">7</binormal>
15   </generate>
16   <technique n="8">
17     <predicate>
18       <and>
19         <property>/sim/rendering/urban-shader</property>
20         <property>/sim/rendering/shader-effects</property>
21         <less-equal>
22           <value type="float">4.0</value>
23           <float-property>/sim/rendering/quality-level</float-property>
24         </less-equal>
25         <or>
26           <less-equal>
27             <value type="float">2.0</value>
28             <glversion/>
29           </less-equal>
30           <and>
31             <extension-supported>GL_ARB_shader_objects</extension-supported>
32             <extension-supported>GL_ARB_shading_language_100</extension-supported>
33             <extension-supported>GL_ARB_vertex_shader</extension-supported>
34             <extension-supported>GL_ARB_fragment_shader</extension-supported>
35           </and>
36         </or>
37       </and>
38     </predicate>
39     <pass>
40       <lighting>true</lighting>
41       <material>
42         <ambient><use>material/ambient</use></ambient>
43         <diffuse><use>material/diffuse</use></diffuse>
44         <specular><use>material/specular</use></specular>
45         <color-mode>ambient-and-diffuse</color-mode>
46       </material>
47       <blend><use>transparent</use></blend>
48       <alpha-test><use>transparent</use></alpha-test>
49       <shade-model>smooth</shade-model>
50       <cull-face>back</cull-face>
51       <render-bin>
52         <bin-number><use>render-bin/bin-number</use></bin-number>
53         <bin-name><use>render-bin/bin-name</use></bin-name>
54       </render-bin>
55       <texture-unit>
56         <unit>0</unit>
57           <image><use>texture[0]/image</use></image>
58           <filter><use>texture[0]/filter</use></filter>
59           <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
60           <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
61           <internal-format>
62             <use>texture[0]/internal-format</use>
63           </internal-format>
64       </texture-unit>
65       <texture-unit>
66         <unit>1</unit>
67           <image><use>texture[2]/image</use></image>
68           <filter><use>texture[2]/filter</use></filter>
69           <wrap-s><use>texture[2]/wrap-s</use></wrap-s>
70           <wrap-t><use>texture[2]/wrap-t</use></wrap-t>
71           <internal-format><use>texture[2]/internal-format</use></internal-format>
72       </texture-unit>
73       <texture-unit>
74         <unit>2</unit>
75           <image><use>texture[2]/image</use></image>
76           <filter>nearest-mipmap-nearest</filter>
77           <wrap-s><use>texture[2]/wrap-s</use></wrap-s>
78           <wrap-t><use>texture[2]/wrap-t</use></wrap-t>
79           <internal-format><use>texture[2]/internal-format</use></internal-format>
80                   <mipmap-control>
81                         <function-r>average</function-r>
82                         <function-g>average</function-g>
83                         <function-b>average</function-b>
84                         <function-a>min</function-a>
85                   </mipmap-control>
86       </texture-unit>
87       <texture-unit>
88         <unit>3</unit>
89         <type>noise</type>
90       </texture-unit>
91       <program>
92         <vertex-shader>Shaders/urban.vert</vertex-shader>
93         <fragment-shader>Shaders/urban.frag</fragment-shader>
94         <attribute>
95           <name>tangent</name>
96           <index>6</index>
97         </attribute>
98         <attribute>
99           <name>binormal</name>
100           <index>7</index>
101         </attribute>
102         <attribute>
103           <name>normal</name>
104           <index>15</index>
105         </attribute>
106       </program>
107       <uniform>
108         <name>BaseTex</name>
109         <type>sampler-2d</type>
110         <value type="int">0</value>
111       </uniform>
112       <uniform>
113         <name>NormalTex</name>
114         <type>sampler-2d</type>
115         <value type="int">1</value>
116       </uniform>
117       <uniform>
118         <name>QDMTex</name>
119         <type>sampler-2d</type>
120         <value type="int">2</value>
121       </uniform>
122       <uniform>
123         <name>NoiseTex</name>
124         <type>sampler-3d</type>
125         <value type="int">3</value>
126       </uniform>
127       <uniform>
128         <name>depth_factor</name>
129         <type>float</type>
130         <value><use>depth-factor</use></value>
131       </uniform>
132       <uniform>
133         <name>tile_size</name>
134         <type>float</type>
135         <value><use>xsize</use></value>
136       </uniform>
137       <uniform>
138         <name>night_color</name>
139         <type>float-vec3</type>
140         <value><use>night-color</use></value>
141       </uniform>
142       <uniform>
143         <name>quality_level</name>
144         <type>float</type>
145         <value><use>quality-level</use></value>
146       </uniform>
147       <uniform>
148         <name>snowlevel</name>
149         <type>float</type>
150         <value><use>snow-level</use></value>
151       </uniform>
152       <uniform>
153         <name>max_lod_level</name>
154         <type>float</type>
155         <value><use>max-lod-level</use></value>
156       </uniform>
157     </pass>
158   </technique>
159   <technique n="9">
160     <predicate>
161       <and>
162         <property>/sim/rendering/urban-shader</property>
163         <property>/sim/rendering/shader-effects</property>
164         <less-equal>
165           <value type="float">2.0</value>
166           <float-property>/sim/rendering/quality-level</float-property>
167         </less-equal>
168         <or>
169           <less-equal>
170             <value type="float">2.0</value>
171             <glversion/>
172           </less-equal>
173           <and>
174             <extension-supported>GL_ARB_shader_objects</extension-supported>
175             <extension-supported>GL_ARB_shading_language_100</extension-supported>
176             <extension-supported>GL_ARB_vertex_shader</extension-supported>
177             <extension-supported>GL_ARB_fragment_shader</extension-supported>
178           </and>
179         </or>
180       </and>
181     </predicate>
182     <pass>
183       <lighting>true</lighting>
184       <material>
185         <ambient><use>material/ambient</use></ambient>
186         <diffuse><use>material/diffuse</use></diffuse>
187         <specular><use>material/specular</use></specular>
188         <color-mode>ambient-and-diffuse</color-mode>
189       </material>
190       <blend><use>transparent</use></blend>
191       <alpha-test><use>transparent</use></alpha-test>
192       <shade-model>smooth</shade-model>
193       <cull-face>back</cull-face>
194       <render-bin>
195         <bin-number><use>render-bin/bin-number</use></bin-number>
196         <bin-name><use>render-bin/bin-name</use></bin-name>
197       </render-bin>
198       <texture-unit>
199         <unit>0</unit>
200           <image><use>texture[0]/image</use></image>
201           <filter><use>texture[0]/filter</use></filter>
202           <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
203           <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
204           <internal-format>
205             <use>texture[0]/internal-format</use>
206           </internal-format>
207       </texture-unit>
208       <texture-unit>
209         <unit>1</unit>
210           <image><use>texture[2]/image</use></image>
211           <filter><use>texture[2]/filter</use></filter>
212           <wrap-s><use>texture[2]/wrap-s</use></wrap-s>
213           <wrap-t><use>texture[2]/wrap-t</use></wrap-t>
214           <internal-format>
215             <use>texture[2]/internal-format</use>
216           </internal-format>
217       </texture-unit>
218       <texture-unit>
219         <unit>2</unit>
220         <type>noise</type>
221       </texture-unit>
222       <program>
223         <vertex-shader>Shaders/urban.vert</vertex-shader>
224         <fragment-shader>Shaders/urban.frag</fragment-shader>
225         <attribute>
226           <name>tangent</name>
227           <index>6</index>
228         </attribute>
229         <attribute>
230           <name>binormal</name>
231           <index>7</index>
232         </attribute>
233         <attribute>
234           <name>normal</name>
235           <index>15</index>
236         </attribute>
237       </program>
238       <uniform>
239         <name>BaseTex</name>
240         <type>sampler-2d</type>
241         <value type="int">0</value>
242       </uniform>
243       <uniform>
244         <name>NormalTex</name>
245         <type>sampler-2d</type>
246         <value type="int">1</value>
247       </uniform>
248       <uniform>
249         <name>NoiseTex</name>
250         <type>sampler-3d</type>
251         <value type="int">2</value>
252       </uniform>
253       <uniform>
254         <name>depth_factor</name>
255         <type>float</type>
256         <value><use>depth-factor</use></value>
257       </uniform>
258       <uniform>
259         <name>tile_size</name>
260         <type>float</type>
261         <value><use>xsize</use></value>
262       </uniform>
263       <uniform>
264         <name>night_color</name>
265         <type>float-vec3</type>
266         <value><use>night-color</use></value>
267       </uniform>
268       <uniform>
269         <name>quality_level</name>
270         <type>float</type>
271         <value><use>quality-level</use></value>
272       </uniform>
273       <uniform>
274         <name>snowlevel</name>
275         <type>float</type>
276         <value><use>snow-level</use></value>
277       </uniform>
278     </pass>
279   </technique>
280 </PropertyList>