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
7.0 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_bump_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_bump_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 ( 16 * m_nFLATTEN_STATIC_CONTROL_FLOW ) + ( 16 * m_nDOPIXELFOG ) + ( 32 * m_nHARDWAREFOGBLEND ) + 0;
  100. }
  101. };
  102. #define shaderStaticTest_teeth_bump_vs20 vsh_forgot_to_set_static_FLATTEN_STATIC_CONTROL_FLOW + 0
  103. class teeth_bump_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_nSTATIC_LIGHT;
  173. #ifdef _DEBUG
  174. bool m_bSTATIC_LIGHT;
  175. #endif
  176. public:
  177. void SetSTATIC_LIGHT( int i )
  178. {
  179. Assert( i >= 0 && i <= 1 );
  180. m_nSTATIC_LIGHT = i;
  181. #ifdef _DEBUG
  182. m_bSTATIC_LIGHT = true;
  183. #endif
  184. }
  185. void SetSTATIC_LIGHT( bool i )
  186. {
  187. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  188. m_nSTATIC_LIGHT = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bSTATIC_LIGHT = true;
  191. #endif
  192. }
  193. private:
  194. int m_nMORPHING;
  195. #ifdef _DEBUG
  196. bool m_bMORPHING;
  197. #endif
  198. public:
  199. void SetMORPHING( int i )
  200. {
  201. Assert( i >= 0 && i <= 0 );
  202. m_nMORPHING = i;
  203. #ifdef _DEBUG
  204. m_bMORPHING = true;
  205. #endif
  206. }
  207. void SetMORPHING( bool i )
  208. {
  209. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  210. m_nMORPHING = i ? 1 : 0;
  211. #ifdef _DEBUG
  212. m_bMORPHING = true;
  213. #endif
  214. }
  215. private:
  216. int m_nNUM_LIGHTS;
  217. #ifdef _DEBUG
  218. bool m_bNUM_LIGHTS;
  219. #endif
  220. public:
  221. void SetNUM_LIGHTS( int i )
  222. {
  223. Assert( i >= 0 && i <= 0 );
  224. m_nNUM_LIGHTS = i;
  225. #ifdef _DEBUG
  226. m_bNUM_LIGHTS = true;
  227. #endif
  228. }
  229. void SetNUM_LIGHTS( bool i )
  230. {
  231. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  232. m_nNUM_LIGHTS = i ? 1 : 0;
  233. #ifdef _DEBUG
  234. m_bNUM_LIGHTS = true;
  235. #endif
  236. }
  237. public:
  238. // CONSTRUCTOR
  239. teeth_bump_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  240. {
  241. #ifdef _DEBUG
  242. m_bCOMPRESSED_VERTS = false;
  243. #endif // _DEBUG
  244. m_nCOMPRESSED_VERTS = 0;
  245. #ifdef _DEBUG
  246. m_bDOWATERFOG = true;
  247. #endif // _DEBUG
  248. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  249. #ifdef _DEBUG
  250. m_bSKINNING = false;
  251. #endif // _DEBUG
  252. m_nSKINNING = 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_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_nSTATIC_LIGHT ) + ( 16 * m_nMORPHING ) + ( 16 * m_nNUM_LIGHTS ) + 0;
  275. }
  276. };
  277. #define shaderDynamicTest_teeth_bump_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0
  278. static const ShaderComboInformation_t s_DynamicComboArray_teeth_bump_vs20[6] =
  279. {
  280. { "COMPRESSED_VERTS", 0, 1 },
  281. { "DOWATERFOG", 0, 1 },
  282. { "SKINNING", 0, 1 },
  283. { "STATIC_LIGHT", 0, 1 },
  284. { "MORPHING", 0, 0 },
  285. { "NUM_LIGHTS", 0, 0 },
  286. };
  287. static const ShaderComboInformation_t s_StaticComboArray_teeth_bump_vs20[3] =
  288. {
  289. { "FLATTEN_STATIC_CONTROL_FLOW", 0, 0 },
  290. { "DOPIXELFOG", 0, 1 },
  291. { "HARDWAREFOGBLEND", 0, 0 },
  292. };
  293. static const ShaderComboSemantics_t teeth_bump_vs20_combos =
  294. {
  295. "teeth_bump_vs20", s_DynamicComboArray_teeth_bump_vs20, 6, s_StaticComboArray_teeth_bump_vs20, 3
  296. };
  297. class ConstructMe_teeth_bump_vs20
  298. {
  299. public:
  300. ConstructMe_teeth_bump_vs20()
  301. {
  302. GetShaderDLL()->AddShaderComboInformation( &teeth_bump_vs20_combos );
  303. }
  304. };
  305. static ConstructMe_teeth_bump_vs20 s_ConstructMe_teeth_bump_vs20;