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.

254 lines
6.0 KiB

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