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.

293 lines
5.8 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 global_lit_simple_vs30_Static_Index
  7. {
  8. private:
  9. int m_nMODEL;
  10. #ifdef _DEBUG
  11. bool m_bMODEL;
  12. #endif
  13. public:
  14. void SetMODEL( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nMODEL = i;
  18. #ifdef _DEBUG
  19. m_bMODEL = true;
  20. #endif
  21. }
  22. void SetMODEL( bool i )
  23. {
  24. m_nMODEL = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bMODEL = true;
  27. #endif
  28. }
  29. private:
  30. int m_nFLASHLIGHT;
  31. #ifdef _DEBUG
  32. bool m_bFLASHLIGHT;
  33. #endif
  34. public:
  35. void SetFLASHLIGHT( int i )
  36. {
  37. Assert( i >= 0 && i <= 1 );
  38. m_nFLASHLIGHT = i;
  39. #ifdef _DEBUG
  40. m_bFLASHLIGHT = true;
  41. #endif
  42. }
  43. void SetFLASHLIGHT( bool i )
  44. {
  45. m_nFLASHLIGHT = i ? 1 : 0;
  46. #ifdef _DEBUG
  47. m_bFLASHLIGHT = true;
  48. #endif
  49. }
  50. private:
  51. int m_nSPECULAR;
  52. #ifdef _DEBUG
  53. bool m_bSPECULAR;
  54. #endif
  55. public:
  56. void SetSPECULAR( int i )
  57. {
  58. Assert( i >= 0 && i <= 1 );
  59. m_nSPECULAR = i;
  60. #ifdef _DEBUG
  61. m_bSPECULAR = true;
  62. #endif
  63. }
  64. void SetSPECULAR( bool i )
  65. {
  66. m_nSPECULAR = i ? 1 : 0;
  67. #ifdef _DEBUG
  68. m_bSPECULAR = true;
  69. #endif
  70. }
  71. private:
  72. int m_nDOPIXELFOG;
  73. #ifdef _DEBUG
  74. bool m_bDOPIXELFOG;
  75. #endif
  76. public:
  77. void SetDOPIXELFOG( int i )
  78. {
  79. Assert( i >= 0 && i <= 1 );
  80. m_nDOPIXELFOG = i;
  81. #ifdef _DEBUG
  82. m_bDOPIXELFOG = true;
  83. #endif
  84. }
  85. void SetDOPIXELFOG( bool i )
  86. {
  87. m_nDOPIXELFOG = i ? 1 : 0;
  88. #ifdef _DEBUG
  89. m_bDOPIXELFOG = true;
  90. #endif
  91. }
  92. private:
  93. int m_nHARDWAREFOGBLEND;
  94. #ifdef _DEBUG
  95. bool m_bHARDWAREFOGBLEND;
  96. #endif
  97. public:
  98. void SetHARDWAREFOGBLEND( int i )
  99. {
  100. Assert( i >= 0 && i <= 0 );
  101. m_nHARDWAREFOGBLEND = i;
  102. #ifdef _DEBUG
  103. m_bHARDWAREFOGBLEND = true;
  104. #endif
  105. }
  106. void SetHARDWAREFOGBLEND( bool i )
  107. {
  108. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  109. #ifdef _DEBUG
  110. m_bHARDWAREFOGBLEND = true;
  111. #endif
  112. }
  113. public:
  114. // CONSTRUCTOR
  115. global_lit_simple_vs30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  116. {
  117. #ifdef _DEBUG
  118. m_bMODEL = false;
  119. #endif // _DEBUG
  120. m_nMODEL = 0;
  121. #ifdef _DEBUG
  122. m_bFLASHLIGHT = false;
  123. #endif // _DEBUG
  124. m_nFLASHLIGHT = 0;
  125. #ifdef _DEBUG
  126. m_bSPECULAR = false;
  127. #endif // _DEBUG
  128. m_nSPECULAR = 0;
  129. #ifdef _DEBUG
  130. m_bDOPIXELFOG = true;
  131. #endif // _DEBUG
  132. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  133. #ifdef _DEBUG
  134. m_bHARDWAREFOGBLEND = true;
  135. #endif // _DEBUG
  136. m_nHARDWAREFOGBLEND = 0 ;
  137. }
  138. int GetIndex()
  139. {
  140. // Asserts to make sure that we aren't using any skipped combinations.
  141. // Asserts to make sure that we are setting all of the combination vars.
  142. #ifdef _DEBUG
  143. bool bAllStaticVarsDefined = m_bMODEL && m_bFLASHLIGHT && m_bSPECULAR && m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  144. Assert( bAllStaticVarsDefined );
  145. #endif // _DEBUG
  146. return ( 32 * m_nMODEL ) + ( 64 * m_nFLASHLIGHT ) + ( 128 * m_nSPECULAR ) + ( 256 * m_nDOPIXELFOG ) + ( 512 * m_nHARDWAREFOGBLEND ) + 0;
  147. }
  148. };
  149. #define shaderStaticTest_global_lit_simple_vs30 vsh_forgot_to_set_static_MODEL + vsh_forgot_to_set_static_FLASHLIGHT + vsh_forgot_to_set_static_SPECULAR + 0
  150. class global_lit_simple_vs30_Dynamic_Index
  151. {
  152. private:
  153. int m_nCOMPRESSED_VERTS;
  154. #ifdef _DEBUG
  155. bool m_bCOMPRESSED_VERTS;
  156. #endif
  157. public:
  158. void SetCOMPRESSED_VERTS( int i )
  159. {
  160. Assert( i >= 0 && i <= 1 );
  161. m_nCOMPRESSED_VERTS = i;
  162. #ifdef _DEBUG
  163. m_bCOMPRESSED_VERTS = true;
  164. #endif
  165. }
  166. void SetCOMPRESSED_VERTS( bool i )
  167. {
  168. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  169. #ifdef _DEBUG
  170. m_bCOMPRESSED_VERTS = true;
  171. #endif
  172. }
  173. private:
  174. int m_nSKINNING;
  175. #ifdef _DEBUG
  176. bool m_bSKINNING;
  177. #endif
  178. public:
  179. void SetSKINNING( int i )
  180. {
  181. Assert( i >= 0 && i <= 1 );
  182. m_nSKINNING = i;
  183. #ifdef _DEBUG
  184. m_bSKINNING = true;
  185. #endif
  186. }
  187. void SetSKINNING( bool i )
  188. {
  189. m_nSKINNING = i ? 1 : 0;
  190. #ifdef _DEBUG
  191. m_bSKINNING = true;
  192. #endif
  193. }
  194. private:
  195. int m_nFOW;
  196. #ifdef _DEBUG
  197. bool m_bFOW;
  198. #endif
  199. public:
  200. void SetFOW( int i )
  201. {
  202. Assert( i >= 0 && i <= 1 );
  203. m_nFOW = i;
  204. #ifdef _DEBUG
  205. m_bFOW = true;
  206. #endif
  207. }
  208. void SetFOW( bool i )
  209. {
  210. m_nFOW = i ? 1 : 0;
  211. #ifdef _DEBUG
  212. m_bFOW = true;
  213. #endif
  214. }
  215. private:
  216. int m_nDEFERRED;
  217. #ifdef _DEBUG
  218. bool m_bDEFERRED;
  219. #endif
  220. public:
  221. void SetDEFERRED( int i )
  222. {
  223. Assert( i >= 0 && i <= 1 );
  224. m_nDEFERRED = i;
  225. #ifdef _DEBUG
  226. m_bDEFERRED = true;
  227. #endif
  228. }
  229. void SetDEFERRED( bool i )
  230. {
  231. m_nDEFERRED = i ? 1 : 0;
  232. #ifdef _DEBUG
  233. m_bDEFERRED = true;
  234. #endif
  235. }
  236. private:
  237. int m_nDOWATERFOG;
  238. #ifdef _DEBUG
  239. bool m_bDOWATERFOG;
  240. #endif
  241. public:
  242. void SetDOWATERFOG( int i )
  243. {
  244. Assert( i >= 0 && i <= 1 );
  245. m_nDOWATERFOG = i;
  246. #ifdef _DEBUG
  247. m_bDOWATERFOG = true;
  248. #endif
  249. }
  250. void SetDOWATERFOG( bool i )
  251. {
  252. m_nDOWATERFOG = i ? 1 : 0;
  253. #ifdef _DEBUG
  254. m_bDOWATERFOG = true;
  255. #endif
  256. }
  257. public:
  258. // CONSTRUCTOR
  259. global_lit_simple_vs30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  260. {
  261. #ifdef _DEBUG
  262. m_bCOMPRESSED_VERTS = false;
  263. #endif // _DEBUG
  264. m_nCOMPRESSED_VERTS = 0;
  265. #ifdef _DEBUG
  266. m_bSKINNING = false;
  267. #endif // _DEBUG
  268. m_nSKINNING = 0;
  269. #ifdef _DEBUG
  270. m_bFOW = false;
  271. #endif // _DEBUG
  272. m_nFOW = 0;
  273. #ifdef _DEBUG
  274. m_bDEFERRED = false;
  275. #endif // _DEBUG
  276. m_nDEFERRED = 0;
  277. #ifdef _DEBUG
  278. m_bDOWATERFOG = true;
  279. #endif // _DEBUG
  280. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  281. }
  282. int GetIndex()
  283. {
  284. // Asserts to make sure that we aren't using any skipped combinations.
  285. // Asserts to make sure that we are setting all of the combination vars.
  286. #ifdef _DEBUG
  287. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bSKINNING && m_bFOW && m_bDEFERRED && m_bDOWATERFOG;
  288. Assert( bAllDynamicVarsDefined );
  289. #endif // _DEBUG
  290. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nFOW ) + ( 8 * m_nDEFERRED ) + ( 16 * m_nDOWATERFOG ) + 0;
  291. }
  292. };
  293. #define shaderDynamicTest_global_lit_simple_vs30 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_FOW + vsh_forgot_to_set_dynamic_DEFERRED + 0