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.

255 lines
5.7 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $DOWATERFOG == 0 ) && ( $DOPIXELFOG && $HARDWAREFOGBLEND )
  3. // ( $DOWATERFOG == 0 ) && ( $HARDWAREFOGBLEND == 0 ) && ( $DOPIXELFOG == 0 )
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  5. #include "shaderlib/cshader.h"
  6. class decalmodulate_vs20_Static_Index
  7. {
  8. private:
  9. int m_nVERTEXCOLOR;
  10. #ifdef _DEBUG
  11. bool m_bVERTEXCOLOR;
  12. #endif
  13. public:
  14. void SetVERTEXCOLOR( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nVERTEXCOLOR = i;
  18. #ifdef _DEBUG
  19. m_bVERTEXCOLOR = true;
  20. #endif
  21. }
  22. void SetVERTEXCOLOR( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  25. m_nVERTEXCOLOR = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bVERTEXCOLOR = true;
  28. #endif
  29. }
  30. private:
  31. int m_nLIGHTING_PREVIEW;
  32. #ifdef _DEBUG
  33. bool m_bLIGHTING_PREVIEW;
  34. #endif
  35. public:
  36. void SetLIGHTING_PREVIEW( int i )
  37. {
  38. Assert( i >= 0 && i <= 0 );
  39. m_nLIGHTING_PREVIEW = i;
  40. #ifdef _DEBUG
  41. m_bLIGHTING_PREVIEW = true;
  42. #endif
  43. }
  44. void SetLIGHTING_PREVIEW( bool i )
  45. {
  46. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  47. m_nLIGHTING_PREVIEW = i ? 1 : 0;
  48. #ifdef _DEBUG
  49. m_bLIGHTING_PREVIEW = true;
  50. #endif
  51. }
  52. private:
  53. int m_nDOPIXELFOG;
  54. #ifdef _DEBUG
  55. bool m_bDOPIXELFOG;
  56. #endif
  57. public:
  58. void SetDOPIXELFOG( int i )
  59. {
  60. Assert( i >= 0 && i <= 1 );
  61. m_nDOPIXELFOG = i;
  62. #ifdef _DEBUG
  63. m_bDOPIXELFOG = true;
  64. #endif
  65. }
  66. void SetDOPIXELFOG( bool i )
  67. {
  68. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  69. m_nDOPIXELFOG = i ? 1 : 0;
  70. #ifdef _DEBUG
  71. m_bDOPIXELFOG = true;
  72. #endif
  73. }
  74. public:
  75. // CONSTRUCTOR
  76. decalmodulate_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  77. {
  78. #ifdef _DEBUG
  79. m_bVERTEXCOLOR = false;
  80. #endif // _DEBUG
  81. m_nVERTEXCOLOR = 0;
  82. #ifdef _DEBUG
  83. m_bLIGHTING_PREVIEW = false;
  84. #endif // _DEBUG
  85. m_nLIGHTING_PREVIEW = 0;
  86. #ifdef _DEBUG
  87. m_bDOPIXELFOG = true;
  88. #endif // _DEBUG
  89. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  90. }
  91. int GetIndex()
  92. {
  93. // Asserts to make sure that we aren't using any skipped combinations.
  94. // Asserts to make sure that we are setting all of the combination vars.
  95. #ifdef _DEBUG
  96. bool bAllStaticVarsDefined = m_bVERTEXCOLOR && m_bLIGHTING_PREVIEW && m_bDOPIXELFOG;
  97. Assert( bAllStaticVarsDefined );
  98. #endif // _DEBUG
  99. return ( 4 * m_nVERTEXCOLOR ) + ( 8 * m_nLIGHTING_PREVIEW ) + ( 8 * m_nDOPIXELFOG ) + 0;
  100. }
  101. };
  102. #define shaderStaticTest_decalmodulate_vs20 vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_LIGHTING_PREVIEW + 0
  103. class decalmodulate_vs20_Dynamic_Index
  104. {
  105. private:
  106. int m_nCOMPRESSED_VERTS;
  107. #ifdef _DEBUG
  108. bool m_bCOMPRESSED_VERTS;
  109. #endif
  110. public:
  111. void SetCOMPRESSED_VERTS( int i )
  112. {
  113. Assert( i >= 0 && i <= 1 );
  114. m_nCOMPRESSED_VERTS = i;
  115. #ifdef _DEBUG
  116. m_bCOMPRESSED_VERTS = true;
  117. #endif
  118. }
  119. void SetCOMPRESSED_VERTS( bool i )
  120. {
  121. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  122. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  123. #ifdef _DEBUG
  124. m_bCOMPRESSED_VERTS = true;
  125. #endif
  126. }
  127. private:
  128. int m_nDOWATERFOG;
  129. #ifdef _DEBUG
  130. bool m_bDOWATERFOG;
  131. #endif
  132. public:
  133. void SetDOWATERFOG( int i )
  134. {
  135. Assert( i >= 0 && i <= 1 );
  136. m_nDOWATERFOG = i;
  137. #ifdef _DEBUG
  138. m_bDOWATERFOG = true;
  139. #endif
  140. }
  141. void SetDOWATERFOG( bool i )
  142. {
  143. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  144. m_nDOWATERFOG = i ? 1 : 0;
  145. #ifdef _DEBUG
  146. m_bDOWATERFOG = true;
  147. #endif
  148. }
  149. private:
  150. int m_nSKINNING;
  151. #ifdef _DEBUG
  152. bool m_bSKINNING;
  153. #endif
  154. public:
  155. void SetSKINNING( int i )
  156. {
  157. Assert( i >= 0 && i <= 0 );
  158. m_nSKINNING = i;
  159. #ifdef _DEBUG
  160. m_bSKINNING = true;
  161. #endif
  162. }
  163. void SetSKINNING( bool i )
  164. {
  165. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  166. m_nSKINNING = i ? 1 : 0;
  167. #ifdef _DEBUG
  168. m_bSKINNING = true;
  169. #endif
  170. }
  171. private:
  172. int m_nMORPHING;
  173. #ifdef _DEBUG
  174. bool m_bMORPHING;
  175. #endif
  176. public:
  177. void SetMORPHING( int i )
  178. {
  179. Assert( i >= 0 && i <= 0 );
  180. m_nMORPHING = i;
  181. #ifdef _DEBUG
  182. m_bMORPHING = true;
  183. #endif
  184. }
  185. void SetMORPHING( bool i )
  186. {
  187. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  188. m_nMORPHING = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bMORPHING = true;
  191. #endif
  192. }
  193. public:
  194. // CONSTRUCTOR
  195. decalmodulate_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  196. {
  197. #ifdef _DEBUG
  198. m_bCOMPRESSED_VERTS = false;
  199. #endif // _DEBUG
  200. m_nCOMPRESSED_VERTS = 0;
  201. #ifdef _DEBUG
  202. m_bDOWATERFOG = true;
  203. #endif // _DEBUG
  204. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  205. #ifdef _DEBUG
  206. m_bSKINNING = false;
  207. #endif // _DEBUG
  208. m_nSKINNING = 0;
  209. #ifdef _DEBUG
  210. m_bMORPHING = true;
  211. #endif // _DEBUG
  212. m_nMORPHING = false ;
  213. }
  214. int GetIndex()
  215. {
  216. // Asserts to make sure that we aren't using any skipped combinations.
  217. // Asserts to make sure that we are setting all of the combination vars.
  218. #ifdef _DEBUG
  219. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bMORPHING;
  220. Assert( bAllDynamicVarsDefined );
  221. #endif // _DEBUG
  222. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 4 * m_nMORPHING ) + 0;
  223. }
  224. };
  225. #define shaderDynamicTest_decalmodulate_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + 0
  226. static const ShaderComboInformation_t s_DynamicComboArray_decalmodulate_vs20[4] =
  227. {
  228. { "COMPRESSED_VERTS", 0, 1 },
  229. { "DOWATERFOG", 0, 1 },
  230. { "SKINNING", 0, 0 },
  231. { "MORPHING", 0, 0 },
  232. };
  233. static const ShaderComboInformation_t s_StaticComboArray_decalmodulate_vs20[3] =
  234. {
  235. { "VERTEXCOLOR", 0, 1 },
  236. { "LIGHTING_PREVIEW", 0, 0 },
  237. { "DOPIXELFOG", 0, 1 },
  238. };
  239. static const ShaderComboSemantics_t decalmodulate_vs20_combos =
  240. {
  241. "decalmodulate_vs20", s_DynamicComboArray_decalmodulate_vs20, 4, s_StaticComboArray_decalmodulate_vs20, 3
  242. };
  243. class ConstructMe_decalmodulate_vs20
  244. {
  245. public:
  246. ConstructMe_decalmodulate_vs20()
  247. {
  248. GetShaderDLL()->AddShaderComboInformation( &decalmodulate_vs20_combos );
  249. }
  250. };
  251. static ConstructMe_decalmodulate_vs20 s_ConstructMe_decalmodulate_vs20;