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.6 KiB

  1. #include "shaderlib/cshader.h"
  2. class eye_refract_vs20_Static_Index
  3. {
  4. private:
  5. int m_nINTRO;
  6. #ifdef _DEBUG
  7. bool m_bINTRO;
  8. #endif
  9. public:
  10. void SetINTRO( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nINTRO = i;
  14. #ifdef _DEBUG
  15. m_bINTRO = true;
  16. #endif
  17. }
  18. void SetINTRO( bool i )
  19. {
  20. m_nINTRO = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bINTRO = true;
  23. #endif
  24. }
  25. private:
  26. int m_nHALFLAMBERT;
  27. #ifdef _DEBUG
  28. bool m_bHALFLAMBERT;
  29. #endif
  30. public:
  31. void SetHALFLAMBERT( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nHALFLAMBERT = i;
  35. #ifdef _DEBUG
  36. m_bHALFLAMBERT = true;
  37. #endif
  38. }
  39. void SetHALFLAMBERT( bool i )
  40. {
  41. m_nHALFLAMBERT = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bHALFLAMBERT = true;
  44. #endif
  45. }
  46. private:
  47. int m_nFLASHLIGHT;
  48. #ifdef _DEBUG
  49. bool m_bFLASHLIGHT;
  50. #endif
  51. public:
  52. void SetFLASHLIGHT( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nFLASHLIGHT = i;
  56. #ifdef _DEBUG
  57. m_bFLASHLIGHT = true;
  58. #endif
  59. }
  60. void SetFLASHLIGHT( bool i )
  61. {
  62. m_nFLASHLIGHT = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bFLASHLIGHT = true;
  65. #endif
  66. }
  67. private:
  68. int m_nLIGHTWARPTEXTURE;
  69. #ifdef _DEBUG
  70. bool m_bLIGHTWARPTEXTURE;
  71. #endif
  72. public:
  73. void SetLIGHTWARPTEXTURE( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nLIGHTWARPTEXTURE = i;
  77. #ifdef _DEBUG
  78. m_bLIGHTWARPTEXTURE = true;
  79. #endif
  80. }
  81. void SetLIGHTWARPTEXTURE( bool i )
  82. {
  83. m_nLIGHTWARPTEXTURE = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bLIGHTWARPTEXTURE = true;
  86. #endif
  87. }
  88. public:
  89. eye_refract_vs20_Static_Index( )
  90. {
  91. #ifdef _DEBUG
  92. m_bINTRO = false;
  93. #endif // _DEBUG
  94. m_nINTRO = 0;
  95. #ifdef _DEBUG
  96. m_bHALFLAMBERT = false;
  97. #endif // _DEBUG
  98. m_nHALFLAMBERT = 0;
  99. #ifdef _DEBUG
  100. m_bFLASHLIGHT = false;
  101. #endif // _DEBUG
  102. m_nFLASHLIGHT = 0;
  103. #ifdef _DEBUG
  104. m_bLIGHTWARPTEXTURE = false;
  105. #endif // _DEBUG
  106. m_nLIGHTWARPTEXTURE = 0;
  107. }
  108. int GetIndex()
  109. {
  110. // Asserts to make sure that we aren't using any skipped combinations.
  111. // Asserts to make sure that we are setting all of the combination vars.
  112. #ifdef _DEBUG
  113. bool bAllStaticVarsDefined = m_bINTRO && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE;
  114. Assert( bAllStaticVarsDefined );
  115. #endif // _DEBUG
  116. return ( 160 * m_nINTRO ) + ( 320 * m_nHALFLAMBERT ) + ( 640 * m_nFLASHLIGHT ) + ( 1280 * m_nLIGHTWARPTEXTURE ) + 0;
  117. }
  118. };
  119. #define shaderStaticTest_eye_refract_vs20 vsh_forgot_to_set_static_INTRO + vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_FLASHLIGHT + vsh_forgot_to_set_static_LIGHTWARPTEXTURE + 0
  120. class eye_refract_vs20_Dynamic_Index
  121. {
  122. private:
  123. int m_nCOMPRESSED_VERTS;
  124. #ifdef _DEBUG
  125. bool m_bCOMPRESSED_VERTS;
  126. #endif
  127. public:
  128. void SetCOMPRESSED_VERTS( int i )
  129. {
  130. Assert( i >= 0 && i <= 1 );
  131. m_nCOMPRESSED_VERTS = i;
  132. #ifdef _DEBUG
  133. m_bCOMPRESSED_VERTS = true;
  134. #endif
  135. }
  136. void SetCOMPRESSED_VERTS( bool i )
  137. {
  138. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  139. #ifdef _DEBUG
  140. m_bCOMPRESSED_VERTS = true;
  141. #endif
  142. }
  143. private:
  144. int m_nSKINNING;
  145. #ifdef _DEBUG
  146. bool m_bSKINNING;
  147. #endif
  148. public:
  149. void SetSKINNING( int i )
  150. {
  151. Assert( i >= 0 && i <= 1 );
  152. m_nSKINNING = i;
  153. #ifdef _DEBUG
  154. m_bSKINNING = true;
  155. #endif
  156. }
  157. void SetSKINNING( bool i )
  158. {
  159. m_nSKINNING = i ? 1 : 0;
  160. #ifdef _DEBUG
  161. m_bSKINNING = true;
  162. #endif
  163. }
  164. private:
  165. int m_nDOWATERFOG;
  166. #ifdef _DEBUG
  167. bool m_bDOWATERFOG;
  168. #endif
  169. public:
  170. void SetDOWATERFOG( int i )
  171. {
  172. Assert( i >= 0 && i <= 1 );
  173. m_nDOWATERFOG = i;
  174. #ifdef _DEBUG
  175. m_bDOWATERFOG = true;
  176. #endif
  177. }
  178. void SetDOWATERFOG( bool i )
  179. {
  180. m_nDOWATERFOG = i ? 1 : 0;
  181. #ifdef _DEBUG
  182. m_bDOWATERFOG = true;
  183. #endif
  184. }
  185. private:
  186. int m_nDYNAMIC_LIGHT;
  187. #ifdef _DEBUG
  188. bool m_bDYNAMIC_LIGHT;
  189. #endif
  190. public:
  191. void SetDYNAMIC_LIGHT( int i )
  192. {
  193. Assert( i >= 0 && i <= 1 );
  194. m_nDYNAMIC_LIGHT = i;
  195. #ifdef _DEBUG
  196. m_bDYNAMIC_LIGHT = true;
  197. #endif
  198. }
  199. void SetDYNAMIC_LIGHT( bool i )
  200. {
  201. m_nDYNAMIC_LIGHT = i ? 1 : 0;
  202. #ifdef _DEBUG
  203. m_bDYNAMIC_LIGHT = true;
  204. #endif
  205. }
  206. private:
  207. int m_nSTATIC_LIGHT;
  208. #ifdef _DEBUG
  209. bool m_bSTATIC_LIGHT;
  210. #endif
  211. public:
  212. void SetSTATIC_LIGHT( int i )
  213. {
  214. Assert( i >= 0 && i <= 1 );
  215. m_nSTATIC_LIGHT = i;
  216. #ifdef _DEBUG
  217. m_bSTATIC_LIGHT = true;
  218. #endif
  219. }
  220. void SetSTATIC_LIGHT( bool i )
  221. {
  222. m_nSTATIC_LIGHT = i ? 1 : 0;
  223. #ifdef _DEBUG
  224. m_bSTATIC_LIGHT = true;
  225. #endif
  226. }
  227. private:
  228. int m_nNUM_LIGHTS;
  229. #ifdef _DEBUG
  230. bool m_bNUM_LIGHTS;
  231. #endif
  232. public:
  233. void SetNUM_LIGHTS( int i )
  234. {
  235. Assert( i >= 0 && i <= 4 );
  236. m_nNUM_LIGHTS = i;
  237. #ifdef _DEBUG
  238. m_bNUM_LIGHTS = true;
  239. #endif
  240. }
  241. void SetNUM_LIGHTS( bool i )
  242. {
  243. m_nNUM_LIGHTS = i ? 1 : 0;
  244. #ifdef _DEBUG
  245. m_bNUM_LIGHTS = true;
  246. #endif
  247. }
  248. public:
  249. eye_refract_vs20_Dynamic_Index()
  250. {
  251. #ifdef _DEBUG
  252. m_bCOMPRESSED_VERTS = false;
  253. #endif // _DEBUG
  254. m_nCOMPRESSED_VERTS = 0;
  255. #ifdef _DEBUG
  256. m_bSKINNING = false;
  257. #endif // _DEBUG
  258. m_nSKINNING = 0;
  259. #ifdef _DEBUG
  260. m_bDOWATERFOG = false;
  261. #endif // _DEBUG
  262. m_nDOWATERFOG = 0;
  263. #ifdef _DEBUG
  264. m_bDYNAMIC_LIGHT = false;
  265. #endif // _DEBUG
  266. m_nDYNAMIC_LIGHT = 0;
  267. #ifdef _DEBUG
  268. m_bSTATIC_LIGHT = false;
  269. #endif // _DEBUG
  270. m_nSTATIC_LIGHT = 0;
  271. #ifdef _DEBUG
  272. m_bNUM_LIGHTS = false;
  273. #endif // _DEBUG
  274. m_nNUM_LIGHTS = 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_bCOMPRESSED_VERTS && m_bSKINNING && m_bDOWATERFOG && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bNUM_LIGHTS;
  282. Assert( bAllDynamicVarsDefined );
  283. #endif // _DEBUG
  284. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nDOWATERFOG ) + ( 8 * m_nDYNAMIC_LIGHT ) + ( 16 * m_nSTATIC_LIGHT ) + ( 32 * m_nNUM_LIGHTS ) + 0;
  285. }
  286. };
  287. #define shaderDynamicTest_eye_refract_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0