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.

227 lines
5.4 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_vs20_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. public:
  118. // CONSTRUCTOR
  119. lightmappedgeneric_flashlight_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  120. {
  121. #ifdef _DEBUG
  122. m_bNORMALMAP = false;
  123. #endif // _DEBUG
  124. m_nNORMALMAP = 0;
  125. #ifdef _DEBUG
  126. m_bWORLDVERTEXTRANSITION = false;
  127. #endif // _DEBUG
  128. m_nWORLDVERTEXTRANSITION = 0;
  129. #ifdef _DEBUG
  130. m_bSEAMLESS = false;
  131. #endif // _DEBUG
  132. m_nSEAMLESS = 0;
  133. #ifdef _DEBUG
  134. m_bDETAIL = false;
  135. #endif // _DEBUG
  136. m_nDETAIL = 0;
  137. #ifdef _DEBUG
  138. m_bDOPIXELFOG = true;
  139. #endif // _DEBUG
  140. m_nDOPIXELFOG = ( g_pHardwareConfig->SupportsPixelShaders_2_b() && !IS_FLAG_SET( MATERIAL_VAR_VERTEXFOG ) ) ? 1 : 0 ;
  141. }
  142. int GetIndex()
  143. {
  144. // Asserts to make sure that we aren't using any skipped combinations.
  145. // Asserts to make sure that we are setting all of the combination vars.
  146. #ifdef _DEBUG
  147. bool bAllStaticVarsDefined = m_bNORMALMAP && m_bWORLDVERTEXTRANSITION && m_bSEAMLESS && m_bDETAIL && m_bDOPIXELFOG;
  148. Assert( bAllStaticVarsDefined );
  149. #endif // _DEBUG
  150. return ( 2 * m_nNORMALMAP ) + ( 4 * m_nWORLDVERTEXTRANSITION ) + ( 8 * m_nSEAMLESS ) + ( 16 * m_nDETAIL ) + ( 32 * m_nDOPIXELFOG ) + 0;
  151. }
  152. };
  153. #define shaderStaticTest_lightmappedgeneric_flashlight_vs20 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
  154. class lightmappedgeneric_flashlight_vs20_Dynamic_Index
  155. {
  156. private:
  157. int m_nDOWATERFOG;
  158. #ifdef _DEBUG
  159. bool m_bDOWATERFOG;
  160. #endif
  161. public:
  162. void SetDOWATERFOG( int i )
  163. {
  164. Assert( i >= 0 && i <= 1 );
  165. m_nDOWATERFOG = i;
  166. #ifdef _DEBUG
  167. m_bDOWATERFOG = true;
  168. #endif
  169. }
  170. void SetDOWATERFOG( bool i )
  171. {
  172. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  173. m_nDOWATERFOG = i ? 1 : 0;
  174. #ifdef _DEBUG
  175. m_bDOWATERFOG = true;
  176. #endif
  177. }
  178. public:
  179. // CONSTRUCTOR
  180. lightmappedgeneric_flashlight_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  181. {
  182. #ifdef _DEBUG
  183. m_bDOWATERFOG = true;
  184. #endif // _DEBUG
  185. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  186. }
  187. int GetIndex()
  188. {
  189. // Asserts to make sure that we aren't using any skipped combinations.
  190. // Asserts to make sure that we are setting all of the combination vars.
  191. #ifdef _DEBUG
  192. bool bAllDynamicVarsDefined = m_bDOWATERFOG;
  193. Assert( bAllDynamicVarsDefined );
  194. #endif // _DEBUG
  195. return ( 1 * m_nDOWATERFOG ) + 0;
  196. }
  197. };
  198. #define shaderDynamicTest_lightmappedgeneric_flashlight_vs20 0
  199. static const ShaderComboInformation_t s_DynamicComboArray_lightmappedgeneric_flashlight_vs20[1] =
  200. {
  201. { "DOWATERFOG", 0, 1 },
  202. };
  203. static const ShaderComboInformation_t s_StaticComboArray_lightmappedgeneric_flashlight_vs20[5] =
  204. {
  205. { "NORMALMAP", 0, 1 },
  206. { "WORLDVERTEXTRANSITION", 0, 1 },
  207. { "SEAMLESS", 0, 1 },
  208. { "DETAIL", 0, 1 },
  209. { "DOPIXELFOG", 0, 1 },
  210. };
  211. static const ShaderComboSemantics_t lightmappedgeneric_flashlight_vs20_combos =
  212. {
  213. "lightmappedgeneric_flashlight_vs20", s_DynamicComboArray_lightmappedgeneric_flashlight_vs20, 1, s_StaticComboArray_lightmappedgeneric_flashlight_vs20, 5
  214. };
  215. class ConstructMe_lightmappedgeneric_flashlight_vs20
  216. {
  217. public:
  218. ConstructMe_lightmappedgeneric_flashlight_vs20()
  219. {
  220. GetShaderDLL()->AddShaderComboInformation( &lightmappedgeneric_flashlight_vs20_combos );
  221. }
  222. };
  223. static ConstructMe_lightmappedgeneric_flashlight_vs20 s_ConstructMe_lightmappedgeneric_flashlight_vs20;