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.

387 lines
7.9 KiB

  1. #include "shaderlib/cshader.h"
  2. class skin_ps30b_Static_Index
  3. {
  4. private:
  5. int m_nCUBEMAP;
  6. #ifdef _DEBUG
  7. bool m_bCUBEMAP;
  8. #endif
  9. public:
  10. void SetCUBEMAP( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nCUBEMAP = i;
  14. #ifdef _DEBUG
  15. m_bCUBEMAP = true;
  16. #endif
  17. }
  18. void SetCUBEMAP( bool i )
  19. {
  20. m_nCUBEMAP = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bCUBEMAP = true;
  23. #endif
  24. }
  25. private:
  26. int m_nSELFILLUM;
  27. #ifdef _DEBUG
  28. bool m_bSELFILLUM;
  29. #endif
  30. public:
  31. void SetSELFILLUM( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nSELFILLUM = i;
  35. #ifdef _DEBUG
  36. m_bSELFILLUM = true;
  37. #endif
  38. }
  39. void SetSELFILLUM( bool i )
  40. {
  41. m_nSELFILLUM = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bSELFILLUM = true;
  44. #endif
  45. }
  46. private:
  47. int m_nSELFILLUMFRESNEL;
  48. #ifdef _DEBUG
  49. bool m_bSELFILLUMFRESNEL;
  50. #endif
  51. public:
  52. void SetSELFILLUMFRESNEL( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nSELFILLUMFRESNEL = i;
  56. #ifdef _DEBUG
  57. m_bSELFILLUMFRESNEL = true;
  58. #endif
  59. }
  60. void SetSELFILLUMFRESNEL( bool i )
  61. {
  62. m_nSELFILLUMFRESNEL = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bSELFILLUMFRESNEL = true;
  65. #endif
  66. }
  67. private:
  68. int m_nFLASHLIGHT;
  69. #ifdef _DEBUG
  70. bool m_bFLASHLIGHT;
  71. #endif
  72. public:
  73. void SetFLASHLIGHT( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nFLASHLIGHT = i;
  77. #ifdef _DEBUG
  78. m_bFLASHLIGHT = true;
  79. #endif
  80. }
  81. void SetFLASHLIGHT( bool i )
  82. {
  83. m_nFLASHLIGHT = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bFLASHLIGHT = true;
  86. #endif
  87. }
  88. private:
  89. int m_nLIGHTWARPTEXTURE;
  90. #ifdef _DEBUG
  91. bool m_bLIGHTWARPTEXTURE;
  92. #endif
  93. public:
  94. void SetLIGHTWARPTEXTURE( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nLIGHTWARPTEXTURE = i;
  98. #ifdef _DEBUG
  99. m_bLIGHTWARPTEXTURE = true;
  100. #endif
  101. }
  102. void SetLIGHTWARPTEXTURE( bool i )
  103. {
  104. m_nLIGHTWARPTEXTURE = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bLIGHTWARPTEXTURE = true;
  107. #endif
  108. }
  109. private:
  110. int m_nPHONGEXPONENTTEXTURE;
  111. #ifdef _DEBUG
  112. bool m_bPHONGEXPONENTTEXTURE;
  113. #endif
  114. public:
  115. void SetPHONGEXPONENTTEXTURE( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nPHONGEXPONENTTEXTURE = i;
  119. #ifdef _DEBUG
  120. m_bPHONGEXPONENTTEXTURE = true;
  121. #endif
  122. }
  123. void SetPHONGEXPONENTTEXTURE( bool i )
  124. {
  125. m_nPHONGEXPONENTTEXTURE = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bPHONGEXPONENTTEXTURE = true;
  128. #endif
  129. }
  130. private:
  131. int m_nPHONGWARPTEXTURE;
  132. #ifdef _DEBUG
  133. bool m_bPHONGWARPTEXTURE;
  134. #endif
  135. public:
  136. void SetPHONGWARPTEXTURE( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nPHONGWARPTEXTURE = i;
  140. #ifdef _DEBUG
  141. m_bPHONGWARPTEXTURE = true;
  142. #endif
  143. }
  144. void SetPHONGWARPTEXTURE( bool i )
  145. {
  146. m_nPHONGWARPTEXTURE = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bPHONGWARPTEXTURE = true;
  149. #endif
  150. }
  151. private:
  152. int m_nWRINKLEMAP;
  153. #ifdef _DEBUG
  154. bool m_bWRINKLEMAP;
  155. #endif
  156. public:
  157. void SetWRINKLEMAP( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nWRINKLEMAP = i;
  161. #ifdef _DEBUG
  162. m_bWRINKLEMAP = true;
  163. #endif
  164. }
  165. void SetWRINKLEMAP( bool i )
  166. {
  167. m_nWRINKLEMAP = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bWRINKLEMAP = true;
  170. #endif
  171. }
  172. private:
  173. int m_nDETAIL_BLEND_MODE;
  174. #ifdef _DEBUG
  175. bool m_bDETAIL_BLEND_MODE;
  176. #endif
  177. public:
  178. void SetDETAIL_BLEND_MODE( int i )
  179. {
  180. Assert( i >= 0 && i <= 6 );
  181. m_nDETAIL_BLEND_MODE = i;
  182. #ifdef _DEBUG
  183. m_bDETAIL_BLEND_MODE = true;
  184. #endif
  185. }
  186. void SetDETAIL_BLEND_MODE( bool i )
  187. {
  188. m_nDETAIL_BLEND_MODE = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bDETAIL_BLEND_MODE = true;
  191. #endif
  192. }
  193. private:
  194. int m_nDETAILTEXTURE;
  195. #ifdef _DEBUG
  196. bool m_bDETAILTEXTURE;
  197. #endif
  198. public:
  199. void SetDETAILTEXTURE( int i )
  200. {
  201. Assert( i >= 0 && i <= 1 );
  202. m_nDETAILTEXTURE = i;
  203. #ifdef _DEBUG
  204. m_bDETAILTEXTURE = true;
  205. #endif
  206. }
  207. void SetDETAILTEXTURE( bool i )
  208. {
  209. m_nDETAILTEXTURE = i ? 1 : 0;
  210. #ifdef _DEBUG
  211. m_bDETAILTEXTURE = true;
  212. #endif
  213. }
  214. private:
  215. int m_nRIMLIGHT;
  216. #ifdef _DEBUG
  217. bool m_bRIMLIGHT;
  218. #endif
  219. public:
  220. void SetRIMLIGHT( int i )
  221. {
  222. Assert( i >= 0 && i <= 1 );
  223. m_nRIMLIGHT = i;
  224. #ifdef _DEBUG
  225. m_bRIMLIGHT = true;
  226. #endif
  227. }
  228. void SetRIMLIGHT( bool i )
  229. {
  230. m_nRIMLIGHT = i ? 1 : 0;
  231. #ifdef _DEBUG
  232. m_bRIMLIGHT = true;
  233. #endif
  234. }
  235. public:
  236. skin_ps30b_Static_Index( )
  237. {
  238. #ifdef _DEBUG
  239. m_bCUBEMAP = false;
  240. #endif // _DEBUG
  241. m_nCUBEMAP = 0;
  242. #ifdef _DEBUG
  243. m_bSELFILLUM = false;
  244. #endif // _DEBUG
  245. m_nSELFILLUM = 0;
  246. #ifdef _DEBUG
  247. m_bSELFILLUMFRESNEL = false;
  248. #endif // _DEBUG
  249. m_nSELFILLUMFRESNEL = 0;
  250. #ifdef _DEBUG
  251. m_bFLASHLIGHT = false;
  252. #endif // _DEBUG
  253. m_nFLASHLIGHT = 0;
  254. #ifdef _DEBUG
  255. m_bLIGHTWARPTEXTURE = false;
  256. #endif // _DEBUG
  257. m_nLIGHTWARPTEXTURE = 0;
  258. #ifdef _DEBUG
  259. m_bPHONGEXPONENTTEXTURE = false;
  260. #endif // _DEBUG
  261. m_nPHONGEXPONENTTEXTURE = 0;
  262. #ifdef _DEBUG
  263. m_bPHONGWARPTEXTURE = false;
  264. #endif // _DEBUG
  265. m_nPHONGWARPTEXTURE = 0;
  266. #ifdef _DEBUG
  267. m_bWRINKLEMAP = false;
  268. #endif // _DEBUG
  269. m_nWRINKLEMAP = 0;
  270. #ifdef _DEBUG
  271. m_bDETAIL_BLEND_MODE = false;
  272. #endif // _DEBUG
  273. m_nDETAIL_BLEND_MODE = 0;
  274. #ifdef _DEBUG
  275. m_bDETAILTEXTURE = false;
  276. #endif // _DEBUG
  277. m_nDETAILTEXTURE = 0;
  278. #ifdef _DEBUG
  279. m_bRIMLIGHT = false;
  280. #endif // _DEBUG
  281. m_nRIMLIGHT = 0;
  282. }
  283. int GetIndex()
  284. {
  285. // Asserts to make sure that we aren't using any skipped combinations.
  286. // Asserts to make sure that we are setting all of the combination vars.
  287. #ifdef _DEBUG
  288. bool bAllStaticVarsDefined = m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGEXPONENTTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT;
  289. Assert( bAllStaticVarsDefined );
  290. #endif // _DEBUG
  291. return ( 20 * m_nCUBEMAP ) + ( 40 * m_nSELFILLUM ) + ( 80 * m_nSELFILLUMFRESNEL ) + ( 160 * m_nFLASHLIGHT ) + ( 320 * m_nLIGHTWARPTEXTURE ) + ( 640 * m_nPHONGEXPONENTTEXTURE ) + ( 1280 * m_nPHONGWARPTEXTURE ) + ( 2560 * m_nWRINKLEMAP ) + ( 5120 * m_nDETAIL_BLEND_MODE ) + ( 35840 * m_nDETAILTEXTURE ) + ( 71680 * m_nRIMLIGHT ) + 0;
  292. }
  293. };
  294. #define shaderStaticTest_skin_ps30b psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGEXPONENTTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + 0
  295. class skin_ps30b_Dynamic_Index
  296. {
  297. private:
  298. int m_nWRITEWATERFOGTODESTALPHA;
  299. #ifdef _DEBUG
  300. bool m_bWRITEWATERFOGTODESTALPHA;
  301. #endif
  302. public:
  303. void SetWRITEWATERFOGTODESTALPHA( int i )
  304. {
  305. Assert( i >= 0 && i <= 1 );
  306. m_nWRITEWATERFOGTODESTALPHA = i;
  307. #ifdef _DEBUG
  308. m_bWRITEWATERFOGTODESTALPHA = true;
  309. #endif
  310. }
  311. void SetWRITEWATERFOGTODESTALPHA( bool i )
  312. {
  313. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  314. #ifdef _DEBUG
  315. m_bWRITEWATERFOGTODESTALPHA = true;
  316. #endif
  317. }
  318. private:
  319. int m_nPIXELFOGTYPE;
  320. #ifdef _DEBUG
  321. bool m_bPIXELFOGTYPE;
  322. #endif
  323. public:
  324. void SetPIXELFOGTYPE( int i )
  325. {
  326. Assert( i >= 0 && i <= 1 );
  327. m_nPIXELFOGTYPE = i;
  328. #ifdef _DEBUG
  329. m_bPIXELFOGTYPE = true;
  330. #endif
  331. }
  332. void SetPIXELFOGTYPE( bool i )
  333. {
  334. m_nPIXELFOGTYPE = i ? 1 : 0;
  335. #ifdef _DEBUG
  336. m_bPIXELFOGTYPE = true;
  337. #endif
  338. }
  339. private:
  340. int m_nNUM_LIGHTS;
  341. #ifdef _DEBUG
  342. bool m_bNUM_LIGHTS;
  343. #endif
  344. public:
  345. void SetNUM_LIGHTS( int i )
  346. {
  347. Assert( i >= 0 && i <= 4 );
  348. m_nNUM_LIGHTS = i;
  349. #ifdef _DEBUG
  350. m_bNUM_LIGHTS = true;
  351. #endif
  352. }
  353. void SetNUM_LIGHTS( bool i )
  354. {
  355. m_nNUM_LIGHTS = i ? 1 : 0;
  356. #ifdef _DEBUG
  357. m_bNUM_LIGHTS = true;
  358. #endif
  359. }
  360. public:
  361. skin_ps30b_Dynamic_Index()
  362. {
  363. #ifdef _DEBUG
  364. m_bWRITEWATERFOGTODESTALPHA = false;
  365. #endif // _DEBUG
  366. m_nWRITEWATERFOGTODESTALPHA = 0;
  367. #ifdef _DEBUG
  368. m_bPIXELFOGTYPE = false;
  369. #endif // _DEBUG
  370. m_nPIXELFOGTYPE = 0;
  371. #ifdef _DEBUG
  372. m_bNUM_LIGHTS = false;
  373. #endif // _DEBUG
  374. m_nNUM_LIGHTS = 0;
  375. }
  376. int GetIndex()
  377. {
  378. // Asserts to make sure that we aren't using any skipped combinations.
  379. // Asserts to make sure that we are setting all of the combination vars.
  380. #ifdef _DEBUG
  381. bool bAllDynamicVarsDefined = m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS;
  382. Assert( bAllDynamicVarsDefined );
  383. #endif // _DEBUG
  384. return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + 0;
  385. }
  386. };
  387. #define shaderDynamicTest_skin_ps30b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + 0