crt.eff 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <PropertyList>
  3. <name>crt</name>
  4. <inherits-from>Effects/model-default</inherits-from>
  5. <parameters>
  6. <!-- Dirt -->
  7. <texture n="4">
  8. <image>Aircraft/ec130/Models/Effects/dust.jpg</image>
  9. <type>2d</type>
  10. <filter>linear-mipmap-linear</filter>
  11. <wrap-s>clamp</wrap-s>
  12. <wrap-t>clamp</wrap-t>
  13. <internal-format>normalized</internal-format>
  14. </texture>
  15. <!-- Reflection environment -->
  16. <texture n="5">
  17. <type>cubemap</type>
  18. <images>
  19. <positive-x>Aircraft/ec130/Models/Effects/cubemaps/color/0004.png</positive-x>
  20. <negative-x>Aircraft/ec130/Models/Effects/cubemaps/color/0002.png</negative-x>
  21. <positive-y>Aircraft/ec130/Models/Effects/cubemaps/color/0001.png</positive-y>
  22. <negative-y>Aircraft/ec130/Models/Effects/cubemaps/color/0003.png</negative-y>
  23. <positive-z>Aircraft/ec130/Models/Effects/cubemaps/color/0006.png</positive-z>
  24. <negative-z>Aircraft/ec130/Models/Effects/cubemaps/color/0005.png</negative-z>
  25. </images>
  26. </texture>
  27. <texture n="6">
  28. <image>Aircraft/ec130/Models/Effects/scanlines.png</image>
  29. <type>2d</type>
  30. <filter>linear-mipmap-linear</filter>
  31. <wrap-s>repeat</wrap-s>
  32. <wrap-t>repeat</wrap-t>
  33. <internal-format>normalized</internal-format>
  34. </texture>
  35. <display-enabled type="int">
  36. <use>systems/electrical/volts</use>
  37. </display-enabled>
  38. <frame-factor type="float">0.98</frame-factor>>
  39. <distortion type="float">0.035</distortion>
  40. <flicker-factor type="float">0.09</flicker-factor>
  41. <view-y type="float"> <!-- views have different coordinate system -->
  42. <use>sim/current-view/x-offset-m</use>
  43. </view-y>
  44. </parameters>
  45. <technique n="5">
  46. <predicate>
  47. <and>
  48. <property>/sim/rendering/shaders/quality-level</property>
  49. <property>/sim/rendering/shaders/model</property>
  50. <or>
  51. <less-equal>
  52. <value type="float">2.0</value>
  53. <glversion />
  54. </less-equal>
  55. <and>
  56. <extension-supported>GL_ARB_shader_objects</extension-supported>
  57. <extension-supported>GL_ARB_shading_language_100</extension-supported>
  58. <extension-supported>GL_ARB_vertex_shader</extension-supported>
  59. <extension-supported>GL_ARB_fragment_shader</extension-supported>
  60. </and>
  61. </or>
  62. </and>
  63. </predicate>
  64. <pass>
  65. <!-- Base texture unit-->
  66. <texture-unit>
  67. <unit>0</unit>
  68. <type><use>texture[0]/type</use></type>
  69. <image><use>texture[0]/image</use></image>
  70. <filter><use>texture[0]/filter</use></filter>
  71. <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
  72. <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
  73. <internal-format><use>texture[0]/internal-format</use></internal-format>
  74. </texture-unit>
  75. <!-- Dirt texture unit-->
  76. <texture-unit>
  77. <unit>1</unit>
  78. <image><use>texture[4]/image</use></image>
  79. <type><use>texture[4]/type</use></type>
  80. <filter><use>texture[4]/filter</use></filter>
  81. <wrap-s><use>texture[4]/wrap-s</use></wrap-s>
  82. <wrap-t><use>texture[4]/wrap-t</use></wrap-t>
  83. <internal-format><use>texture[4]/internal-format</use></internal-format>
  84. </texture-unit>
  85. <!-- Reflection CubeMap texture unit-->
  86. <texture-unit>
  87. <unit>2</unit>
  88. <type><use>texture[5]/type</use></type>
  89. <images><use>texture[5]/images</use></images>
  90. </texture-unit>
  91. <!-- scanline texture unit-->
  92. <texture-unit>
  93. <unit>3</unit>
  94. <image><use>texture[6]/image</use></image>
  95. <type><use>texture[6]/type</use></type>
  96. <filter><use>texture[6]/filter</use></filter>
  97. <wrap-s><use>texture[6]/wrap-s</use></wrap-s>
  98. <wrap-t><use>texture[6]/wrap-t</use></wrap-t>
  99. <internal-format><use>texture[6]/internal-format</use></internal-format>
  100. </texture-unit>
  101. <program>
  102. <vertex-shader>Shaders/reflect.vert</vertex-shader>
  103. <fragment-shader>Aircraft/ec130/Models/Effects/crt.frag</fragment-shader>
  104. </program>
  105. <uniform>
  106. <name>BaseTex</name>
  107. <type>sampler-2d</type>
  108. <value type="int">0</value>
  109. </uniform>
  110. <uniform>
  111. <name>DirtTex</name>
  112. <type>sampler-2d</type>
  113. <value type="int">1</value>
  114. </uniform>
  115. <uniform>
  116. <name>Environment</name>
  117. <type>sampler-cube</type>
  118. <value type="int">2</value>
  119. </uniform>
  120. <uniform>
  121. <name>Scanlines</name>
  122. <type>sampler-2d</type>
  123. <value type="int">3</value>
  124. </uniform>
  125. <uniform>
  126. <name>display_enabled</name>
  127. <type>int</type>
  128. <value><use>display-enabled</use></value>
  129. </uniform>
  130. <uniform>
  131. <name>frame_factor</name>
  132. <type>float</type>
  133. <value><use>frame-factor</use></value>
  134. </uniform>
  135. <uniform>
  136. <name>distortion</name>
  137. <type>float</type>
  138. <value><use>distortion</use></value>
  139. </uniform>
  140. <uniform>
  141. <name>flicker_factor</name>
  142. <type>float</type>
  143. <value><use>flicker-factor</use></value>
  144. </uniform>
  145. <uniform>
  146. <name>view_y</name>
  147. <type>float</type>
  148. <value><use>view-y</use></value>
  149. </uniform>
  150. </pass>
  151. </technique>
  152. </PropertyList>