Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

287 lines
5.8 KiB

  1. #include "shaderlib/cshader.h"
  2. class refract_ps20_Static_Index
  3. {
  4. private:
  5. int m_nCONVERT_TO_SRGB;
  6. #ifdef _DEBUG
  7. bool m_bCONVERT_TO_SRGB;
  8. #endif
  9. public:
  10. void SetCONVERT_TO_SRGB( int i )
  11. {
  12. Assert( i >= 0 && i <= 0 );
  13. m_nCONVERT_TO_SRGB = i;
  14. #ifdef _DEBUG
  15. m_bCONVERT_TO_SRGB = true;
  16. #endif
  17. }
  18. void SetCONVERT_TO_SRGB( bool i )
  19. {
  20. m_nCONVERT_TO_SRGB = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bCONVERT_TO_SRGB = true;
  23. #endif
  24. }
  25. private:
  26. int m_nBLUR;
  27. #ifdef _DEBUG
  28. bool m_bBLUR;
  29. #endif
  30. public:
  31. void SetBLUR( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nBLUR = i;
  35. #ifdef _DEBUG
  36. m_bBLUR = true;
  37. #endif
  38. }
  39. void SetBLUR( bool i )
  40. {
  41. m_nBLUR = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bBLUR = true;
  44. #endif
  45. }
  46. private:
  47. int m_nFADEOUTONSILHOUETTE;
  48. #ifdef _DEBUG
  49. bool m_bFADEOUTONSILHOUETTE;
  50. #endif
  51. public:
  52. void SetFADEOUTONSILHOUETTE( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nFADEOUTONSILHOUETTE = i;
  56. #ifdef _DEBUG
  57. m_bFADEOUTONSILHOUETTE = true;
  58. #endif
  59. }
  60. void SetFADEOUTONSILHOUETTE( bool i )
  61. {
  62. m_nFADEOUTONSILHOUETTE = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bFADEOUTONSILHOUETTE = true;
  65. #endif
  66. }
  67. private:
  68. int m_nCUBEMAP;
  69. #ifdef _DEBUG
  70. bool m_bCUBEMAP;
  71. #endif
  72. public:
  73. void SetCUBEMAP( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nCUBEMAP = i;
  77. #ifdef _DEBUG
  78. m_bCUBEMAP = true;
  79. #endif
  80. }
  81. void SetCUBEMAP( bool i )
  82. {
  83. m_nCUBEMAP = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bCUBEMAP = true;
  86. #endif
  87. }
  88. private:
  89. int m_nREFRACTTINTTEXTURE;
  90. #ifdef _DEBUG
  91. bool m_bREFRACTTINTTEXTURE;
  92. #endif
  93. public:
  94. void SetREFRACTTINTTEXTURE( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nREFRACTTINTTEXTURE = i;
  98. #ifdef _DEBUG
  99. m_bREFRACTTINTTEXTURE = true;
  100. #endif
  101. }
  102. void SetREFRACTTINTTEXTURE( bool i )
  103. {
  104. m_nREFRACTTINTTEXTURE = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bREFRACTTINTTEXTURE = true;
  107. #endif
  108. }
  109. private:
  110. int m_nMASKED;
  111. #ifdef _DEBUG
  112. bool m_bMASKED;
  113. #endif
  114. public:
  115. void SetMASKED( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nMASKED = i;
  119. #ifdef _DEBUG
  120. m_bMASKED = true;
  121. #endif
  122. }
  123. void SetMASKED( bool i )
  124. {
  125. m_nMASKED = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bMASKED = true;
  128. #endif
  129. }
  130. private:
  131. int m_nCOLORMODULATE;
  132. #ifdef _DEBUG
  133. bool m_bCOLORMODULATE;
  134. #endif
  135. public:
  136. void SetCOLORMODULATE( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nCOLORMODULATE = i;
  140. #ifdef _DEBUG
  141. m_bCOLORMODULATE = true;
  142. #endif
  143. }
  144. void SetCOLORMODULATE( bool i )
  145. {
  146. m_nCOLORMODULATE = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bCOLORMODULATE = true;
  149. #endif
  150. }
  151. private:
  152. int m_nSECONDARY_NORMAL;
  153. #ifdef _DEBUG
  154. bool m_bSECONDARY_NORMAL;
  155. #endif
  156. public:
  157. void SetSECONDARY_NORMAL( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nSECONDARY_NORMAL = i;
  161. #ifdef _DEBUG
  162. m_bSECONDARY_NORMAL = true;
  163. #endif
  164. }
  165. void SetSECONDARY_NORMAL( bool i )
  166. {
  167. m_nSECONDARY_NORMAL = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bSECONDARY_NORMAL = true;
  170. #endif
  171. }
  172. private:
  173. int m_nNORMAL_DECODE_MODE;
  174. #ifdef _DEBUG
  175. bool m_bNORMAL_DECODE_MODE;
  176. #endif
  177. public:
  178. void SetNORMAL_DECODE_MODE( int i )
  179. {
  180. Assert( i >= 0 && i <= 0 );
  181. m_nNORMAL_DECODE_MODE = i;
  182. #ifdef _DEBUG
  183. m_bNORMAL_DECODE_MODE = true;
  184. #endif
  185. }
  186. void SetNORMAL_DECODE_MODE( bool i )
  187. {
  188. m_nNORMAL_DECODE_MODE = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bNORMAL_DECODE_MODE = true;
  191. #endif
  192. }
  193. public:
  194. refract_ps20_Static_Index( )
  195. {
  196. #ifdef _DEBUG
  197. m_bCONVERT_TO_SRGB = true;
  198. #endif // _DEBUG
  199. m_nCONVERT_TO_SRGB = 0;
  200. #ifdef _DEBUG
  201. m_bBLUR = false;
  202. #endif // _DEBUG
  203. m_nBLUR = 0;
  204. #ifdef _DEBUG
  205. m_bFADEOUTONSILHOUETTE = false;
  206. #endif // _DEBUG
  207. m_nFADEOUTONSILHOUETTE = 0;
  208. #ifdef _DEBUG
  209. m_bCUBEMAP = false;
  210. #endif // _DEBUG
  211. m_nCUBEMAP = 0;
  212. #ifdef _DEBUG
  213. m_bREFRACTTINTTEXTURE = false;
  214. #endif // _DEBUG
  215. m_nREFRACTTINTTEXTURE = 0;
  216. #ifdef _DEBUG
  217. m_bMASKED = false;
  218. #endif // _DEBUG
  219. m_nMASKED = 0;
  220. #ifdef _DEBUG
  221. m_bCOLORMODULATE = false;
  222. #endif // _DEBUG
  223. m_nCOLORMODULATE = 0;
  224. #ifdef _DEBUG
  225. m_bSECONDARY_NORMAL = false;
  226. #endif // _DEBUG
  227. m_nSECONDARY_NORMAL = 0;
  228. #ifdef _DEBUG
  229. m_bNORMAL_DECODE_MODE = false;
  230. #endif // _DEBUG
  231. m_nNORMAL_DECODE_MODE = 0;
  232. }
  233. int GetIndex()
  234. {
  235. // Asserts to make sure that we aren't using any skipped combinations.
  236. // Asserts to make sure that we are setting all of the combination vars.
  237. #ifdef _DEBUG
  238. bool bAllStaticVarsDefined = m_bCONVERT_TO_SRGB && m_bBLUR && m_bFADEOUTONSILHOUETTE && m_bCUBEMAP && m_bREFRACTTINTTEXTURE && m_bMASKED && m_bCOLORMODULATE && m_bSECONDARY_NORMAL && m_bNORMAL_DECODE_MODE;
  239. Assert( bAllStaticVarsDefined );
  240. #endif // _DEBUG
  241. return ( 2 * m_nCONVERT_TO_SRGB ) + ( 2 * m_nBLUR ) + ( 4 * m_nFADEOUTONSILHOUETTE ) + ( 8 * m_nCUBEMAP ) + ( 16 * m_nREFRACTTINTTEXTURE ) + ( 32 * m_nMASKED ) + ( 64 * m_nCOLORMODULATE ) + ( 128 * m_nSECONDARY_NORMAL ) + ( 256 * m_nNORMAL_DECODE_MODE ) + 0;
  242. }
  243. };
  244. #define shaderStaticTest_refract_ps20 psh_forgot_to_set_static_BLUR + psh_forgot_to_set_static_FADEOUTONSILHOUETTE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_REFRACTTINTTEXTURE + psh_forgot_to_set_static_MASKED + psh_forgot_to_set_static_COLORMODULATE + psh_forgot_to_set_static_SECONDARY_NORMAL + psh_forgot_to_set_static_NORMAL_DECODE_MODE + 0
  245. class refract_ps20_Dynamic_Index
  246. {
  247. private:
  248. int m_nPIXELFOGTYPE;
  249. #ifdef _DEBUG
  250. bool m_bPIXELFOGTYPE;
  251. #endif
  252. public:
  253. void SetPIXELFOGTYPE( int i )
  254. {
  255. Assert( i >= 0 && i <= 1 );
  256. m_nPIXELFOGTYPE = i;
  257. #ifdef _DEBUG
  258. m_bPIXELFOGTYPE = true;
  259. #endif
  260. }
  261. void SetPIXELFOGTYPE( bool i )
  262. {
  263. m_nPIXELFOGTYPE = i ? 1 : 0;
  264. #ifdef _DEBUG
  265. m_bPIXELFOGTYPE = true;
  266. #endif
  267. }
  268. public:
  269. refract_ps20_Dynamic_Index()
  270. {
  271. #ifdef _DEBUG
  272. m_bPIXELFOGTYPE = false;
  273. #endif // _DEBUG
  274. m_nPIXELFOGTYPE = 0;
  275. }
  276. int GetIndex()
  277. {
  278. // Asserts to make sure that we aren't using any skipped combinations.
  279. // Asserts to make sure that we are setting all of the combination vars.
  280. #ifdef _DEBUG
  281. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  282. Assert( bAllDynamicVarsDefined );
  283. #endif // _DEBUG
  284. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  285. }
  286. };
  287. #define shaderDynamicTest_refract_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0