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.

287 lines
7.4 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  3. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  6. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  7. // ( $GENERATEBASETEXTURE == 1 ) && ( $GENERATENORMAL == 1 )
  8. // ( $GENERATEBASETEXTURE == 1 ) && ( GENERATEMASKS1 == 1 )
  9. // ( $GENERATENORMAL == 1 ) && ( $GENERATEMASKS1 == 1 )
  10. // ( $CHEAPFILTERING == 1 ) && ( $GENERATEBASETEXTURE == 0 )
  11. // ( $USEPATTERN > 0 ) && ( $GENERATEBASETEXTURE == 0 )
  12. // ( $GENERATEBASETEXTURE == 0 ) && ( $GENERATENORMAL == 0 ) && ( GENERATEMASKS1 == 0 )
  13. // ( $GENERATENORMAL == 0 ) && ( $BUMPALPHAENVMASK == 1 )
  14. // ( $GENERATEBASETEXTURE == 0 ) && ( $BASEALPHAPHONGMASK == 1 )
  15. // ( $GENERATEBASETEXTURE == 0 ) && ( $BASEALPHAENVMASK == 1 )
  16. #include "shaderlib/cshader.h"
  17. class customcharacter_ps30_Static_Index
  18. {
  19. private:
  20. int m_nGENERATEBASETEXTURE;
  21. #ifdef _DEBUG
  22. bool m_bGENERATEBASETEXTURE;
  23. #endif
  24. public:
  25. void SetGENERATEBASETEXTURE( int i )
  26. {
  27. Assert( i >= 0 && i <= 1 );
  28. m_nGENERATEBASETEXTURE = i;
  29. #ifdef _DEBUG
  30. m_bGENERATEBASETEXTURE = true;
  31. #endif
  32. }
  33. void SetGENERATEBASETEXTURE( bool i )
  34. {
  35. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  36. m_nGENERATEBASETEXTURE = i ? 1 : 0;
  37. #ifdef _DEBUG
  38. m_bGENERATEBASETEXTURE = true;
  39. #endif
  40. }
  41. private:
  42. int m_nGENERATENORMAL;
  43. #ifdef _DEBUG
  44. bool m_bGENERATENORMAL;
  45. #endif
  46. public:
  47. void SetGENERATENORMAL( int i )
  48. {
  49. Assert( i >= 0 && i <= 1 );
  50. m_nGENERATENORMAL = i;
  51. #ifdef _DEBUG
  52. m_bGENERATENORMAL = true;
  53. #endif
  54. }
  55. void SetGENERATENORMAL( bool i )
  56. {
  57. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  58. m_nGENERATENORMAL = i ? 1 : 0;
  59. #ifdef _DEBUG
  60. m_bGENERATENORMAL = true;
  61. #endif
  62. }
  63. private:
  64. int m_nGENERATEMASKS1;
  65. #ifdef _DEBUG
  66. bool m_bGENERATEMASKS1;
  67. #endif
  68. public:
  69. void SetGENERATEMASKS1( int i )
  70. {
  71. Assert( i >= 0 && i <= 1 );
  72. m_nGENERATEMASKS1 = i;
  73. #ifdef _DEBUG
  74. m_bGENERATEMASKS1 = true;
  75. #endif
  76. }
  77. void SetGENERATEMASKS1( bool i )
  78. {
  79. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  80. m_nGENERATEMASKS1 = i ? 1 : 0;
  81. #ifdef _DEBUG
  82. m_bGENERATEMASKS1 = true;
  83. #endif
  84. }
  85. private:
  86. int m_nCHEAPFILTERING;
  87. #ifdef _DEBUG
  88. bool m_bCHEAPFILTERING;
  89. #endif
  90. public:
  91. void SetCHEAPFILTERING( int i )
  92. {
  93. Assert( i >= 0 && i <= 1 );
  94. m_nCHEAPFILTERING = i;
  95. #ifdef _DEBUG
  96. m_bCHEAPFILTERING = true;
  97. #endif
  98. }
  99. void SetCHEAPFILTERING( bool i )
  100. {
  101. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  102. m_nCHEAPFILTERING = i ? 1 : 0;
  103. #ifdef _DEBUG
  104. m_bCHEAPFILTERING = true;
  105. #endif
  106. }
  107. private:
  108. int m_nBASEALPHAPHONGMASK;
  109. #ifdef _DEBUG
  110. bool m_bBASEALPHAPHONGMASK;
  111. #endif
  112. public:
  113. void SetBASEALPHAPHONGMASK( int i )
  114. {
  115. Assert( i >= 0 && i <= 1 );
  116. m_nBASEALPHAPHONGMASK = i;
  117. #ifdef _DEBUG
  118. m_bBASEALPHAPHONGMASK = true;
  119. #endif
  120. }
  121. void SetBASEALPHAPHONGMASK( bool i )
  122. {
  123. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  124. m_nBASEALPHAPHONGMASK = i ? 1 : 0;
  125. #ifdef _DEBUG
  126. m_bBASEALPHAPHONGMASK = true;
  127. #endif
  128. }
  129. private:
  130. int m_nBASEALPHAENVMASK;
  131. #ifdef _DEBUG
  132. bool m_bBASEALPHAENVMASK;
  133. #endif
  134. public:
  135. void SetBASEALPHAENVMASK( int i )
  136. {
  137. Assert( i >= 0 && i <= 1 );
  138. m_nBASEALPHAENVMASK = i;
  139. #ifdef _DEBUG
  140. m_bBASEALPHAENVMASK = true;
  141. #endif
  142. }
  143. void SetBASEALPHAENVMASK( bool i )
  144. {
  145. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  146. m_nBASEALPHAENVMASK = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bBASEALPHAENVMASK = true;
  149. #endif
  150. }
  151. private:
  152. int m_nBUMPALPHAENVMASK;
  153. #ifdef _DEBUG
  154. bool m_bBUMPALPHAENVMASK;
  155. #endif
  156. public:
  157. void SetBUMPALPHAENVMASK( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nBUMPALPHAENVMASK = i;
  161. #ifdef _DEBUG
  162. m_bBUMPALPHAENVMASK = true;
  163. #endif
  164. }
  165. void SetBUMPALPHAENVMASK( bool i )
  166. {
  167. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  168. m_nBUMPALPHAENVMASK = i ? 1 : 0;
  169. #ifdef _DEBUG
  170. m_bBUMPALPHAENVMASK = true;
  171. #endif
  172. }
  173. private:
  174. int m_nUSEPATTERN;
  175. #ifdef _DEBUG
  176. bool m_bUSEPATTERN;
  177. #endif
  178. public:
  179. void SetUSEPATTERN( int i )
  180. {
  181. Assert( i >= 0 && i <= 4 );
  182. m_nUSEPATTERN = i;
  183. #ifdef _DEBUG
  184. m_bUSEPATTERN = true;
  185. #endif
  186. }
  187. void SetUSEPATTERN( bool i )
  188. {
  189. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 4 );
  190. m_nUSEPATTERN = i ? 1 : 0;
  191. #ifdef _DEBUG
  192. m_bUSEPATTERN = true;
  193. #endif
  194. }
  195. public:
  196. // CONSTRUCTOR
  197. customcharacter_ps30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  198. {
  199. #ifdef _DEBUG
  200. m_bGENERATEBASETEXTURE = false;
  201. #endif // _DEBUG
  202. m_nGENERATEBASETEXTURE = 0;
  203. #ifdef _DEBUG
  204. m_bGENERATENORMAL = false;
  205. #endif // _DEBUG
  206. m_nGENERATENORMAL = 0;
  207. #ifdef _DEBUG
  208. m_bGENERATEMASKS1 = false;
  209. #endif // _DEBUG
  210. m_nGENERATEMASKS1 = 0;
  211. #ifdef _DEBUG
  212. m_bCHEAPFILTERING = false;
  213. #endif // _DEBUG
  214. m_nCHEAPFILTERING = 0;
  215. #ifdef _DEBUG
  216. m_bBASEALPHAPHONGMASK = false;
  217. #endif // _DEBUG
  218. m_nBASEALPHAPHONGMASK = 0;
  219. #ifdef _DEBUG
  220. m_bBASEALPHAENVMASK = false;
  221. #endif // _DEBUG
  222. m_nBASEALPHAENVMASK = 0;
  223. #ifdef _DEBUG
  224. m_bBUMPALPHAENVMASK = false;
  225. #endif // _DEBUG
  226. m_nBUMPALPHAENVMASK = 0;
  227. #ifdef _DEBUG
  228. m_bUSEPATTERN = false;
  229. #endif // _DEBUG
  230. m_nUSEPATTERN = 0;
  231. }
  232. int GetIndex()
  233. {
  234. // Asserts to make sure that we aren't using any skipped combinations.
  235. // Asserts to make sure that we are setting all of the combination vars.
  236. #ifdef _DEBUG
  237. bool bAllStaticVarsDefined = m_bGENERATEBASETEXTURE && m_bGENERATENORMAL && m_bGENERATEMASKS1 && m_bCHEAPFILTERING && m_bBASEALPHAPHONGMASK && m_bBASEALPHAENVMASK && m_bBUMPALPHAENVMASK && m_bUSEPATTERN;
  238. Assert( bAllStaticVarsDefined );
  239. #endif // _DEBUG
  240. return ( 1 * m_nGENERATEBASETEXTURE ) + ( 2 * m_nGENERATENORMAL ) + ( 4 * m_nGENERATEMASKS1 ) + ( 8 * m_nCHEAPFILTERING ) + ( 16 * m_nBASEALPHAPHONGMASK ) + ( 32 * m_nBASEALPHAENVMASK ) + ( 64 * m_nBUMPALPHAENVMASK ) + ( 128 * m_nUSEPATTERN ) + 0;
  241. }
  242. };
  243. #define shaderStaticTest_customcharacter_ps30 psh_forgot_to_set_static_GENERATEBASETEXTURE + psh_forgot_to_set_static_GENERATENORMAL + psh_forgot_to_set_static_GENERATEMASKS1 + psh_forgot_to_set_static_CHEAPFILTERING + psh_forgot_to_set_static_BASEALPHAPHONGMASK + psh_forgot_to_set_static_BASEALPHAENVMASK + psh_forgot_to_set_static_BUMPALPHAENVMASK + psh_forgot_to_set_static_USEPATTERN + 0
  244. class customcharacter_ps30_Dynamic_Index
  245. {
  246. public:
  247. // CONSTRUCTOR
  248. customcharacter_ps30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  249. {
  250. }
  251. int GetIndex()
  252. {
  253. // Asserts to make sure that we aren't using any skipped combinations.
  254. // Asserts to make sure that we are setting all of the combination vars.
  255. #ifdef _DEBUG
  256. #endif // _DEBUG
  257. return 0;
  258. }
  259. };
  260. #define shaderDynamicTest_customcharacter_ps30 0
  261. static const ShaderComboInformation_t s_StaticComboArray_customcharacter_ps30[8] =
  262. {
  263. { "GENERATEBASETEXTURE", 0, 1 },
  264. { "GENERATENORMAL", 0, 1 },
  265. { "GENERATEMASKS1", 0, 1 },
  266. { "CHEAPFILTERING", 0, 1 },
  267. { "BASEALPHAPHONGMASK", 0, 1 },
  268. { "BASEALPHAENVMASK", 0, 1 },
  269. { "BUMPALPHAENVMASK", 0, 1 },
  270. { "USEPATTERN", 0, 4 },
  271. };
  272. static const ShaderComboSemantics_t customcharacter_ps30_combos =
  273. {
  274. "customcharacter_ps30", NULL, 0, s_StaticComboArray_customcharacter_ps30, 8
  275. };
  276. class ConstructMe_customcharacter_ps30
  277. {
  278. public:
  279. ConstructMe_customcharacter_ps30()
  280. {
  281. GetShaderDLL()->AddShaderComboInformation( &customcharacter_ps30_combos );
  282. }
  283. };
  284. static ConstructMe_customcharacter_ps30 s_ConstructMe_customcharacter_ps30;