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.

273 lines
7.4 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $PAINTSTYLE == 0 )
  3. // ( ( $CHEAPMODE == 1 ) && !( ( $PAINTSTYLE == 3 ) || ( $PAINTSTYLE == 6 ) ) )
  4. // ( ( $EXPONENTMODE == 1 ) && ( $CHEAPMODE == 1 ) )
  5. // ( ( $NUM_LIGHTS != 0 ) && ( $PREVIEW == 0 ) )
  6. // ( ( $PREVIEW == 0 ) && ( $PREVIEWPHONGALBEDOTINT == 1 ) )
  7. // ( ( $PREVIEW == 1 ) && ( $EXPONENTMODE == 1 ) )
  8. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  9. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  10. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  11. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  12. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  13. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  14. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  15. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  16. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  17. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  18. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  19. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  20. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  21. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  22. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  23. #include "shaderlib/cshader.h"
  24. class customweapon_ps30_Static_Index
  25. {
  26. private:
  27. int m_nPAINTSTYLE;
  28. #ifdef _DEBUG
  29. bool m_bPAINTSTYLE;
  30. #endif
  31. public:
  32. void SetPAINTSTYLE( int i )
  33. {
  34. Assert( i >= 0 && i <= 9 );
  35. m_nPAINTSTYLE = i;
  36. #ifdef _DEBUG
  37. m_bPAINTSTYLE = true;
  38. #endif
  39. }
  40. void SetPAINTSTYLE( bool i )
  41. {
  42. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 9 );
  43. m_nPAINTSTYLE = i ? 1 : 0;
  44. #ifdef _DEBUG
  45. m_bPAINTSTYLE = true;
  46. #endif
  47. }
  48. private:
  49. int m_nEXPONENTMODE;
  50. #ifdef _DEBUG
  51. bool m_bEXPONENTMODE;
  52. #endif
  53. public:
  54. void SetEXPONENTMODE( int i )
  55. {
  56. Assert( i >= 0 && i <= 1 );
  57. m_nEXPONENTMODE = i;
  58. #ifdef _DEBUG
  59. m_bEXPONENTMODE = true;
  60. #endif
  61. }
  62. void SetEXPONENTMODE( bool i )
  63. {
  64. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  65. m_nEXPONENTMODE = i ? 1 : 0;
  66. #ifdef _DEBUG
  67. m_bEXPONENTMODE = true;
  68. #endif
  69. }
  70. private:
  71. int m_nCHEAPMODE;
  72. #ifdef _DEBUG
  73. bool m_bCHEAPMODE;
  74. #endif
  75. public:
  76. void SetCHEAPMODE( int i )
  77. {
  78. Assert( i >= 0 && i <= 1 );
  79. m_nCHEAPMODE = i;
  80. #ifdef _DEBUG
  81. m_bCHEAPMODE = true;
  82. #endif
  83. }
  84. void SetCHEAPMODE( bool i )
  85. {
  86. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  87. m_nCHEAPMODE = i ? 1 : 0;
  88. #ifdef _DEBUG
  89. m_bCHEAPMODE = true;
  90. #endif
  91. }
  92. private:
  93. int m_nPREVIEW;
  94. #ifdef _DEBUG
  95. bool m_bPREVIEW;
  96. #endif
  97. public:
  98. void SetPREVIEW( int i )
  99. {
  100. Assert( i >= 0 && i <= 1 );
  101. m_nPREVIEW = i;
  102. #ifdef _DEBUG
  103. m_bPREVIEW = true;
  104. #endif
  105. }
  106. void SetPREVIEW( bool i )
  107. {
  108. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  109. m_nPREVIEW = i ? 1 : 0;
  110. #ifdef _DEBUG
  111. m_bPREVIEW = true;
  112. #endif
  113. }
  114. private:
  115. int m_nPREVIEWPHONGALBEDOTINT;
  116. #ifdef _DEBUG
  117. bool m_bPREVIEWPHONGALBEDOTINT;
  118. #endif
  119. public:
  120. void SetPREVIEWPHONGALBEDOTINT( int i )
  121. {
  122. Assert( i >= 0 && i <= 1 );
  123. m_nPREVIEWPHONGALBEDOTINT = i;
  124. #ifdef _DEBUG
  125. m_bPREVIEWPHONGALBEDOTINT = true;
  126. #endif
  127. }
  128. void SetPREVIEWPHONGALBEDOTINT( bool i )
  129. {
  130. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  131. m_nPREVIEWPHONGALBEDOTINT = i ? 1 : 0;
  132. #ifdef _DEBUG
  133. m_bPREVIEWPHONGALBEDOTINT = true;
  134. #endif
  135. }
  136. private:
  137. int m_nPHONGALBEDOFACTORMODE;
  138. #ifdef _DEBUG
  139. bool m_bPHONGALBEDOFACTORMODE;
  140. #endif
  141. public:
  142. void SetPHONGALBEDOFACTORMODE( int i )
  143. {
  144. Assert( i >= 0 && i <= 1 );
  145. m_nPHONGALBEDOFACTORMODE = i;
  146. #ifdef _DEBUG
  147. m_bPHONGALBEDOFACTORMODE = true;
  148. #endif
  149. }
  150. void SetPHONGALBEDOFACTORMODE( bool i )
  151. {
  152. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  153. m_nPHONGALBEDOFACTORMODE = i ? 1 : 0;
  154. #ifdef _DEBUG
  155. m_bPHONGALBEDOFACTORMODE = true;
  156. #endif
  157. }
  158. public:
  159. // CONSTRUCTOR
  160. customweapon_ps30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  161. {
  162. #ifdef _DEBUG
  163. m_bPAINTSTYLE = false;
  164. #endif // _DEBUG
  165. m_nPAINTSTYLE = 0;
  166. #ifdef _DEBUG
  167. m_bEXPONENTMODE = false;
  168. #endif // _DEBUG
  169. m_nEXPONENTMODE = 0;
  170. #ifdef _DEBUG
  171. m_bCHEAPMODE = false;
  172. #endif // _DEBUG
  173. m_nCHEAPMODE = 0;
  174. #ifdef _DEBUG
  175. m_bPREVIEW = false;
  176. #endif // _DEBUG
  177. m_nPREVIEW = 0;
  178. #ifdef _DEBUG
  179. m_bPREVIEWPHONGALBEDOTINT = false;
  180. #endif // _DEBUG
  181. m_nPREVIEWPHONGALBEDOTINT = 0;
  182. #ifdef _DEBUG
  183. m_bPHONGALBEDOFACTORMODE = false;
  184. #endif // _DEBUG
  185. m_nPHONGALBEDOFACTORMODE = 0;
  186. }
  187. int GetIndex()
  188. {
  189. // Asserts to make sure that we aren't using any skipped combinations.
  190. // Asserts to make sure that we are setting all of the combination vars.
  191. #ifdef _DEBUG
  192. bool bAllStaticVarsDefined = m_bPAINTSTYLE && m_bEXPONENTMODE && m_bCHEAPMODE && m_bPREVIEW && m_bPREVIEWPHONGALBEDOTINT && m_bPHONGALBEDOFACTORMODE;
  193. Assert( bAllStaticVarsDefined );
  194. #endif // _DEBUG
  195. return ( 5 * m_nPAINTSTYLE ) + ( 50 * m_nEXPONENTMODE ) + ( 100 * m_nCHEAPMODE ) + ( 200 * m_nPREVIEW ) + ( 400 * m_nPREVIEWPHONGALBEDOTINT ) + ( 800 * m_nPHONGALBEDOFACTORMODE ) + 0;
  196. }
  197. };
  198. #define shaderStaticTest_customweapon_ps30 psh_forgot_to_set_static_PAINTSTYLE + psh_forgot_to_set_static_EXPONENTMODE + psh_forgot_to_set_static_CHEAPMODE + psh_forgot_to_set_static_PREVIEW + psh_forgot_to_set_static_PREVIEWPHONGALBEDOTINT + psh_forgot_to_set_static_PHONGALBEDOFACTORMODE + 0
  199. class customweapon_ps30_Dynamic_Index
  200. {
  201. private:
  202. int m_nNUM_LIGHTS;
  203. #ifdef _DEBUG
  204. bool m_bNUM_LIGHTS;
  205. #endif
  206. public:
  207. void SetNUM_LIGHTS( int i )
  208. {
  209. Assert( i >= 0 && i <= 4 );
  210. m_nNUM_LIGHTS = i;
  211. #ifdef _DEBUG
  212. m_bNUM_LIGHTS = true;
  213. #endif
  214. }
  215. void SetNUM_LIGHTS( bool i )
  216. {
  217. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 4 );
  218. m_nNUM_LIGHTS = i ? 1 : 0;
  219. #ifdef _DEBUG
  220. m_bNUM_LIGHTS = true;
  221. #endif
  222. }
  223. public:
  224. // CONSTRUCTOR
  225. customweapon_ps30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  226. {
  227. #ifdef _DEBUG
  228. m_bNUM_LIGHTS = false;
  229. #endif // _DEBUG
  230. m_nNUM_LIGHTS = 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 bAllDynamicVarsDefined = m_bNUM_LIGHTS;
  238. Assert( bAllDynamicVarsDefined );
  239. #endif // _DEBUG
  240. return ( 1 * m_nNUM_LIGHTS ) + 0;
  241. }
  242. };
  243. #define shaderDynamicTest_customweapon_ps30 psh_forgot_to_set_dynamic_NUM_LIGHTS + 0
  244. static const ShaderComboInformation_t s_DynamicComboArray_customweapon_ps30[1] =
  245. {
  246. { "NUM_LIGHTS", 0, 4 },
  247. };
  248. static const ShaderComboInformation_t s_StaticComboArray_customweapon_ps30[6] =
  249. {
  250. { "PAINTSTYLE", 0, 9 },
  251. { "EXPONENTMODE", 0, 1 },
  252. { "CHEAPMODE", 0, 1 },
  253. { "PREVIEW", 0, 1 },
  254. { "PREVIEWPHONGALBEDOTINT", 0, 1 },
  255. { "PHONGALBEDOFACTORMODE", 0, 1 },
  256. };
  257. static const ShaderComboSemantics_t customweapon_ps30_combos =
  258. {
  259. "customweapon_ps30", s_DynamicComboArray_customweapon_ps30, 1, s_StaticComboArray_customweapon_ps30, 6
  260. };
  261. class ConstructMe_customweapon_ps30
  262. {
  263. public:
  264. ConstructMe_customweapon_ps30()
  265. {
  266. GetShaderDLL()->AddShaderComboInformation( &customweapon_ps30_combos );
  267. }
  268. };
  269. static ConstructMe_customweapon_ps30 s_ConstructMe_customweapon_ps30;