glassrain.eff 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <PropertyList>
  3. <name>glassrain</name>
  4. <inherits-from>Effects/model-default</inherits-from>
  5. <parameters>
  6. <texture n="1">
  7. <image>Aircraft/Generic/Effects/window_frost.png</image>
  8. <type>2d</type>
  9. <filter>linear-mipmap-linear</filter>
  10. <wrap-s>repeat</wrap-s>
  11. <wrap-t>repeat</wrap-t>
  12. <internal-format>normalized</internal-format>
  13. </texture>
  14. <!-- placeholder for the function texture used for fogging, wiper area,...-->
  15. <texture n="2">
  16. <type>white</type>
  17. </texture>
  18. <!-- texture for reflections in the glass -->
  19. <texture n="3">
  20. <type>cubemap</type>
  21. <images>
  22. <positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
  23. <negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
  24. <positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
  25. <negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
  26. <positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
  27. <negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
  28. </images>
  29. </texture>
  30. <!-- placeholder lightmap texture for reflections in the glass -->
  31. <texture n="4">
  32. <type>cubemap</type>
  33. <images>
  34. <positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
  35. <negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
  36. <positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
  37. <negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
  38. <positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
  39. <negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
  40. </images>
  41. </texture>
  42. <glass-tint type="vec4d" n="0"> 1.0 1.0 1.0 1.0</glass-tint>
  43. <overlay-color type="vec3d" n="0"> 1.0 1.0 1.0</overlay-color>
  44. <splash-x><use>/environment/aircraft-effects/splash-vector-x</use></splash-x>
  45. <splash-y><use>/environment/aircraft-effects/splash-vector-y</use></splash-y>
  46. <splash-z><use>/environment/aircraft-effects/splash-vector-z</use></splash-z>
  47. <rnorm><use>/environment/rain-norm</use></rnorm>
  48. <gsnorm><use>/environment/aircraft-effects/ground-splash-norm</use></gsnorm>
  49. <frost-level><use>/environment/aircraft-effects/frost-level</use></frost-level>
  50. <surface-mapping-scheme type="int">0</surface-mapping-scheme>
  51. <fog-level><use>/environment/aircraft-effects/fog-level</use></fog-level>
  52. <use-wipers><use>/environment/aircraft-effects/use-wipers</use></use-wipers>
  53. <use-overlay><use>/environment/aircraft-effects/use-overlay</use></use-overlay>
  54. <overlay-alpha><use>/environment/aircraft-effects/overlay-alpha</use></overlay-alpha>
  55. <overlay-glare type="float">0.5</overlay-glare>
  56. <use-reflection type="int">0</use-reflection>
  57. <reflection-strength type="float">1.0</reflection-strength>
  58. <use-mask type="int">0</use-mask>
  59. <use-reflection-lightmap type="int">0</use-reflection-lightmap>
  60. <lightmap-multi type="int">0</lightmap-multi>
  61. <lightmap-factor type="float" n="0">1.0</lightmap-factor>
  62. <lightmap-color type="vec3d" n="0"> 1.0 1.0 1.0 </lightmap-color>
  63. <lightmap-factor type="float" n="1">1.0</lightmap-factor>
  64. <lightmap-color type="vec3d" n="1"> 1.0 1.0 1.0 </lightmap-color>
  65. <lightmap-factor type="float" n="2">1.0</lightmap-factor>
  66. <lightmap-color type="vec3d" n="2"> 1.0 1.0 1.0 </lightmap-color>
  67. <lightmap-factor type="float" n="3">1.0</lightmap-factor>
  68. <lightmap-color type="vec3d" n="3"> 1.0 1.0 1.0 </lightmap-color>
  69. </parameters>
  70. <technique n="4">
  71. <predicate>
  72. <and>
  73. <property>/sim/rendering/shaders/skydome</property>
  74. <or>
  75. <less-equal>
  76. <value type="float">2.0</value>
  77. <glversion/>
  78. </less-equal>
  79. <and>
  80. <extension-supported>GL_ARB_shader_objects</extension-supported>
  81. <extension-supported>GL_ARB_shading_language_100</extension-supported>
  82. <extension-supported>GL_ARB_vertex_shader</extension-supported>
  83. <extension-supported>GL_ARB_fragment_shader</extension-supported>
  84. </and>
  85. </or>
  86. </and>
  87. </predicate>
  88. <pass>
  89. <lighting>true</lighting>
  90. <depth>
  91. <write-mask type="bool">false</write-mask>
  92. </depth>
  93. <material>
  94. <active><use>material/active</use></active>
  95. <ambient><use>material/ambient</use></ambient>
  96. <diffuse><use>material/diffuse</use></diffuse>
  97. <specular><use>material/specular</use></specular>
  98. <emissive><use>material/emissive</use></emissive>
  99. <shininess><use>material/shininess</use></shininess>
  100. <color-mode><use>material/color-mode</use></color-mode>
  101. </material>
  102. <blend>
  103. <active><use>blend/active</use></active>
  104. <source><use>blend/source</use></source>
  105. <destination><use>blend/destination</use></destination>
  106. </blend>
  107. <shade-model><use>shade-model</use></shade-model>
  108. <cull-face><use>cull-face</use></cull-face>
  109. <rendering-hint><use>rendering-hint</use></rendering-hint>
  110. <render-bin>
  111. <bin-number>111</bin-number>
  112. <bin-name>DepthSortedBin</bin-name>
  113. </render-bin>
  114. <texture-unit>
  115. <!-- The texture unit is always active because the shaders expect
  116. that. -->
  117. <unit>0</unit>
  118. <type><use>texture[0]/type</use></type>
  119. <image><use>texture[0]/image</use></image>
  120. <filter><use>texture[0]/filter</use></filter>
  121. <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
  122. <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
  123. <internal-format> <use>texture[0]/internal-format</use> </internal-format>
  124. </texture-unit>
  125. <texture-unit>
  126. <unit>1</unit>
  127. <type><use>texture[1]/type</use></type>
  128. <image><use>texture[1]/image</use></image>
  129. <filter><use>texture[1]/filter</use></filter>
  130. <wrap-s><use>texture[1]/wrap-s</use></wrap-s>
  131. <wrap-t><use>texture[1]/wrap-t</use></wrap-t>
  132. <internal-format><use>texture[1]/internal-format</use></internal-format>
  133. </texture-unit>
  134. <texture-unit>
  135. <unit>2</unit>
  136. <type><use>texture[2]/type</use></type>
  137. <image><use>texture[2]/image</use></image>
  138. <filter><use>texture[2]/filter</use></filter>
  139. <wrap-s><use>texture[2]/wrap-s</use></wrap-s>
  140. <wrap-t><use>texture[2]/wrap-t</use></wrap-t>
  141. <internal-format><use>texture[2]/internal-format</use></internal-format>
  142. </texture-unit>
  143. <texture-unit>
  144. <unit>3</unit>
  145. <type><use>texture[3]/type</use></type>
  146. <images><use>texture[3]/images</use></images>
  147. </texture-unit>
  148. <texture-unit>
  149. <unit>4</unit>
  150. <type><use>texture[4]/type</use></type>
  151. <images><use>texture[4]/images</use></images>
  152. </texture-unit>
  153. <vertex-program-two-side>
  154. <use>vertex-program-two-side</use>
  155. </vertex-program-two-side>
  156. <program>
  157. <vertex-shader>Shaders/glass-ALS.vert</vertex-shader>
  158. <fragment-shader>Shaders/glass-ALS.frag</fragment-shader>
  159. <fragment-shader>Shaders/noise.frag</fragment-shader>
  160. <fragment-shader>Shaders/filters-ALS.frag</fragment-shader>
  161. </program>
  162. <uniform>
  163. <name>tint</name>
  164. <type>float-vec4</type>
  165. <value><use>glass-tint</use></value>
  166. </uniform>
  167. <uniform>
  168. <name>overlay_color</name>
  169. <type>float-vec3</type>
  170. <value><use>overlay-color</use></value>
  171. </uniform>
  172. <uniform>
  173. <name>lightmap_r_factor</name>
  174. <type>float</type>
  175. <value><use>lightmap-factor[0]</use></value>
  176. </uniform>
  177. <uniform>
  178. <name>lightmap_r_color</name>
  179. <type>float-vec3</type>
  180. <value><use>lightmap-color[0]</use></value>
  181. </uniform>
  182. <uniform>
  183. <name>lightmap_g_factor</name>
  184. <type>float</type>
  185. <value><use>lightmap-factor[1]</use></value>
  186. </uniform>
  187. <uniform>
  188. <name>lightmap_g_color</name>
  189. <type>float-vec3</type>
  190. <value><use>lightmap-color[1]</use></value>
  191. </uniform>
  192. <uniform>
  193. <name>lightmap_b_factor</name>
  194. <type>float</type>
  195. <value><use>lightmap-factor[2]</use></value>
  196. </uniform>
  197. <uniform>
  198. <name>lightmap_b_color</name>
  199. <type>float-vec3</type>
  200. <value><use>lightmap-color[2]</use></value>
  201. </uniform>
  202. <uniform>
  203. <name>lightmap_a_factor</name>
  204. <type>float</type>
  205. <value><use>lightmap-factor[3]</use></value>
  206. </uniform>
  207. <uniform>
  208. <name>lightmap_a_color</name>
  209. <type>float-vec3</type>
  210. <value><use>lightmap-color[3]</use></value>
  211. </uniform>
  212. <uniform>
  213. <name>splash_x</name>
  214. <type>float</type>
  215. <value><use>splash-x</use></value>
  216. </uniform>
  217. <uniform>
  218. <name>splash_y</name>
  219. <type>float</type>
  220. <value><use>splash-y</use></value>
  221. </uniform>
  222. <uniform>
  223. <name>splash_z</name>
  224. <type>float</type>
  225. <value><use>splash-z</use></value>
  226. </uniform>
  227. <uniform>
  228. <name>rain_norm</name>
  229. <type>float</type>
  230. <value><use>rnorm</use></value>
  231. </uniform>
  232. <uniform>
  233. <name>ground_splash_norm</name>
  234. <type>float</type>
  235. <value><use>gsnorm</use></value>
  236. </uniform>
  237. <uniform>
  238. <name>frost_level</name>
  239. <type>float</type>
  240. <value><use>frost-level</use></value>
  241. </uniform>
  242. <uniform>
  243. <name>fog_level</name>
  244. <type>float</type>
  245. <value><use>fog-level</use></value>
  246. </uniform>
  247. <uniform>
  248. <name>scattering</name>
  249. <type>float</type>
  250. <value><use>scattering</use></value>
  251. </uniform>
  252. <uniform>
  253. <name>terminator</name>
  254. <type>float</type>
  255. <value><use>terminator</use></value>
  256. </uniform>
  257. <uniform>
  258. <name>ground_scattering</name>
  259. <type>float</type>
  260. <value><use>ground_scattering</use></value>
  261. </uniform>
  262. <uniform>
  263. <name>terminator</name>
  264. <type>float</type>
  265. <value><use>terminator</use></value>
  266. </uniform>
  267. <uniform>
  268. <name>overcast</name>
  269. <type>float</type>
  270. <value><use>overcast</use></value>
  271. </uniform>
  272. <uniform>
  273. <name>hazeLayerAltitude</name>
  274. <type>float</type>
  275. <value><use>lthickness</use></value>
  276. </uniform>
  277. <uniform>
  278. <name>eye_alt</name>
  279. <type>float</type>
  280. <value><use>eye_alt</use></value>
  281. </uniform>
  282. <uniform>
  283. <name>cloud_self_shading</name>
  284. <type>float</type>
  285. <value><use>cloud_self_shading</use></value>
  286. </uniform>
  287. <uniform>
  288. <name>moonlight</name>
  289. <type>float</type>
  290. <value><use>moonlight</use></value>
  291. </uniform>
  292. <uniform>
  293. <name>air_pollution</name>
  294. <type>float</type>
  295. <value><use>air_pollution</use></value>
  296. </uniform>
  297. <uniform>
  298. <name>reflection_strength</name>
  299. <type>float</type>
  300. <value><use>reflection-strength</use></value>
  301. </uniform>
  302. <uniform>
  303. <name>overlay_alpha</name>
  304. <type>float</type>
  305. <value><use>overlay-alpha</use></value>
  306. </uniform>
  307. <uniform>
  308. <name>overlay_glare</name>
  309. <type>float</type>
  310. <value><use>overlay-glare</use></value>
  311. </uniform>
  312. <!-- filtering -->
  313. <uniform>
  314. <name>gamma</name>
  315. <type>float</type>
  316. <value><use>gamma</use></value>
  317. </uniform>
  318. <uniform>
  319. <name>brightness</name>
  320. <type>float</type>
  321. <value><use>brightness</use></value>
  322. </uniform>
  323. <uniform>
  324. <name>use_filtering</name>
  325. <type>bool</type>
  326. <value><use>use_filtering</use></value>
  327. </uniform>
  328. <uniform>
  329. <name>use_night_vision</name>
  330. <type>bool</type>
  331. <value><use>use_night_vision</use></value>
  332. </uniform>
  333. <uniform>
  334. <name>use_IR_vision</name>
  335. <type>bool</type>
  336. <value><use>use_IR_vision</use></value>
  337. </uniform>
  338. <uniform>
  339. <name>delta_T</name>
  340. <type>float</type>
  341. <value><use>delta_T</use></value>
  342. </uniform>
  343. <uniform>
  344. <name>fact_grey</name>
  345. <type>float</type>
  346. <value><use>fact_grey</use></value>
  347. </uniform>
  348. <uniform>
  349. <name>fact_black</name>
  350. <type>float</type>
  351. <value><use>fact_black</use></value>
  352. </uniform>
  353. <uniform>
  354. <name>display_xsize</name>
  355. <type>int</type>
  356. <value><use>display_xsize</use></value>
  357. </uniform>
  358. <uniform>
  359. <name>display_ysize</name>
  360. <type>int</type>
  361. <value><use>display_ysize</use></value>
  362. </uniform>
  363. <uniform>
  364. <name>texture</name>
  365. <type>sampler-2d</type>
  366. <value type="int">0</value>
  367. </uniform>
  368. <uniform>
  369. <name>frost_texture</name>
  370. <type>sampler-2d</type>
  371. <value type="int">1</value>
  372. </uniform>
  373. <uniform>
  374. <name>func_texture</name>
  375. <type>sampler-2d</type>
  376. <value type="int">2</value>
  377. </uniform>
  378. <uniform>
  379. <name>cube_texture</name>
  380. <type>sampler-cube</type>
  381. <value type="int">3</value>
  382. </uniform>
  383. <uniform>
  384. <name>cube_light_texture</name>
  385. <type>sampler-cube</type>
  386. <value type="int">4</value>
  387. </uniform>
  388. <uniform>
  389. <name>use_reflection</name>
  390. <type>int</type>
  391. <value><use>use-reflection</use></value>
  392. </uniform>
  393. <uniform>
  394. <name>use_mask</name>
  395. <type>int</type>
  396. <value><use>use-mask</use></value>
  397. </uniform>
  398. <uniform>
  399. <name>use_wipers</name>
  400. <type>int</type>
  401. <value><use>use-wipers</use></value>
  402. </uniform>
  403. <uniform>
  404. <name>use_overlay</name>
  405. <type>int</type>
  406. <value><use>use-overlay</use></value>
  407. </uniform>
  408. <uniform>
  409. <name>use_reflection_lightmap</name>
  410. <type>int</type>
  411. <value><use>use-reflection-lightmap</use></value>
  412. </uniform>
  413. <uniform>
  414. <name>lightmap_multi</name>
  415. <type>int</type>
  416. <value><use>lightmap-multi</use></value>
  417. </uniform>
  418. <uniform>
  419. <name>adaptive_mapping</name>
  420. <type>int</type>
  421. <value><use>surface-mapping-scheme</use></value>
  422. </uniform>
  423. <uniform>
  424. <name>colorMode</name>
  425. <type>int</type>
  426. <value><use>material/color-mode-uniform</use></value>
  427. </uniform>
  428. </pass>
  429. </technique>
  430. <!-- fall back to a fixed pipeline technique equivalent to model-transparent otherwise -->
  431. <!-- Rembrandt technique of model-default comes at 10, so we insert before that -->
  432. <technique n="9">
  433. <pass>
  434. <lighting>true</lighting>
  435. <depth>
  436. <write-mask type="bool">false</write-mask>
  437. </depth>
  438. <material>
  439. <active>
  440. <use>material/active</use>
  441. </active>
  442. <ambient>
  443. <use>material/ambient</use>
  444. </ambient>
  445. <diffuse>
  446. <use>material/diffuse</use>
  447. </diffuse>
  448. <specular>
  449. <use>material/specular</use>
  450. </specular>
  451. <emissive>
  452. <use>material/emissive</use>
  453. </emissive>
  454. <shininess>
  455. <use>material/shininess</use>
  456. </shininess>
  457. <color-mode>
  458. <use>material/color-mode</use>
  459. </color-mode>
  460. </material>
  461. <blend>
  462. <active>
  463. <use>blend/active</use>
  464. </active>
  465. <source>
  466. <use>blend/source</use>
  467. </source>
  468. <destination>
  469. <use>blend/destination</use>
  470. </destination>
  471. </blend>
  472. <shade-model>
  473. <use>shade-model</use>
  474. </shade-model>
  475. <cull-face>
  476. <use>cull-face</use>
  477. </cull-face>
  478. <render-bin>
  479. <bin-number>111</bin-number>
  480. <bin-name>DepthSortedBin</bin-name>
  481. </render-bin>
  482. <texture-unit>
  483. <unit>0</unit>
  484. <active>
  485. <use>texture[0]/active</use>
  486. </active>
  487. <type>
  488. <use>texture[0]/type</use>
  489. </type>
  490. <image>
  491. <use>texture[0]/image</use>
  492. </image>
  493. <filter>
  494. <use>texture[0]/filter</use>
  495. </filter>
  496. <wrap-s>
  497. <use>texture[0]/wrap-s</use>
  498. </wrap-s>
  499. <wrap-t>
  500. <use>texture[0]/wrap-t</use>
  501. </wrap-t>
  502. <environment>
  503. <mode>modulate</mode>
  504. </environment>
  505. </texture-unit>
  506. </pass>
  507. </technique>
  508. </PropertyList>