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.

309 lines
6.9 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. public:
  53. // CONSTRUCTOR
  54. teeth_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  55. {
  56. #ifdef _DEBUG
  57. m_bFLATTEN_STATIC_CONTROL_FLOW = false;
  58. #endif // _DEBUG
  59. m_nFLATTEN_STATIC_CONTROL_FLOW = 0;
  60. #ifdef _DEBUG
  61. m_bDOPIXELFOG = true;
  62. #endif // _DEBUG
  63. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  64. }
  65. int GetIndex()
  66. {
  67. // Asserts to make sure that we aren't using any skipped combinations.
  68. // Asserts to make sure that we are setting all of the combination vars.
  69. #ifdef _DEBUG
  70. bool bAllStaticVarsDefined = m_bFLATTEN_STATIC_CONTROL_FLOW && m_bDOPIXELFOG;
  71. Assert( bAllStaticVarsDefined );
  72. #endif // _DEBUG
  73. return ( 32 * m_nFLATTEN_STATIC_CONTROL_FLOW ) + ( 32 * m_nDOPIXELFOG ) + 0;
  74. }
  75. };
  76. #define shaderStaticTest_teeth_vs20 vsh_forgot_to_set_static_FLATTEN_STATIC_CONTROL_FLOW + 0
  77. class teeth_vs20_Dynamic_Index
  78. {
  79. private:
  80. int m_nCOMPRESSED_VERTS;
  81. #ifdef _DEBUG
  82. bool m_bCOMPRESSED_VERTS;
  83. #endif
  84. public:
  85. void SetCOMPRESSED_VERTS( int i )
  86. {
  87. Assert( i >= 0 && i <= 1 );
  88. m_nCOMPRESSED_VERTS = i;
  89. #ifdef _DEBUG
  90. m_bCOMPRESSED_VERTS = true;
  91. #endif
  92. }
  93. void SetCOMPRESSED_VERTS( bool i )
  94. {
  95. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  96. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  97. #ifdef _DEBUG
  98. m_bCOMPRESSED_VERTS = true;
  99. #endif
  100. }
  101. private:
  102. int m_nDOWATERFOG;
  103. #ifdef _DEBUG
  104. bool m_bDOWATERFOG;
  105. #endif
  106. public:
  107. void SetDOWATERFOG( int i )
  108. {
  109. Assert( i >= 0 && i <= 1 );
  110. m_nDOWATERFOG = i;
  111. #ifdef _DEBUG
  112. m_bDOWATERFOG = true;
  113. #endif
  114. }
  115. void SetDOWATERFOG( bool i )
  116. {
  117. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  118. m_nDOWATERFOG = i ? 1 : 0;
  119. #ifdef _DEBUG
  120. m_bDOWATERFOG = true;
  121. #endif
  122. }
  123. private:
  124. int m_nSKINNING;
  125. #ifdef _DEBUG
  126. bool m_bSKINNING;
  127. #endif
  128. public:
  129. void SetSKINNING( int i )
  130. {
  131. Assert( i >= 0 && i <= 1 );
  132. m_nSKINNING = i;
  133. #ifdef _DEBUG
  134. m_bSKINNING = true;
  135. #endif
  136. }
  137. void SetSKINNING( bool i )
  138. {
  139. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  140. m_nSKINNING = i ? 1 : 0;
  141. #ifdef _DEBUG
  142. m_bSKINNING = true;
  143. #endif
  144. }
  145. private:
  146. int m_nDYNAMIC_LIGHT;
  147. #ifdef _DEBUG
  148. bool m_bDYNAMIC_LIGHT;
  149. #endif
  150. public:
  151. void SetDYNAMIC_LIGHT( int i )
  152. {
  153. Assert( i >= 0 && i <= 1 );
  154. m_nDYNAMIC_LIGHT = i;
  155. #ifdef _DEBUG
  156. m_bDYNAMIC_LIGHT = true;
  157. #endif
  158. }
  159. void SetDYNAMIC_LIGHT( bool i )
  160. {
  161. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  162. m_nDYNAMIC_LIGHT = i ? 1 : 0;
  163. #ifdef _DEBUG
  164. m_bDYNAMIC_LIGHT = true;
  165. #endif
  166. }
  167. private:
  168. int m_nSTATIC_LIGHT;
  169. #ifdef _DEBUG
  170. bool m_bSTATIC_LIGHT;
  171. #endif
  172. public:
  173. void SetSTATIC_LIGHT( int i )
  174. {
  175. Assert( i >= 0 && i <= 1 );
  176. m_nSTATIC_LIGHT = i;
  177. #ifdef _DEBUG
  178. m_bSTATIC_LIGHT = true;
  179. #endif
  180. }
  181. void SetSTATIC_LIGHT( bool i )
  182. {
  183. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  184. m_nSTATIC_LIGHT = i ? 1 : 0;
  185. #ifdef _DEBUG
  186. m_bSTATIC_LIGHT = true;
  187. #endif
  188. }
  189. private:
  190. int m_nMORPHING;
  191. #ifdef _DEBUG
  192. bool m_bMORPHING;
  193. #endif
  194. public:
  195. void SetMORPHING( int i )
  196. {
  197. Assert( i >= 0 && i <= 0 );
  198. m_nMORPHING = i;
  199. #ifdef _DEBUG
  200. m_bMORPHING = true;
  201. #endif
  202. }
  203. void SetMORPHING( bool i )
  204. {
  205. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  206. m_nMORPHING = i ? 1 : 0;
  207. #ifdef _DEBUG
  208. m_bMORPHING = true;
  209. #endif
  210. }
  211. private:
  212. int m_nNUM_LIGHTS;
  213. #ifdef _DEBUG
  214. bool m_bNUM_LIGHTS;
  215. #endif
  216. public:
  217. void SetNUM_LIGHTS( int i )
  218. {
  219. Assert( i >= 0 && i <= 0 );
  220. m_nNUM_LIGHTS = i;
  221. #ifdef _DEBUG
  222. m_bNUM_LIGHTS = true;
  223. #endif
  224. }
  225. void SetNUM_LIGHTS( bool i )
  226. {
  227. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  228. m_nNUM_LIGHTS = i ? 1 : 0;
  229. #ifdef _DEBUG
  230. m_bNUM_LIGHTS = true;
  231. #endif
  232. }
  233. public:
  234. // CONSTRUCTOR
  235. teeth_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  236. {
  237. #ifdef _DEBUG
  238. m_bCOMPRESSED_VERTS = false;
  239. #endif // _DEBUG
  240. m_nCOMPRESSED_VERTS = 0;
  241. #ifdef _DEBUG
  242. m_bDOWATERFOG = true;
  243. #endif // _DEBUG
  244. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  245. #ifdef _DEBUG
  246. m_bSKINNING = false;
  247. #endif // _DEBUG
  248. m_nSKINNING = 0;
  249. #ifdef _DEBUG
  250. m_bDYNAMIC_LIGHT = false;
  251. #endif // _DEBUG
  252. m_nDYNAMIC_LIGHT = 0;
  253. #ifdef _DEBUG
  254. m_bSTATIC_LIGHT = false;
  255. #endif // _DEBUG
  256. m_nSTATIC_LIGHT = 0;
  257. #ifdef _DEBUG
  258. m_bMORPHING = true;
  259. #endif // _DEBUG
  260. m_nMORPHING = false ;
  261. #ifdef _DEBUG
  262. m_bNUM_LIGHTS = false;
  263. #endif // _DEBUG
  264. m_nNUM_LIGHTS = 0;
  265. }
  266. int GetIndex()
  267. {
  268. // Asserts to make sure that we aren't using any skipped combinations.
  269. // Asserts to make sure that we are setting all of the combination vars.
  270. #ifdef _DEBUG
  271. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bMORPHING && m_bNUM_LIGHTS;
  272. Assert( bAllDynamicVarsDefined );
  273. #endif // _DEBUG
  274. 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;
  275. }
  276. };
  277. #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
  278. static const ShaderComboInformation_t s_DynamicComboArray_teeth_vs20[7] =
  279. {
  280. { "COMPRESSED_VERTS", 0, 1 },
  281. { "DOWATERFOG", 0, 1 },
  282. { "SKINNING", 0, 1 },
  283. { "DYNAMIC_LIGHT", 0, 1 },
  284. { "STATIC_LIGHT", 0, 1 },
  285. { "MORPHING", 0, 0 },
  286. { "NUM_LIGHTS", 0, 0 },
  287. };
  288. static const ShaderComboInformation_t s_StaticComboArray_teeth_vs20[2] =
  289. {
  290. { "FLATTEN_STATIC_CONTROL_FLOW", 0, 0 },
  291. { "DOPIXELFOG", 0, 1 },
  292. };
  293. static const ShaderComboSemantics_t teeth_vs20_combos =
  294. {
  295. "teeth_vs20", s_DynamicComboArray_teeth_vs20, 7, s_StaticComboArray_teeth_vs20, 2
  296. };
  297. class ConstructMe_teeth_vs20
  298. {
  299. public:
  300. ConstructMe_teeth_vs20()
  301. {
  302. GetShaderDLL()->AddShaderComboInformation( &teeth_vs20_combos );
  303. }
  304. };
  305. static ConstructMe_teeth_vs20 s_ConstructMe_teeth_vs20;