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.

254 lines
5.7 KiB

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