tweak random building reflections
[fg:toms-fgdata.git] / Effects / building.eff
1 <?xml version="1.0" encoding="utf-8"?>
2 <PropertyList>
3   <name>Effects/building</name>
4   <inherits-from>Effects/model-combined-deferred</inherits-from>
5   <parameters>
6     <texture n="0">
7       <type>2d</type>
8       <image>Textures/buildings.png</image>
9       <filter>linear-mipmap-linear</filter>
10       <wrap-s>clamp</wrap-s>
11       <wrap-t>clamp</wrap-t>
12       <internal-format>normalized</internal-format>
13     </texture>
14     <!-- Normal Map -->
15     <normalmap-enabled type="int"> 0 </normalmap-enabled>
16     <normalmap-dds type="int"> 0 </normalmap-dds>
17     <normalmap-tiling type="float"> 1.0 </normalmap-tiling>
18     <!-- Light Map -->
19     <texture n="3">
20       <image>Textures/buildings-lightmap.png</image>
21       <filter>linear-mipmap-linear</filter>
22       <wrap-s>clamp</wrap-s>
23       <wrap-t>clamp</wrap-t>
24       <internal-format>normalized</internal-format>
25     </texture>
26     <lightmap-enabled type="int"> 1 </lightmap-enabled>
27     <lightmap-multi type="int"> 0 </lightmap-multi>
28     <lightmap-factor type="float" n="0">
29       <use>/sim/time/sun-angle-rad</use>
30     </lightmap-factor>
31     <lightmap-color type="vec3d" n="0"> 0.3 0.3 0.3 </lightmap-color>
32     <!--<lightmap-factor type="float" n="1">1.0</lightmap-factor>
33     <lightmap-color type="vec3d" n="1"> 1.0 1.0 1.0 </lightmap-color>
34     <lightmap-factor type="float" n="2">1.0</lightmap-factor>
35     <lightmap-color type="vec3d" n="2"> 1.0 1.0 1.0 </lightmap-color>
36     <lightmap-factor type="float" n="3">1.0</lightmap-factor>
37     <lightmap-color type="vec3d" n="3"> 1.0 1.0 1.0 </lightmap-color>-->
38     <!-- Reflection -->
39     <reflection-enabled type="int"> 1 </reflection-enabled>
40     <reflect-map-enabled type="int"> 1 </reflect-map-enabled>
41     <reflection-correction type="float"> 0.10 </reflection-correction>
42     <reflection-dynamic type="int"> 0 </reflection-dynamic>
43     <reflection-fresnel type="float"> 0.0 </reflection-fresnel>
44     <reflection-rainbow type="float"> 0.0 </reflection-rainbow>
45     <reflection-noise type="float"> 0.0 </reflection-noise>
46         <texture n= "5" >
47                 <type>cubemap</type>
48                 <images>
49                         <positive-x>Aircraft/Generic/Effects/CubeMaps/fgfs-sky/1.png</positive-x>
50                         <negative-x>Aircraft/Generic/Effects/CubeMaps/fgfs-sky/4.png</negative-x>
51                         <positive-y>Aircraft/Generic/Effects/CubeMaps/fgfs-sky/2.png</positive-y>
52                         <negative-y>Aircraft/Generic/Effects/CubeMaps/fgfs-sky/3.png</negative-y>
53                         <positive-z>Aircraft/Generic/Effects/CubeMaps/fgfs-sky/6.png</positive-z>
54                         <negative-z>Aircraft/Generic/Effects/CubeMaps/fgfs-sky/5.png</negative-z>
55                 </images>
56         </texture>
57     <!--Ambient correction -->
58     <ambient-correction type="float"> 0.0 </ambient-correction>
59     <dirt-enabled type="int"> 0 </dirt-enabled>
60     <dirt-color type="vec3d"> 0.0 0.0 0.0 </dirt-color>
61     <dirt-factor type="float"> 0.0 </dirt-factor>
62     <material>
63       <active>true</active>
64       <color-mode-uniform>1</color-mode-uniform>
65       <ambient type="vec4d">0.6 0.6 0.6 1.0</ambient>
66       <diffuse type="vec4d">1.0 1.0 1.0 1.0</diffuse>
67       <specular type="vec4d">0.0 0.0 0.0 1.0</specular>
68       <emissive type="vec4d">0.02 0.02 0.02 1.0</emissive>
69       <shininess>0.0</shininess>
70       <color-mode>ambient-and-diffuse</color-mode>
71       <color-mode-uniform>ambient-and-diffuse</color-mode-uniform>
72       <!-- DIFFUSE -->
73           </material>
74           <material-id>0</material-id>
75           <blend>
76       <active>0</active>
77       <source>0</source>
78       <destination>0</destination>
79           </blend>
80           <shade-model>flat</shade-model>
81           <cull-face>back</cull-face>
82           <rendering-hint>opaque</rendering-hint>
83                 <!--    fog include for atmospheric scattering-->
84                 <visibility><use>/environment/ground-visibility-m</use></visibility>
85                 <avisibility><use>/environment/visibility-m</use></avisibility>
86                 <lthickness><use>/environment/ground-haze-thickness-m</use></lthickness>
87                 <scattering><use>/rendering/scene/scattering</use></scattering>
88                 <ground_scattering><use>/environment/surface/scattering</use></ground_scattering>
89                 <terminator><use>/environment/terminator-relative-position-m</use></terminator>
90                 <fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
91                 <terrain_alt><use>/environment/mean-terrain-elevation-m</use></terrain_alt>
92     <overcast><use>/rendering/scene/overcast</use></overcast>
93     <eye_alt><use>/sim/rendering/eye-altitude-m</use></eye_alt>
94                 <mysnow_level><use>/environment/mysnow-level-m</use></mysnow_level>
95                 <dust_cover_factor><use>/environment/surface/dust-cover-factor</use></dust_cover_factor>
96                 <fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
97                 <fogstructure><use>/environment/fog-structure</use></fogstructure>
98                 <!--    END fog include -->
99   </parameters>
100
101   <!-- Atmospheric scattering technique -->
102   <technique n="5">
103     <predicate>
104       <and>
105         <property>/sim/rendering/shaders/skydome</property>
106         <or>
107           <less-equal>
108             <value type="float">2.0</value>
109             <glversion/>
110           </less-equal>
111           <and>
112             <extension-supported>GL_ARB_shader_objects</extension-supported>
113             <extension-supported>GL_ARB_shading_language_100</extension-supported>
114             <extension-supported>GL_ARB_vertex_shader</extension-supported>
115             <extension-supported>GL_ARB_fragment_shader</extension-supported>
116           </and>
117         </or>
118       </and>
119     </predicate>
120
121     <pass>
122       <lighting>true</lighting>
123       <material>
124         <ambient><use>material/ambient</use></ambient>
125         <diffuse><use>material/diffuse</use></diffuse>
126         <specular><use>material/specular</use></specular>
127         <emissive><use>material/emissive</use></emissive>
128         <shininess><use>material/shininess</use></shininess>
129         <color-mode>ambient-and-diffuse</color-mode>
130       </material>
131       <alpha-test>false</alpha-test>
132       <shade-model>flat</shade-model>
133       <cull-face>back</cull-face>
134       <render-bin>
135         <bin-number>-1</bin-number>
136         <bin-name>RenderBin</bin-name>
137       </render-bin>
138       <texture-unit>
139         <unit>0</unit>
140           <image><use>texture[0]/image</use></image>
141           <filter><use>texture[0]/filter</use></filter>
142           <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
143           <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
144           <internal-format>
145             <use>texture[0]/internal-format</use>
146           </internal-format>
147       </texture-unit>
148       <program>
149         <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
150         <vertex-shader n="1">Shaders/default.vert</vertex-shader>
151         <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
152         <fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>
153       </program>
154       <uniform>
155         <name>texture</name>
156         <type>sampler-2d</type>
157         <value type="int">0</value>
158       </uniform>
159       <color-mask type="vec4d">0 0 0 0</color-mask>
160     </pass>
161     <pass>
162       <lighting>true</lighting>
163       <material>
164         <ambient><use>material/ambient</use></ambient>
165         <diffuse><use>material/diffuse</use></diffuse>
166         <specular><use>material/specular</use></specular>
167         <emissive><use>material/emissive</use></emissive>
168         <shininess><use>material/shininess</use></shininess>
169         <color-mode>ambient-and-diffuse</color-mode>
170       </material>
171       <blend>false</blend>
172       <alpha-test>false</alpha-test>
173       <shade-model>flat</shade-model>
174       <cull-face>back</cull-face>
175       <render-bin>
176         <bin-number><use>render-bin/bin-number</use></bin-number>
177         <bin-name><use>render-bin/bin-name</use></bin-name>
178       </render-bin>
179       <texture-unit>
180         <unit>0</unit>
181           <image><use>texture[0]/image</use></image>
182           <filter><use>texture[0]/filter</use></filter>
183           <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
184           <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
185           <internal-format>
186             <use>texture[0]/internal-format</use>
187           </internal-format>
188       </texture-unit>
189       <program>
190         <vertex-shader>Shaders/terrain-haze.vert</vertex-shader>
191         <fragment-shader>Shaders/terrain-haze.frag</fragment-shader>
192       </program>
193       <uniform>
194         <name>visibility</name>
195         <type>float</type>
196         <value><use>visibility</use></value>
197       </uniform>
198       <uniform>
199         <name>avisibility</name>
200         <type>float</type>
201         <value><use>avisibility</use></value>
202       </uniform>
203        <uniform>
204         <name>hazeLayerAltitude</name>
205         <type>float</type>
206         <value><use>lthickness</use></value>
207       </uniform>
208       <uniform>
209         <name>scattering</name>
210         <type>float</type>
211         <value><use>scattering</use></value>
212       </uniform>
213       <uniform>
214         <name>ground_scattering</name>
215         <type>float</type>
216         <value><use>ground_scattering</use></value>
217       </uniform>
218       <uniform>
219         <name>terminator</name>
220         <type>float</type>
221         <value><use>terminator</use></value>
222       </uniform>
223       <uniform>
224         <name>terrain_alt</name>
225         <type>float</type>
226         <value><use>terrain_alt</use></value>
227       </uniform>
228       <uniform>
229         <name>overcast</name>
230         <type>float</type>
231         <value><use>overcast</use></value>
232       </uniform>
233      <uniform>
234         <name>eye_alt</name>
235         <type>float</type>
236         <value><use>eye_alt</use></value>
237       </uniform>
238       <uniform>
239         <name>texture</name>
240         <type>sampler-2d</type>
241         <value type="int">0</value>
242       </uniform>
243       <uniform>
244         <name>colorMode</name>
245         <type>int</type>
246         <value>2</value> <!-- AMBIENT_AND_DIFFUSE -->
247       </uniform>
248       <depth>
249         <function>lequal</function>
250         <write-mask type="bool">false</write-mask>
251       </depth>
252     </pass>
253   </technique>
254
255   <technique n="8">
256         <pass>
257           <texture-unit n="4">
258                 <unit>4</unit>
259                 <image>
260                   <use>texture[3]/image</use>
261                 </image>
262                 <filter>
263                   <use>texture[3]/filter</use>
264                 </filter>
265                 <wrap-s>
266                   <use>texture[3]/wrap-s</use>
267                 </wrap-s>
268                 <wrap-t>
269                   <use>texture[3]/wrap-t</use>
270                 </wrap-t>
271                 <internal-format>
272                   <use>texture[3]/internal-format</use>
273                 </internal-format>
274           </texture-unit>
275         </pass>
276   </technique>
277   <technique n="9">
278         <pass>
279           <texture-unit n="4">
280                 <unit>4</unit>
281                 <image>
282                   <use>texture[3]/image</use>
283                 </image>
284                 <filter>
285                   <use>texture[3]/filter</use>
286                 </filter>
287                 <wrap-s>
288                   <use>texture[3]/wrap-s</use>
289                 </wrap-s>
290                 <wrap-t>
291                   <use>texture[3]/wrap-t</use>
292                 </wrap-t>
293                 <internal-format>
294                   <use>texture[3]/internal-format</use>
295                 </internal-format>
296           </texture-unit>
297         </pass>
298   </technique>
299 </PropertyList>