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