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.

168 lines
3.6 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 flesh_vs30_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. m_nDOPIXELFOG = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bDOPIXELFOG = true;
  27. #endif
  28. }
  29. private:
  30. int m_nHARDWAREFOGBLEND;
  31. #ifdef _DEBUG
  32. bool m_bHARDWAREFOGBLEND;
  33. #endif
  34. public:
  35. void SetHARDWAREFOGBLEND( int i )
  36. {
  37. Assert( i >= 0 && i <= 0 );
  38. m_nHARDWAREFOGBLEND = i;
  39. #ifdef _DEBUG
  40. m_bHARDWAREFOGBLEND = true;
  41. #endif
  42. }
  43. void SetHARDWAREFOGBLEND( bool i )
  44. {
  45. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  46. #ifdef _DEBUG
  47. m_bHARDWAREFOGBLEND = true;
  48. #endif
  49. }
  50. public:
  51. // CONSTRUCTOR
  52. flesh_vs30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  53. {
  54. #ifdef _DEBUG
  55. m_bDOPIXELFOG = true;
  56. #endif // _DEBUG
  57. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  58. #ifdef _DEBUG
  59. m_bHARDWAREFOGBLEND = true;
  60. #endif // _DEBUG
  61. m_nHARDWAREFOGBLEND = 0 ;
  62. }
  63. int GetIndex()
  64. {
  65. // Asserts to make sure that we aren't using any skipped combinations.
  66. // Asserts to make sure that we are setting all of the combination vars.
  67. #ifdef _DEBUG
  68. bool bAllStaticVarsDefined = m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  69. Assert( bAllStaticVarsDefined );
  70. #endif // _DEBUG
  71. return ( 8 * m_nDOPIXELFOG ) + ( 16 * m_nHARDWAREFOGBLEND ) + 0;
  72. }
  73. };
  74. #define shaderStaticTest_flesh_vs30 0
  75. class flesh_vs30_Dynamic_Index
  76. {
  77. private:
  78. int m_nDOWATERFOG;
  79. #ifdef _DEBUG
  80. bool m_bDOWATERFOG;
  81. #endif
  82. public:
  83. void SetDOWATERFOG( int i )
  84. {
  85. Assert( i >= 0 && i <= 1 );
  86. m_nDOWATERFOG = i;
  87. #ifdef _DEBUG
  88. m_bDOWATERFOG = true;
  89. #endif
  90. }
  91. void SetDOWATERFOG( bool i )
  92. {
  93. m_nDOWATERFOG = i ? 1 : 0;
  94. #ifdef _DEBUG
  95. m_bDOWATERFOG = true;
  96. #endif
  97. }
  98. private:
  99. int m_nCOMPRESSED_VERTS;
  100. #ifdef _DEBUG
  101. bool m_bCOMPRESSED_VERTS;
  102. #endif
  103. public:
  104. void SetCOMPRESSED_VERTS( int i )
  105. {
  106. Assert( i >= 0 && i <= 1 );
  107. m_nCOMPRESSED_VERTS = i;
  108. #ifdef _DEBUG
  109. m_bCOMPRESSED_VERTS = true;
  110. #endif
  111. }
  112. void SetCOMPRESSED_VERTS( bool i )
  113. {
  114. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  115. #ifdef _DEBUG
  116. m_bCOMPRESSED_VERTS = true;
  117. #endif
  118. }
  119. private:
  120. int m_nSKINNING;
  121. #ifdef _DEBUG
  122. bool m_bSKINNING;
  123. #endif
  124. public:
  125. void SetSKINNING( int i )
  126. {
  127. Assert( i >= 0 && i <= 1 );
  128. m_nSKINNING = i;
  129. #ifdef _DEBUG
  130. m_bSKINNING = true;
  131. #endif
  132. }
  133. void SetSKINNING( bool i )
  134. {
  135. m_nSKINNING = i ? 1 : 0;
  136. #ifdef _DEBUG
  137. m_bSKINNING = true;
  138. #endif
  139. }
  140. public:
  141. // CONSTRUCTOR
  142. flesh_vs30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  143. {
  144. #ifdef _DEBUG
  145. m_bDOWATERFOG = true;
  146. #endif // _DEBUG
  147. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  148. #ifdef _DEBUG
  149. m_bCOMPRESSED_VERTS = false;
  150. #endif // _DEBUG
  151. m_nCOMPRESSED_VERTS = 0;
  152. #ifdef _DEBUG
  153. m_bSKINNING = false;
  154. #endif // _DEBUG
  155. m_nSKINNING = 0;
  156. }
  157. int GetIndex()
  158. {
  159. // Asserts to make sure that we aren't using any skipped combinations.
  160. // Asserts to make sure that we are setting all of the combination vars.
  161. #ifdef _DEBUG
  162. bool bAllDynamicVarsDefined = m_bDOWATERFOG && m_bCOMPRESSED_VERTS && m_bSKINNING;
  163. Assert( bAllDynamicVarsDefined );
  164. #endif // _DEBUG
  165. return ( 1 * m_nDOWATERFOG ) + ( 2 * m_nCOMPRESSED_VERTS ) + ( 4 * m_nSKINNING ) + 0;
  166. }
  167. };
  168. #define shaderDynamicTest_flesh_vs30 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + 0