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.

256 lines
5.6 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $DOWATERFOG == 0 ) && ( $DOPIXELFOG && $HARDWAREFOGBLEND )
  3. // ( $DOWATERFOG == 0 ) && ( $HARDWAREFOGBLEND == 0 ) && ( $DOPIXELFOG == 0 )
  4. // $DOWATERFOG
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  6. #include "shaderlib/cshader.h"
  7. class vortwarp_vs30_Static_Index
  8. {
  9. private:
  10. int m_nHALFLAMBERT;
  11. #ifdef _DEBUG
  12. bool m_bHALFLAMBERT;
  13. #endif
  14. public:
  15. void SetHALFLAMBERT( int i )
  16. {
  17. Assert( i >= 0 && i <= 1 );
  18. m_nHALFLAMBERT = i;
  19. #ifdef _DEBUG
  20. m_bHALFLAMBERT = true;
  21. #endif
  22. }
  23. void SetHALFLAMBERT( bool i )
  24. {
  25. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  26. m_nHALFLAMBERT = i ? 1 : 0;
  27. #ifdef _DEBUG
  28. m_bHALFLAMBERT = true;
  29. #endif
  30. }
  31. private:
  32. int m_nDOPIXELFOG;
  33. #ifdef _DEBUG
  34. bool m_bDOPIXELFOG;
  35. #endif
  36. public:
  37. void SetDOPIXELFOG( int i )
  38. {
  39. Assert( i >= 0 && i <= 1 );
  40. m_nDOPIXELFOG = i;
  41. #ifdef _DEBUG
  42. m_bDOPIXELFOG = true;
  43. #endif
  44. }
  45. void SetDOPIXELFOG( bool i )
  46. {
  47. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  48. m_nDOPIXELFOG = i ? 1 : 0;
  49. #ifdef _DEBUG
  50. m_bDOPIXELFOG = true;
  51. #endif
  52. }
  53. private:
  54. int m_nHARDWAREFOGBLEND;
  55. #ifdef _DEBUG
  56. bool m_bHARDWAREFOGBLEND;
  57. #endif
  58. public:
  59. void SetHARDWAREFOGBLEND( int i )
  60. {
  61. Assert( i >= 0 && i <= 0 );
  62. m_nHARDWAREFOGBLEND = i;
  63. #ifdef _DEBUG
  64. m_bHARDWAREFOGBLEND = true;
  65. #endif
  66. }
  67. void SetHARDWAREFOGBLEND( bool i )
  68. {
  69. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  70. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  71. #ifdef _DEBUG
  72. m_bHARDWAREFOGBLEND = true;
  73. #endif
  74. }
  75. public:
  76. // CONSTRUCTOR
  77. vortwarp_vs30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  78. {
  79. #ifdef _DEBUG
  80. m_bHALFLAMBERT = false;
  81. #endif // _DEBUG
  82. m_nHALFLAMBERT = 0;
  83. #ifdef _DEBUG
  84. m_bDOPIXELFOG = true;
  85. #endif // _DEBUG
  86. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  87. #ifdef _DEBUG
  88. m_bHARDWAREFOGBLEND = true;
  89. #endif // _DEBUG
  90. m_nHARDWAREFOGBLEND = 0 ;
  91. }
  92. int GetIndex()
  93. {
  94. // Asserts to make sure that we aren't using any skipped combinations.
  95. // Asserts to make sure that we are setting all of the combination vars.
  96. #ifdef _DEBUG
  97. bool bAllStaticVarsDefined = m_bHALFLAMBERT && m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  98. Assert( bAllStaticVarsDefined );
  99. #endif // _DEBUG
  100. return ( 8 * m_nHALFLAMBERT ) + ( 16 * m_nDOPIXELFOG ) + ( 32 * m_nHARDWAREFOGBLEND ) + 0;
  101. }
  102. };
  103. #define shaderStaticTest_vortwarp_vs30 vsh_forgot_to_set_static_HALFLAMBERT + 0
  104. class vortwarp_vs30_Dynamic_Index
  105. {
  106. private:
  107. int m_nCOMPRESSED_VERTS;
  108. #ifdef _DEBUG
  109. bool m_bCOMPRESSED_VERTS;
  110. #endif
  111. public:
  112. void SetCOMPRESSED_VERTS( int i )
  113. {
  114. Assert( i >= 0 && i <= 1 );
  115. m_nCOMPRESSED_VERTS = i;
  116. #ifdef _DEBUG
  117. m_bCOMPRESSED_VERTS = true;
  118. #endif
  119. }
  120. void SetCOMPRESSED_VERTS( bool i )
  121. {
  122. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  123. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  124. #ifdef _DEBUG
  125. m_bCOMPRESSED_VERTS = true;
  126. #endif
  127. }
  128. private:
  129. int m_nDOWATERFOG;
  130. #ifdef _DEBUG
  131. bool m_bDOWATERFOG;
  132. #endif
  133. public:
  134. void SetDOWATERFOG( int i )
  135. {
  136. Assert( i >= 0 && i <= 1 );
  137. m_nDOWATERFOG = i;
  138. #ifdef _DEBUG
  139. m_bDOWATERFOG = true;
  140. #endif
  141. }
  142. void SetDOWATERFOG( bool i )
  143. {
  144. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  145. m_nDOWATERFOG = i ? 1 : 0;
  146. #ifdef _DEBUG
  147. m_bDOWATERFOG = true;
  148. #endif
  149. }
  150. private:
  151. int m_nSKINNING;
  152. #ifdef _DEBUG
  153. bool m_bSKINNING;
  154. #endif
  155. public:
  156. void SetSKINNING( int i )
  157. {
  158. Assert( i >= 0 && i <= 1 );
  159. m_nSKINNING = i;
  160. #ifdef _DEBUG
  161. m_bSKINNING = true;
  162. #endif
  163. }
  164. void SetSKINNING( bool i )
  165. {
  166. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  167. m_nSKINNING = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bSKINNING = true;
  170. #endif
  171. }
  172. private:
  173. int m_nMORPHING;
  174. #ifdef _DEBUG
  175. bool m_bMORPHING;
  176. #endif
  177. public:
  178. void SetMORPHING( int i )
  179. {
  180. Assert( i >= 0 && i <= 0 );
  181. m_nMORPHING = i;
  182. #ifdef _DEBUG
  183. m_bMORPHING = true;
  184. #endif
  185. }
  186. void SetMORPHING( bool i )
  187. {
  188. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  189. m_nMORPHING = i ? 1 : 0;
  190. #ifdef _DEBUG
  191. m_bMORPHING = true;
  192. #endif
  193. }
  194. public:
  195. // CONSTRUCTOR
  196. vortwarp_vs30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  197. {
  198. #ifdef _DEBUG
  199. m_bCOMPRESSED_VERTS = false;
  200. #endif // _DEBUG
  201. m_nCOMPRESSED_VERTS = 0;
  202. #ifdef _DEBUG
  203. m_bDOWATERFOG = true;
  204. #endif // _DEBUG
  205. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  206. #ifdef _DEBUG
  207. m_bSKINNING = false;
  208. #endif // _DEBUG
  209. m_nSKINNING = 0;
  210. #ifdef _DEBUG
  211. m_bMORPHING = true;
  212. #endif // _DEBUG
  213. m_nMORPHING = false ;
  214. }
  215. int GetIndex()
  216. {
  217. // Asserts to make sure that we aren't using any skipped combinations.
  218. // Asserts to make sure that we are setting all of the combination vars.
  219. #ifdef _DEBUG
  220. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bMORPHING;
  221. Assert( bAllDynamicVarsDefined );
  222. #endif // _DEBUG
  223. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nMORPHING ) + 0;
  224. }
  225. };
  226. #define shaderDynamicTest_vortwarp_vs30 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + 0
  227. static const ShaderComboInformation_t s_DynamicComboArray_vortwarp_vs30[4] =
  228. {
  229. { "COMPRESSED_VERTS", 0, 1 },
  230. { "DOWATERFOG", 0, 1 },
  231. { "SKINNING", 0, 1 },
  232. { "MORPHING", 0, 0 },
  233. };
  234. static const ShaderComboInformation_t s_StaticComboArray_vortwarp_vs30[3] =
  235. {
  236. { "HALFLAMBERT", 0, 1 },
  237. { "DOPIXELFOG", 0, 1 },
  238. { "HARDWAREFOGBLEND", 0, 0 },
  239. };
  240. static const ShaderComboSemantics_t vortwarp_vs30_combos =
  241. {
  242. "vortwarp_vs30", s_DynamicComboArray_vortwarp_vs30, 4, s_StaticComboArray_vortwarp_vs30, 3
  243. };
  244. class ConstructMe_vortwarp_vs30
  245. {
  246. public:
  247. ConstructMe_vortwarp_vs30()
  248. {
  249. GetShaderDLL()->AddShaderComboInformation( &vortwarp_vs30_combos );
  250. }
  251. };
  252. static ConstructMe_vortwarp_vs30 s_ConstructMe_vortwarp_vs30;