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 projected_vs20_Static_Index
  7. {
  8. private:
  9. int m_nMODEL;
  10. #ifdef _DEBUG
  11. bool m_bMODEL;
  12. #endif
  13. public:
  14. void SetMODEL( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nMODEL = i;
  18. #ifdef _DEBUG
  19. m_bMODEL = true;
  20. #endif
  21. }
  22. void SetMODEL( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  25. m_nMODEL = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bMODEL = 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 <= 0 );
  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 ) <= 0 );
  69. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  70. #ifdef _DEBUG
  71. m_bHARDWAREFOGBLEND = true;
  72. #endif
  73. }
  74. public:
  75. // CONSTRUCTOR
  76. projected_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  77. {
  78. #ifdef _DEBUG
  79. m_bMODEL = false;
  80. #endif // _DEBUG
  81. m_nMODEL = 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 = 0 ;
  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_bMODEL && m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  97. Assert( bAllStaticVarsDefined );
  98. #endif // _DEBUG
  99. return ( 2 * m_nMODEL ) + ( 4 * m_nDOPIXELFOG ) + ( 8 * m_nHARDWAREFOGBLEND ) + 0;
  100. }
  101. };
  102. #define shaderStaticTest_projected_vs20 vsh_forgot_to_set_static_MODEL + 0
  103. class projected_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. projected_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_projected_vs20 0
  148. static const ShaderComboInformation_t s_DynamicComboArray_projected_vs20[1] =
  149. {
  150. { "DOWATERFOG", 0, 1 },
  151. };
  152. static const ShaderComboInformation_t s_StaticComboArray_projected_vs20[3] =
  153. {
  154. { "MODEL", 0, 1 },
  155. { "DOPIXELFOG", 0, 1 },
  156. { "HARDWAREFOGBLEND", 0, 0 },
  157. };
  158. static const ShaderComboSemantics_t projected_vs20_combos =
  159. {
  160. "projected_vs20", s_DynamicComboArray_projected_vs20, 1, s_StaticComboArray_projected_vs20, 3
  161. };
  162. class ConstructMe_projected_vs20
  163. {
  164. public:
  165. ConstructMe_projected_vs20()
  166. {
  167. GetShaderDLL()->AddShaderComboInformation( &projected_vs20_combos );
  168. }
  169. };
  170. static ConstructMe_projected_vs20 s_ConstructMe_projected_vs20;