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.

174 lines
3.9 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 cs_grass_vs20_Static_Index
  7. {
  8. private:
  9. int m_nDOPIXELFOG;
  10. #ifdef _DEBUG
  11. bool m_bDOPIXELFOG;
  12. #endif
  13. public:
  14. void SetDOPIXELFOG( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nDOPIXELFOG = i;
  18. #ifdef _DEBUG
  19. m_bDOPIXELFOG = true;
  20. #endif
  21. }
  22. void SetDOPIXELFOG( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  25. m_nDOPIXELFOG = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bDOPIXELFOG = true;
  28. #endif
  29. }
  30. private:
  31. int m_nHARDWAREFOGBLEND;
  32. #ifdef _DEBUG
  33. bool m_bHARDWAREFOGBLEND;
  34. #endif
  35. public:
  36. void SetHARDWAREFOGBLEND( int i )
  37. {
  38. Assert( i >= 0 && i <= 1 );
  39. m_nHARDWAREFOGBLEND = i;
  40. #ifdef _DEBUG
  41. m_bHARDWAREFOGBLEND = true;
  42. #endif
  43. }
  44. void SetHARDWAREFOGBLEND( bool i )
  45. {
  46. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  47. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  48. #ifdef _DEBUG
  49. m_bHARDWAREFOGBLEND = true;
  50. #endif
  51. }
  52. public:
  53. // CONSTRUCTOR
  54. cs_grass_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  55. {
  56. #ifdef _DEBUG
  57. m_bDOPIXELFOG = true;
  58. #endif // _DEBUG
  59. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  60. #ifdef _DEBUG
  61. m_bHARDWAREFOGBLEND = true;
  62. #endif // _DEBUG
  63. m_nHARDWAREFOGBLEND = !g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  64. }
  65. int GetIndex()
  66. {
  67. // Asserts to make sure that we aren't using any skipped combinations.
  68. // Asserts to make sure that we are setting all of the combination vars.
  69. #ifdef _DEBUG
  70. bool bAllStaticVarsDefined = m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  71. Assert( bAllStaticVarsDefined );
  72. #endif // _DEBUG
  73. return ( 4 * m_nDOPIXELFOG ) + ( 8 * m_nHARDWAREFOGBLEND ) + 0;
  74. }
  75. };
  76. #define shaderStaticTest_cs_grass_vs20 0
  77. class cs_grass_vs20_Dynamic_Index
  78. {
  79. private:
  80. int m_nDZONE;
  81. #ifdef _DEBUG
  82. bool m_bDZONE;
  83. #endif
  84. public:
  85. void SetDZONE( int i )
  86. {
  87. Assert( i >= 0 && i <= 1 );
  88. m_nDZONE = i;
  89. #ifdef _DEBUG
  90. m_bDZONE = true;
  91. #endif
  92. }
  93. void SetDZONE( bool i )
  94. {
  95. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  96. m_nDZONE = i ? 1 : 0;
  97. #ifdef _DEBUG
  98. m_bDZONE = true;
  99. #endif
  100. }
  101. private:
  102. int m_nDOWATERFOG;
  103. #ifdef _DEBUG
  104. bool m_bDOWATERFOG;
  105. #endif
  106. public:
  107. void SetDOWATERFOG( int i )
  108. {
  109. Assert( i >= 0 && i <= 1 );
  110. m_nDOWATERFOG = i;
  111. #ifdef _DEBUG
  112. m_bDOWATERFOG = true;
  113. #endif
  114. }
  115. void SetDOWATERFOG( bool i )
  116. {
  117. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  118. m_nDOWATERFOG = i ? 1 : 0;
  119. #ifdef _DEBUG
  120. m_bDOWATERFOG = true;
  121. #endif
  122. }
  123. public:
  124. // CONSTRUCTOR
  125. cs_grass_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  126. {
  127. #ifdef _DEBUG
  128. m_bDZONE = false;
  129. #endif // _DEBUG
  130. m_nDZONE = 0;
  131. #ifdef _DEBUG
  132. m_bDOWATERFOG = true;
  133. #endif // _DEBUG
  134. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  135. }
  136. int GetIndex()
  137. {
  138. // Asserts to make sure that we aren't using any skipped combinations.
  139. // Asserts to make sure that we are setting all of the combination vars.
  140. #ifdef _DEBUG
  141. bool bAllDynamicVarsDefined = m_bDZONE && m_bDOWATERFOG;
  142. Assert( bAllDynamicVarsDefined );
  143. #endif // _DEBUG
  144. return ( 1 * m_nDZONE ) + ( 2 * m_nDOWATERFOG ) + 0;
  145. }
  146. };
  147. #define shaderDynamicTest_cs_grass_vs20 vsh_forgot_to_set_dynamic_DZONE + 0
  148. static const ShaderComboInformation_t s_DynamicComboArray_cs_grass_vs20[2] =
  149. {
  150. { "DZONE", 0, 1 },
  151. { "DOWATERFOG", 0, 1 },
  152. };
  153. static const ShaderComboInformation_t s_StaticComboArray_cs_grass_vs20[2] =
  154. {
  155. { "DOPIXELFOG", 0, 1 },
  156. { "HARDWAREFOGBLEND", 0, 1 },
  157. };
  158. static const ShaderComboSemantics_t cs_grass_vs20_combos =
  159. {
  160. "cs_grass_vs20", s_DynamicComboArray_cs_grass_vs20, 2, s_StaticComboArray_cs_grass_vs20, 2
  161. };
  162. class ConstructMe_cs_grass_vs20
  163. {
  164. public:
  165. ConstructMe_cs_grass_vs20()
  166. {
  167. GetShaderDLL()->AddShaderComboInformation( &cs_grass_vs20_combos );
  168. }
  169. };
  170. static ConstructMe_cs_grass_vs20 s_ConstructMe_cs_grass_vs20;