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.

336 lines
7.5 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 teeth_vs20_Static_Index
  7. {
  8. private:
  9. int m_nFLATTEN_STATIC_CONTROL_FLOW;
  10. #ifdef _DEBUG
  11. bool m_bFLATTEN_STATIC_CONTROL_FLOW;
  12. #endif
  13. public:
  14. void SetFLATTEN_STATIC_CONTROL_FLOW( int i )
  15. {
  16. Assert( i >= 0 && i <= 0 );
  17. m_nFLATTEN_STATIC_CONTROL_FLOW = i;
  18. #ifdef _DEBUG
  19. m_bFLATTEN_STATIC_CONTROL_FLOW = true;
  20. #endif
  21. }
  22. void SetFLATTEN_STATIC_CONTROL_FLOW( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  25. m_nFLATTEN_STATIC_CONTROL_FLOW = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bFLATTEN_STATIC_CONTROL_FLOW = true;
  28. #endif
  29. }
  30. private:
  31. int m_nDOPIXELFOG;
  32. #ifdef _DEBUG
  33. bool m_bDOPIXELFOG;
  34. #endif
  35. public:
  36. void SetDOPIXELFOG( int i )
  37. {
  38. Assert( i >= 0 && i <= 1 );
  39. m_nDOPIXELFOG = i;
  40. #ifdef _DEBUG
  41. m_bDOPIXELFOG = true;
  42. #endif
  43. }
  44. void SetDOPIXELFOG( bool i )
  45. {
  46. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  47. m_nDOPIXELFOG = i ? 1 : 0;
  48. #ifdef _DEBUG
  49. m_bDOPIXELFOG = true;
  50. #endif
  51. }
  52. private:
  53. int m_nHARDWAREFOGBLEND;
  54. #ifdef _DEBUG
  55. bool m_bHARDWAREFOGBLEND;
  56. #endif
  57. public:
  58. void SetHARDWAREFOGBLEND( int i )
  59. {
  60. Assert( i >= 0 && i <= 0 );
  61. m_nHARDWAREFOGBLEND = i;
  62. #ifdef _DEBUG
  63. m_bHARDWAREFOGBLEND = true;
  64. #endif
  65. }
  66. void SetHARDWAREFOGBLEND( bool i )
  67. {
  68. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  69. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  70. #ifdef _DEBUG
  71. m_bHARDWAREFOGBLEND = true;
  72. #endif
  73. }
  74. public:
  75. // CONSTRUCTOR
  76. teeth_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  77. {
  78. #ifdef _DEBUG
  79. m_bFLATTEN_STATIC_CONTROL_FLOW = false;
  80. #endif // _DEBUG
  81. m_nFLATTEN_STATIC_CONTROL_FLOW = 0;
  82. #ifdef _DEBUG
  83. m_bDOPIXELFOG = true;
  84. #endif // _DEBUG
  85. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  86. #ifdef _DEBUG
  87. m_bHARDWAREFOGBLEND = true;
  88. #endif // _DEBUG
  89. m_nHARDWAREFOGBLEND = 0 ;
  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_bFLATTEN_STATIC_CONTROL_FLOW && m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  97. Assert( bAllStaticVarsDefined );
  98. #endif // _DEBUG
  99. return ( 32 * m_nFLATTEN_STATIC_CONTROL_FLOW ) + ( 32 * m_nDOPIXELFOG ) + ( 64 * m_nHARDWAREFOGBLEND ) + 0;
  100. }
  101. };
  102. #define shaderStaticTest_teeth_vs20 vsh_forgot_to_set_static_FLATTEN_STATIC_CONTROL_FLOW + 0
  103. class teeth_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 <= 1 );
  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 ) <= 1 );
  166. m_nSKINNING = i ? 1 : 0;
  167. #ifdef _DEBUG
  168. m_bSKINNING = true;
  169. #endif
  170. }
  171. private:
  172. int m_nDYNAMIC_LIGHT;
  173. #ifdef _DEBUG
  174. bool m_bDYNAMIC_LIGHT;
  175. #endif
  176. public:
  177. void SetDYNAMIC_LIGHT( int i )
  178. {
  179. Assert( i >= 0 && i <= 1 );
  180. m_nDYNAMIC_LIGHT = i;
  181. #ifdef _DEBUG
  182. m_bDYNAMIC_LIGHT = true;
  183. #endif
  184. }
  185. void SetDYNAMIC_LIGHT( bool i )
  186. {
  187. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  188. m_nDYNAMIC_LIGHT = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bDYNAMIC_LIGHT = true;
  191. #endif
  192. }
  193. private:
  194. int m_nSTATIC_LIGHT;
  195. #ifdef _DEBUG
  196. bool m_bSTATIC_LIGHT;
  197. #endif
  198. public:
  199. void SetSTATIC_LIGHT( int i )
  200. {
  201. Assert( i >= 0 && i <= 1 );
  202. m_nSTATIC_LIGHT = i;
  203. #ifdef _DEBUG
  204. m_bSTATIC_LIGHT = true;
  205. #endif
  206. }
  207. void SetSTATIC_LIGHT( bool i )
  208. {
  209. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  210. m_nSTATIC_LIGHT = i ? 1 : 0;
  211. #ifdef _DEBUG
  212. m_bSTATIC_LIGHT = true;
  213. #endif
  214. }
  215. private:
  216. int m_nMORPHING;
  217. #ifdef _DEBUG
  218. bool m_bMORPHING;
  219. #endif
  220. public:
  221. void SetMORPHING( int i )
  222. {
  223. Assert( i >= 0 && i <= 0 );
  224. m_nMORPHING = i;
  225. #ifdef _DEBUG
  226. m_bMORPHING = true;
  227. #endif
  228. }
  229. void SetMORPHING( bool i )
  230. {
  231. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  232. m_nMORPHING = i ? 1 : 0;
  233. #ifdef _DEBUG
  234. m_bMORPHING = true;
  235. #endif
  236. }
  237. private:
  238. int m_nNUM_LIGHTS;
  239. #ifdef _DEBUG
  240. bool m_bNUM_LIGHTS;
  241. #endif
  242. public:
  243. void SetNUM_LIGHTS( int i )
  244. {
  245. Assert( i >= 0 && i <= 0 );
  246. m_nNUM_LIGHTS = i;
  247. #ifdef _DEBUG
  248. m_bNUM_LIGHTS = true;
  249. #endif
  250. }
  251. void SetNUM_LIGHTS( bool i )
  252. {
  253. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  254. m_nNUM_LIGHTS = i ? 1 : 0;
  255. #ifdef _DEBUG
  256. m_bNUM_LIGHTS = true;
  257. #endif
  258. }
  259. public:
  260. // CONSTRUCTOR
  261. teeth_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  262. {
  263. #ifdef _DEBUG
  264. m_bCOMPRESSED_VERTS = false;
  265. #endif // _DEBUG
  266. m_nCOMPRESSED_VERTS = 0;
  267. #ifdef _DEBUG
  268. m_bDOWATERFOG = true;
  269. #endif // _DEBUG
  270. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  271. #ifdef _DEBUG
  272. m_bSKINNING = false;
  273. #endif // _DEBUG
  274. m_nSKINNING = 0;
  275. #ifdef _DEBUG
  276. m_bDYNAMIC_LIGHT = false;
  277. #endif // _DEBUG
  278. m_nDYNAMIC_LIGHT = 0;
  279. #ifdef _DEBUG
  280. m_bSTATIC_LIGHT = false;
  281. #endif // _DEBUG
  282. m_nSTATIC_LIGHT = 0;
  283. #ifdef _DEBUG
  284. m_bMORPHING = true;
  285. #endif // _DEBUG
  286. m_nMORPHING = false ;
  287. #ifdef _DEBUG
  288. m_bNUM_LIGHTS = false;
  289. #endif // _DEBUG
  290. m_nNUM_LIGHTS = 0;
  291. }
  292. int GetIndex()
  293. {
  294. // Asserts to make sure that we aren't using any skipped combinations.
  295. // Asserts to make sure that we are setting all of the combination vars.
  296. #ifdef _DEBUG
  297. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bMORPHING && m_bNUM_LIGHTS;
  298. Assert( bAllDynamicVarsDefined );
  299. #endif // _DEBUG
  300. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nDYNAMIC_LIGHT ) + ( 16 * m_nSTATIC_LIGHT ) + ( 32 * m_nMORPHING ) + ( 32 * m_nNUM_LIGHTS ) + 0;
  301. }
  302. };
  303. #define shaderDynamicTest_teeth_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0
  304. static const ShaderComboInformation_t s_DynamicComboArray_teeth_vs20[7] =
  305. {
  306. { "COMPRESSED_VERTS", 0, 1 },
  307. { "DOWATERFOG", 0, 1 },
  308. { "SKINNING", 0, 1 },
  309. { "DYNAMIC_LIGHT", 0, 1 },
  310. { "STATIC_LIGHT", 0, 1 },
  311. { "MORPHING", 0, 0 },
  312. { "NUM_LIGHTS", 0, 0 },
  313. };
  314. static const ShaderComboInformation_t s_StaticComboArray_teeth_vs20[3] =
  315. {
  316. { "FLATTEN_STATIC_CONTROL_FLOW", 0, 0 },
  317. { "DOPIXELFOG", 0, 1 },
  318. { "HARDWAREFOGBLEND", 0, 0 },
  319. };
  320. static const ShaderComboSemantics_t teeth_vs20_combos =
  321. {
  322. "teeth_vs20", s_DynamicComboArray_teeth_vs20, 7, s_StaticComboArray_teeth_vs20, 3
  323. };
  324. class ConstructMe_teeth_vs20
  325. {
  326. public:
  327. ConstructMe_teeth_vs20()
  328. {
  329. GetShaderDLL()->AddShaderComboInformation( &teeth_vs20_combos );
  330. }
  331. };
  332. static ConstructMe_teeth_vs20 s_ConstructMe_teeth_vs20;