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.

200 lines
4.8 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 vertexlitgeneric_flashlight_vs20_Static_Index
  6. {
  7. private:
  8. int m_nTEETH;
  9. #ifdef _DEBUG
  10. bool m_bTEETH;
  11. #endif
  12. public:
  13. void SetTEETH( int i )
  14. {
  15. Assert( i >= 0 && i <= 1 );
  16. m_nTEETH = i;
  17. #ifdef _DEBUG
  18. m_bTEETH = true;
  19. #endif
  20. }
  21. void SetTEETH( bool i )
  22. {
  23. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  24. m_nTEETH = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bTEETH = true;
  27. #endif
  28. }
  29. private:
  30. int m_nDOPIXELFOG;
  31. #ifdef _DEBUG
  32. bool m_bDOPIXELFOG;
  33. #endif
  34. public:
  35. void SetDOPIXELFOG( int i )
  36. {
  37. Assert( i >= 0 && i <= 1 );
  38. m_nDOPIXELFOG = i;
  39. #ifdef _DEBUG
  40. m_bDOPIXELFOG = true;
  41. #endif
  42. }
  43. void SetDOPIXELFOG( bool i )
  44. {
  45. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  46. m_nDOPIXELFOG = i ? 1 : 0;
  47. #ifdef _DEBUG
  48. m_bDOPIXELFOG = true;
  49. #endif
  50. }
  51. private:
  52. int m_nHARDWAREFOGBLEND;
  53. #ifdef _DEBUG
  54. bool m_bHARDWAREFOGBLEND;
  55. #endif
  56. public:
  57. void SetHARDWAREFOGBLEND( int i )
  58. {
  59. Assert( i >= 0 && i <= 1 );
  60. m_nHARDWAREFOGBLEND = i;
  61. #ifdef _DEBUG
  62. m_bHARDWAREFOGBLEND = true;
  63. #endif
  64. }
  65. void SetHARDWAREFOGBLEND( bool i )
  66. {
  67. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  68. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  69. #ifdef _DEBUG
  70. m_bHARDWAREFOGBLEND = true;
  71. #endif
  72. }
  73. public:
  74. // CONSTRUCTOR
  75. vertexlitgeneric_flashlight_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  76. {
  77. #ifdef _DEBUG
  78. m_bTEETH = false;
  79. #endif // _DEBUG
  80. m_nTEETH = 0;
  81. #ifdef _DEBUG
  82. m_bDOPIXELFOG = true;
  83. #endif // _DEBUG
  84. m_nDOPIXELFOG = ( g_pHardwareConfig->SupportsPixelShaders_2_b() && !IS_FLAG_SET( MATERIAL_VAR_VERTEXFOG ) ) ? 1 : 0 ;
  85. #ifdef _DEBUG
  86. m_bHARDWAREFOGBLEND = true;
  87. #endif // _DEBUG
  88. m_nHARDWAREFOGBLEND = !g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  89. }
  90. int GetIndex()
  91. {
  92. // Asserts to make sure that we aren't using any skipped combinations.
  93. // Asserts to make sure that we are setting all of the combination vars.
  94. #ifdef _DEBUG
  95. bool bAllStaticVarsDefined = m_bTEETH && m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  96. Assert( bAllStaticVarsDefined );
  97. #endif // _DEBUG
  98. return ( 4 * m_nTEETH ) + ( 8 * m_nDOPIXELFOG ) + ( 16 * m_nHARDWAREFOGBLEND ) + 0;
  99. }
  100. };
  101. #define shaderStaticTest_vertexlitgeneric_flashlight_vs20 vsh_forgot_to_set_static_TEETH + 0
  102. class vertexlitgeneric_flashlight_vs20_Dynamic_Index
  103. {
  104. private:
  105. int m_nSKINNING;
  106. #ifdef _DEBUG
  107. bool m_bSKINNING;
  108. #endif
  109. public:
  110. void SetSKINNING( int i )
  111. {
  112. Assert( i >= 0 && i <= 1 );
  113. m_nSKINNING = i;
  114. #ifdef _DEBUG
  115. m_bSKINNING = true;
  116. #endif
  117. }
  118. void SetSKINNING( bool i )
  119. {
  120. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  121. m_nSKINNING = i ? 1 : 0;
  122. #ifdef _DEBUG
  123. m_bSKINNING = true;
  124. #endif
  125. }
  126. private:
  127. int m_nDOWATERFOG;
  128. #ifdef _DEBUG
  129. bool m_bDOWATERFOG;
  130. #endif
  131. public:
  132. void SetDOWATERFOG( int i )
  133. {
  134. Assert( i >= 0 && i <= 1 );
  135. m_nDOWATERFOG = i;
  136. #ifdef _DEBUG
  137. m_bDOWATERFOG = true;
  138. #endif
  139. }
  140. void SetDOWATERFOG( bool i )
  141. {
  142. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  143. m_nDOWATERFOG = i ? 1 : 0;
  144. #ifdef _DEBUG
  145. m_bDOWATERFOG = true;
  146. #endif
  147. }
  148. public:
  149. // CONSTRUCTOR
  150. vertexlitgeneric_flashlight_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  151. {
  152. #ifdef _DEBUG
  153. m_bSKINNING = false;
  154. #endif // _DEBUG
  155. m_nSKINNING = 0;
  156. #ifdef _DEBUG
  157. m_bDOWATERFOG = true;
  158. #endif // _DEBUG
  159. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  160. }
  161. int GetIndex()
  162. {
  163. // Asserts to make sure that we aren't using any skipped combinations.
  164. // Asserts to make sure that we are setting all of the combination vars.
  165. #ifdef _DEBUG
  166. bool bAllDynamicVarsDefined = m_bSKINNING && m_bDOWATERFOG;
  167. Assert( bAllDynamicVarsDefined );
  168. #endif // _DEBUG
  169. return ( 1 * m_nSKINNING ) + ( 2 * m_nDOWATERFOG ) + 0;
  170. }
  171. };
  172. #define shaderDynamicTest_vertexlitgeneric_flashlight_vs20 vsh_forgot_to_set_dynamic_SKINNING + 0
  173. static const ShaderComboInformation_t s_DynamicComboArray_vertexlitgeneric_flashlight_vs20[2] =
  174. {
  175. { "SKINNING", 0, 1 },
  176. { "DOWATERFOG", 0, 1 },
  177. };
  178. static const ShaderComboInformation_t s_StaticComboArray_vertexlitgeneric_flashlight_vs20[3] =
  179. {
  180. { "TEETH", 0, 1 },
  181. { "DOPIXELFOG", 0, 1 },
  182. { "HARDWAREFOGBLEND", 0, 1 },
  183. };
  184. static const ShaderComboSemantics_t vertexlitgeneric_flashlight_vs20_combos =
  185. {
  186. "vertexlitgeneric_flashlight_vs20", s_DynamicComboArray_vertexlitgeneric_flashlight_vs20, 2, s_StaticComboArray_vertexlitgeneric_flashlight_vs20, 3
  187. };
  188. class ConstructMe_vertexlitgeneric_flashlight_vs20
  189. {
  190. public:
  191. ConstructMe_vertexlitgeneric_flashlight_vs20()
  192. {
  193. GetShaderDLL()->AddShaderComboInformation( &vertexlitgeneric_flashlight_vs20_combos );
  194. }
  195. };
  196. static ConstructMe_vertexlitgeneric_flashlight_vs20 s_ConstructMe_vertexlitgeneric_flashlight_vs20;