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.

282 lines
6.4 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. public:
  53. // CONSTRUCTOR
  54. teeth_bump_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 ( 16 * m_nFLATTEN_STATIC_CONTROL_FLOW ) + ( 16 * m_nDOPIXELFOG ) + 0;
  74. }
  75. };
  76. #define shaderStaticTest_teeth_bump_vs20 vsh_forgot_to_set_static_FLATTEN_STATIC_CONTROL_FLOW + 0
  77. class teeth_bump_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_nSTATIC_LIGHT;
  147. #ifdef _DEBUG
  148. bool m_bSTATIC_LIGHT;
  149. #endif
  150. public:
  151. void SetSTATIC_LIGHT( int i )
  152. {
  153. Assert( i >= 0 && i <= 1 );
  154. m_nSTATIC_LIGHT = i;
  155. #ifdef _DEBUG
  156. m_bSTATIC_LIGHT = true;
  157. #endif
  158. }
  159. void SetSTATIC_LIGHT( bool i )
  160. {
  161. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  162. m_nSTATIC_LIGHT = i ? 1 : 0;
  163. #ifdef _DEBUG
  164. m_bSTATIC_LIGHT = true;
  165. #endif
  166. }
  167. private:
  168. int m_nMORPHING;
  169. #ifdef _DEBUG
  170. bool m_bMORPHING;
  171. #endif
  172. public:
  173. void SetMORPHING( int i )
  174. {
  175. Assert( i >= 0 && i <= 0 );
  176. m_nMORPHING = i;
  177. #ifdef _DEBUG
  178. m_bMORPHING = true;
  179. #endif
  180. }
  181. void SetMORPHING( bool i )
  182. {
  183. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  184. m_nMORPHING = i ? 1 : 0;
  185. #ifdef _DEBUG
  186. m_bMORPHING = true;
  187. #endif
  188. }
  189. private:
  190. int m_nNUM_LIGHTS;
  191. #ifdef _DEBUG
  192. bool m_bNUM_LIGHTS;
  193. #endif
  194. public:
  195. void SetNUM_LIGHTS( int i )
  196. {
  197. Assert( i >= 0 && i <= 0 );
  198. m_nNUM_LIGHTS = i;
  199. #ifdef _DEBUG
  200. m_bNUM_LIGHTS = true;
  201. #endif
  202. }
  203. void SetNUM_LIGHTS( bool i )
  204. {
  205. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  206. m_nNUM_LIGHTS = i ? 1 : 0;
  207. #ifdef _DEBUG
  208. m_bNUM_LIGHTS = true;
  209. #endif
  210. }
  211. public:
  212. // CONSTRUCTOR
  213. teeth_bump_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  214. {
  215. #ifdef _DEBUG
  216. m_bCOMPRESSED_VERTS = false;
  217. #endif // _DEBUG
  218. m_nCOMPRESSED_VERTS = 0;
  219. #ifdef _DEBUG
  220. m_bDOWATERFOG = true;
  221. #endif // _DEBUG
  222. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  223. #ifdef _DEBUG
  224. m_bSKINNING = false;
  225. #endif // _DEBUG
  226. m_nSKINNING = 0;
  227. #ifdef _DEBUG
  228. m_bSTATIC_LIGHT = false;
  229. #endif // _DEBUG
  230. m_nSTATIC_LIGHT = 0;
  231. #ifdef _DEBUG
  232. m_bMORPHING = true;
  233. #endif // _DEBUG
  234. m_nMORPHING = false ;
  235. #ifdef _DEBUG
  236. m_bNUM_LIGHTS = false;
  237. #endif // _DEBUG
  238. m_nNUM_LIGHTS = 0;
  239. }
  240. int GetIndex()
  241. {
  242. // Asserts to make sure that we aren't using any skipped combinations.
  243. // Asserts to make sure that we are setting all of the combination vars.
  244. #ifdef _DEBUG
  245. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bSTATIC_LIGHT && m_bMORPHING && m_bNUM_LIGHTS;
  246. Assert( bAllDynamicVarsDefined );
  247. #endif // _DEBUG
  248. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nSTATIC_LIGHT ) + ( 16 * m_nMORPHING ) + ( 16 * m_nNUM_LIGHTS ) + 0;
  249. }
  250. };
  251. #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
  252. static const ShaderComboInformation_t s_DynamicComboArray_teeth_bump_vs20[6] =
  253. {
  254. { "COMPRESSED_VERTS", 0, 1 },
  255. { "DOWATERFOG", 0, 1 },
  256. { "SKINNING", 0, 1 },
  257. { "STATIC_LIGHT", 0, 1 },
  258. { "MORPHING", 0, 0 },
  259. { "NUM_LIGHTS", 0, 0 },
  260. };
  261. static const ShaderComboInformation_t s_StaticComboArray_teeth_bump_vs20[2] =
  262. {
  263. { "FLATTEN_STATIC_CONTROL_FLOW", 0, 0 },
  264. { "DOPIXELFOG", 0, 1 },
  265. };
  266. static const ShaderComboSemantics_t teeth_bump_vs20_combos =
  267. {
  268. "teeth_bump_vs20", s_DynamicComboArray_teeth_bump_vs20, 6, s_StaticComboArray_teeth_bump_vs20, 2
  269. };
  270. class ConstructMe_teeth_bump_vs20
  271. {
  272. public:
  273. ConstructMe_teeth_bump_vs20()
  274. {
  275. GetShaderDLL()->AddShaderComboInformation( &teeth_bump_vs20_combos );
  276. }
  277. };
  278. static ConstructMe_teeth_bump_vs20 s_ConstructMe_teeth_bump_vs20;