Counter Strike : Global Offensive Source Code
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.

391 lines
9.2 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // $PERPARTICLEOUTLINE && ( $ORIENTATION == 3 )
  3. // $DUALSEQUENCE && ( $PERPARTICLEOUTLINE || ( $ORIENTATION == 3 ) )
  4. // $HARDWAREFOGBLEND && !SPRITECARDVERTEXFOG
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  6. #include "shaderlib/cshader.h"
  7. class spritecard_vs20_Static_Index
  8. {
  9. private:
  10. int m_nZOOM_ANIMATE_SEQ2;
  11. #ifdef _DEBUG
  12. bool m_bZOOM_ANIMATE_SEQ2;
  13. #endif
  14. public:
  15. void SetZOOM_ANIMATE_SEQ2( int i )
  16. {
  17. Assert( i >= 0 && i <= 1 );
  18. m_nZOOM_ANIMATE_SEQ2 = i;
  19. #ifdef _DEBUG
  20. m_bZOOM_ANIMATE_SEQ2 = true;
  21. #endif
  22. }
  23. void SetZOOM_ANIMATE_SEQ2( bool i )
  24. {
  25. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  26. m_nZOOM_ANIMATE_SEQ2 = i ? 1 : 0;
  27. #ifdef _DEBUG
  28. m_bZOOM_ANIMATE_SEQ2 = true;
  29. #endif
  30. }
  31. private:
  32. int m_nDUALSEQUENCE;
  33. #ifdef _DEBUG
  34. bool m_bDUALSEQUENCE;
  35. #endif
  36. public:
  37. void SetDUALSEQUENCE( int i )
  38. {
  39. Assert( i >= 0 && i <= 1 );
  40. m_nDUALSEQUENCE = i;
  41. #ifdef _DEBUG
  42. m_bDUALSEQUENCE = true;
  43. #endif
  44. }
  45. void SetDUALSEQUENCE( bool i )
  46. {
  47. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  48. m_nDUALSEQUENCE = i ? 1 : 0;
  49. #ifdef _DEBUG
  50. m_bDUALSEQUENCE = true;
  51. #endif
  52. }
  53. private:
  54. int m_nADDBASETEXTURE2;
  55. #ifdef _DEBUG
  56. bool m_bADDBASETEXTURE2;
  57. #endif
  58. public:
  59. void SetADDBASETEXTURE2( int i )
  60. {
  61. Assert( i >= 0 && i <= 1 );
  62. m_nADDBASETEXTURE2 = i;
  63. #ifdef _DEBUG
  64. m_bADDBASETEXTURE2 = true;
  65. #endif
  66. }
  67. void SetADDBASETEXTURE2( bool i )
  68. {
  69. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  70. m_nADDBASETEXTURE2 = i ? 1 : 0;
  71. #ifdef _DEBUG
  72. m_bADDBASETEXTURE2 = true;
  73. #endif
  74. }
  75. private:
  76. int m_nEXTRACTGREENALPHA;
  77. #ifdef _DEBUG
  78. bool m_bEXTRACTGREENALPHA;
  79. #endif
  80. public:
  81. void SetEXTRACTGREENALPHA( int i )
  82. {
  83. Assert( i >= 0 && i <= 1 );
  84. m_nEXTRACTGREENALPHA = i;
  85. #ifdef _DEBUG
  86. m_bEXTRACTGREENALPHA = true;
  87. #endif
  88. }
  89. void SetEXTRACTGREENALPHA( bool i )
  90. {
  91. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  92. m_nEXTRACTGREENALPHA = i ? 1 : 0;
  93. #ifdef _DEBUG
  94. m_bEXTRACTGREENALPHA = true;
  95. #endif
  96. }
  97. private:
  98. int m_nDEPTHBLEND;
  99. #ifdef _DEBUG
  100. bool m_bDEPTHBLEND;
  101. #endif
  102. public:
  103. void SetDEPTHBLEND( int i )
  104. {
  105. Assert( i >= 0 && i <= 1 );
  106. m_nDEPTHBLEND = i;
  107. #ifdef _DEBUG
  108. m_bDEPTHBLEND = true;
  109. #endif
  110. }
  111. void SetDEPTHBLEND( bool i )
  112. {
  113. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  114. m_nDEPTHBLEND = i ? 1 : 0;
  115. #ifdef _DEBUG
  116. m_bDEPTHBLEND = true;
  117. #endif
  118. }
  119. private:
  120. int m_nANIMBLEND_OR_MAXLUMFRAMEBLEND1;
  121. #ifdef _DEBUG
  122. bool m_bANIMBLEND_OR_MAXLUMFRAMEBLEND1;
  123. #endif
  124. public:
  125. void SetANIMBLEND_OR_MAXLUMFRAMEBLEND1( int i )
  126. {
  127. Assert( i >= 0 && i <= 1 );
  128. m_nANIMBLEND_OR_MAXLUMFRAMEBLEND1 = i;
  129. #ifdef _DEBUG
  130. m_bANIMBLEND_OR_MAXLUMFRAMEBLEND1 = true;
  131. #endif
  132. }
  133. void SetANIMBLEND_OR_MAXLUMFRAMEBLEND1( bool i )
  134. {
  135. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  136. m_nANIMBLEND_OR_MAXLUMFRAMEBLEND1 = i ? 1 : 0;
  137. #ifdef _DEBUG
  138. m_bANIMBLEND_OR_MAXLUMFRAMEBLEND1 = true;
  139. #endif
  140. }
  141. private:
  142. int m_nCROP;
  143. #ifdef _DEBUG
  144. bool m_bCROP;
  145. #endif
  146. public:
  147. void SetCROP( int i )
  148. {
  149. Assert( i >= 0 && i <= 1 );
  150. m_nCROP = i;
  151. #ifdef _DEBUG
  152. m_bCROP = true;
  153. #endif
  154. }
  155. void SetCROP( bool i )
  156. {
  157. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  158. m_nCROP = i ? 1 : 0;
  159. #ifdef _DEBUG
  160. m_bCROP = true;
  161. #endif
  162. }
  163. private:
  164. int m_nPACKED_INTERPOLATOR;
  165. #ifdef _DEBUG
  166. bool m_bPACKED_INTERPOLATOR;
  167. #endif
  168. public:
  169. void SetPACKED_INTERPOLATOR( int i )
  170. {
  171. Assert( i >= 0 && i <= 1 );
  172. m_nPACKED_INTERPOLATOR = i;
  173. #ifdef _DEBUG
  174. m_bPACKED_INTERPOLATOR = true;
  175. #endif
  176. }
  177. void SetPACKED_INTERPOLATOR( bool i )
  178. {
  179. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  180. m_nPACKED_INTERPOLATOR = i ? 1 : 0;
  181. #ifdef _DEBUG
  182. m_bPACKED_INTERPOLATOR = true;
  183. #endif
  184. }
  185. private:
  186. int m_nSPRITECARDVERTEXFOG;
  187. #ifdef _DEBUG
  188. bool m_bSPRITECARDVERTEXFOG;
  189. #endif
  190. public:
  191. void SetSPRITECARDVERTEXFOG( int i )
  192. {
  193. Assert( i >= 0 && i <= 1 );
  194. m_nSPRITECARDVERTEXFOG = i;
  195. #ifdef _DEBUG
  196. m_bSPRITECARDVERTEXFOG = true;
  197. #endif
  198. }
  199. void SetSPRITECARDVERTEXFOG( bool i )
  200. {
  201. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  202. m_nSPRITECARDVERTEXFOG = i ? 1 : 0;
  203. #ifdef _DEBUG
  204. m_bSPRITECARDVERTEXFOG = true;
  205. #endif
  206. }
  207. private:
  208. int m_nHARDWAREFOGBLEND;
  209. #ifdef _DEBUG
  210. bool m_bHARDWAREFOGBLEND;
  211. #endif
  212. public:
  213. void SetHARDWAREFOGBLEND( int i )
  214. {
  215. Assert( i >= 0 && i <= 0 );
  216. m_nHARDWAREFOGBLEND = i;
  217. #ifdef _DEBUG
  218. m_bHARDWAREFOGBLEND = true;
  219. #endif
  220. }
  221. void SetHARDWAREFOGBLEND( bool i )
  222. {
  223. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  224. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  225. #ifdef _DEBUG
  226. m_bHARDWAREFOGBLEND = true;
  227. #endif
  228. }
  229. private:
  230. int m_nPERPARTICLEOUTLINE;
  231. #ifdef _DEBUG
  232. bool m_bPERPARTICLEOUTLINE;
  233. #endif
  234. public:
  235. void SetPERPARTICLEOUTLINE( int i )
  236. {
  237. Assert( i >= 0 && i <= 1 );
  238. m_nPERPARTICLEOUTLINE = i;
  239. #ifdef _DEBUG
  240. m_bPERPARTICLEOUTLINE = true;
  241. #endif
  242. }
  243. void SetPERPARTICLEOUTLINE( bool i )
  244. {
  245. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  246. m_nPERPARTICLEOUTLINE = i ? 1 : 0;
  247. #ifdef _DEBUG
  248. m_bPERPARTICLEOUTLINE = true;
  249. #endif
  250. }
  251. public:
  252. // CONSTRUCTOR
  253. spritecard_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  254. {
  255. #ifdef _DEBUG
  256. m_bZOOM_ANIMATE_SEQ2 = false;
  257. #endif // _DEBUG
  258. m_nZOOM_ANIMATE_SEQ2 = 0;
  259. #ifdef _DEBUG
  260. m_bDUALSEQUENCE = false;
  261. #endif // _DEBUG
  262. m_nDUALSEQUENCE = 0;
  263. #ifdef _DEBUG
  264. m_bADDBASETEXTURE2 = false;
  265. #endif // _DEBUG
  266. m_nADDBASETEXTURE2 = 0;
  267. #ifdef _DEBUG
  268. m_bEXTRACTGREENALPHA = false;
  269. #endif // _DEBUG
  270. m_nEXTRACTGREENALPHA = 0;
  271. #ifdef _DEBUG
  272. m_bDEPTHBLEND = false;
  273. #endif // _DEBUG
  274. m_nDEPTHBLEND = 0;
  275. #ifdef _DEBUG
  276. m_bANIMBLEND_OR_MAXLUMFRAMEBLEND1 = false;
  277. #endif // _DEBUG
  278. m_nANIMBLEND_OR_MAXLUMFRAMEBLEND1 = 0;
  279. #ifdef _DEBUG
  280. m_bCROP = false;
  281. #endif // _DEBUG
  282. m_nCROP = 0;
  283. #ifdef _DEBUG
  284. m_bPACKED_INTERPOLATOR = false;
  285. #endif // _DEBUG
  286. m_nPACKED_INTERPOLATOR = 0;
  287. #ifdef _DEBUG
  288. m_bSPRITECARDVERTEXFOG = false;
  289. #endif // _DEBUG
  290. m_nSPRITECARDVERTEXFOG = 0;
  291. #ifdef _DEBUG
  292. m_bHARDWAREFOGBLEND = false;
  293. #endif // _DEBUG
  294. m_nHARDWAREFOGBLEND = 0;
  295. #ifdef _DEBUG
  296. m_bPERPARTICLEOUTLINE = false;
  297. #endif // _DEBUG
  298. m_nPERPARTICLEOUTLINE = 0;
  299. }
  300. int GetIndex()
  301. {
  302. // Asserts to make sure that we aren't using any skipped combinations.
  303. // Asserts to make sure that we are setting all of the combination vars.
  304. #ifdef _DEBUG
  305. bool bAllStaticVarsDefined = m_bZOOM_ANIMATE_SEQ2 && m_bDUALSEQUENCE && m_bADDBASETEXTURE2 && m_bEXTRACTGREENALPHA && m_bDEPTHBLEND && m_bANIMBLEND_OR_MAXLUMFRAMEBLEND1 && m_bCROP && m_bPACKED_INTERPOLATOR && m_bSPRITECARDVERTEXFOG && m_bHARDWAREFOGBLEND && m_bPERPARTICLEOUTLINE;
  306. Assert( bAllStaticVarsDefined );
  307. #endif // _DEBUG
  308. return ( 4 * m_nZOOM_ANIMATE_SEQ2 ) + ( 8 * m_nDUALSEQUENCE ) + ( 16 * m_nADDBASETEXTURE2 ) + ( 32 * m_nEXTRACTGREENALPHA ) + ( 64 * m_nDEPTHBLEND ) + ( 128 * m_nANIMBLEND_OR_MAXLUMFRAMEBLEND1 ) + ( 256 * m_nCROP ) + ( 512 * m_nPACKED_INTERPOLATOR ) + ( 1024 * m_nSPRITECARDVERTEXFOG ) + ( 2048 * m_nHARDWAREFOGBLEND ) + ( 2048 * m_nPERPARTICLEOUTLINE ) + 0;
  309. }
  310. };
  311. #define shaderStaticTest_spritecard_vs20 vsh_forgot_to_set_static_ZOOM_ANIMATE_SEQ2 + vsh_forgot_to_set_static_DUALSEQUENCE + vsh_forgot_to_set_static_ADDBASETEXTURE2 + vsh_forgot_to_set_static_EXTRACTGREENALPHA + vsh_forgot_to_set_static_DEPTHBLEND + vsh_forgot_to_set_static_ANIMBLEND_OR_MAXLUMFRAMEBLEND1 + vsh_forgot_to_set_static_CROP + vsh_forgot_to_set_static_PACKED_INTERPOLATOR + vsh_forgot_to_set_static_SPRITECARDVERTEXFOG + vsh_forgot_to_set_static_HARDWAREFOGBLEND + vsh_forgot_to_set_static_PERPARTICLEOUTLINE + 0
  312. class spritecard_vs20_Dynamic_Index
  313. {
  314. private:
  315. int m_nORIENTATION;
  316. #ifdef _DEBUG
  317. bool m_bORIENTATION;
  318. #endif
  319. public:
  320. void SetORIENTATION( int i )
  321. {
  322. Assert( i >= 0 && i <= 3 );
  323. m_nORIENTATION = i;
  324. #ifdef _DEBUG
  325. m_bORIENTATION = true;
  326. #endif
  327. }
  328. void SetORIENTATION( bool i )
  329. {
  330. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 3 );
  331. m_nORIENTATION = i ? 1 : 0;
  332. #ifdef _DEBUG
  333. m_bORIENTATION = true;
  334. #endif
  335. }
  336. public:
  337. // CONSTRUCTOR
  338. spritecard_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  339. {
  340. #ifdef _DEBUG
  341. m_bORIENTATION = false;
  342. #endif // _DEBUG
  343. m_nORIENTATION = 0;
  344. }
  345. int GetIndex()
  346. {
  347. // Asserts to make sure that we aren't using any skipped combinations.
  348. // Asserts to make sure that we are setting all of the combination vars.
  349. #ifdef _DEBUG
  350. bool bAllDynamicVarsDefined = m_bORIENTATION;
  351. Assert( bAllDynamicVarsDefined );
  352. #endif // _DEBUG
  353. return ( 1 * m_nORIENTATION ) + 0;
  354. }
  355. };
  356. #define shaderDynamicTest_spritecard_vs20 vsh_forgot_to_set_dynamic_ORIENTATION + 0
  357. static const ShaderComboInformation_t s_DynamicComboArray_spritecard_vs20[1] =
  358. {
  359. { "ORIENTATION", 0, 3 },
  360. };
  361. static const ShaderComboInformation_t s_StaticComboArray_spritecard_vs20[11] =
  362. {
  363. { "ZOOM_ANIMATE_SEQ2", 0, 1 },
  364. { "DUALSEQUENCE", 0, 1 },
  365. { "ADDBASETEXTURE2", 0, 1 },
  366. { "EXTRACTGREENALPHA", 0, 1 },
  367. { "DEPTHBLEND", 0, 1 },
  368. { "ANIMBLEND_OR_MAXLUMFRAMEBLEND1", 0, 1 },
  369. { "CROP", 0, 1 },
  370. { "PACKED_INTERPOLATOR", 0, 1 },
  371. { "SPRITECARDVERTEXFOG", 0, 1 },
  372. { "HARDWAREFOGBLEND", 0, 0 },
  373. { "PERPARTICLEOUTLINE", 0, 1 },
  374. };
  375. static const ShaderComboSemantics_t spritecard_vs20_combos =
  376. {
  377. "spritecard_vs20", s_DynamicComboArray_spritecard_vs20, 1, s_StaticComboArray_spritecard_vs20, 11
  378. };
  379. class ConstructMe_spritecard_vs20
  380. {
  381. public:
  382. ConstructMe_spritecard_vs20()
  383. {
  384. GetShaderDLL()->AddShaderComboInformation( &spritecard_vs20_combos );
  385. }
  386. };
  387. static ConstructMe_spritecard_vs20 s_ConstructMe_spritecard_vs20;