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 shatteredglass_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 <= 0 );
  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 ) <= 0 );
  47. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  48. #ifdef _DEBUG
  49. m_bHARDWAREFOGBLEND = true;
  50. #endif
  51. }
  52. private:
  53. int m_nENVMAP_MASK;
  54. #ifdef _DEBUG
  55. bool m_bENVMAP_MASK;
  56. #endif
  57. public:
  58. void SetENVMAP_MASK( int i )
  59. {
  60. Assert( i >= 0 && i <= 1 );
  61. m_nENVMAP_MASK = i;
  62. #ifdef _DEBUG
  63. m_bENVMAP_MASK = true;
  64. #endif
  65. }
  66. void SetENVMAP_MASK( bool i )
  67. {
  68. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  69. m_nENVMAP_MASK = i ? 1 : 0;
  70. #ifdef _DEBUG
  71. m_bENVMAP_MASK = true;
  72. #endif
  73. }
  74. public:
  75. // CONSTRUCTOR
  76. shatteredglass_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  77. {
  78. #ifdef _DEBUG
  79. m_bDOPIXELFOG = true;
  80. #endif // _DEBUG
  81. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  82. #ifdef _DEBUG
  83. m_bHARDWAREFOGBLEND = true;
  84. #endif // _DEBUG
  85. m_nHARDWAREFOGBLEND = 0 ;
  86. #ifdef _DEBUG
  87. m_bENVMAP_MASK = false;
  88. #endif // _DEBUG
  89. m_nENVMAP_MASK = 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_bDOPIXELFOG && m_bHARDWAREFOGBLEND && m_bENVMAP_MASK;
  97. Assert( bAllStaticVarsDefined );
  98. #endif // _DEBUG
  99. return ( 2 * m_nDOPIXELFOG ) + ( 4 * m_nHARDWAREFOGBLEND ) + ( 4 * m_nENVMAP_MASK ) + 0;
  100. }
  101. };
  102. #define shaderStaticTest_shatteredglass_vs20 vsh_forgot_to_set_static_ENVMAP_MASK + 0
  103. class shatteredglass_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. shatteredglass_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_shatteredglass_vs20 0
  148. static const ShaderComboInformation_t s_DynamicComboArray_ShatteredGlass_vs20[1] =
  149. {
  150. { "DOWATERFOG", 0, 1 },
  151. };
  152. static const ShaderComboInformation_t s_StaticComboArray_ShatteredGlass_vs20[3] =
  153. {
  154. { "DOPIXELFOG", 0, 1 },
  155. { "HARDWAREFOGBLEND", 0, 0 },
  156. { "ENVMAP_MASK", 0, 1 },
  157. };
  158. static const ShaderComboSemantics_t ShatteredGlass_vs20_combos =
  159. {
  160. "ShatteredGlass_vs20", s_DynamicComboArray_ShatteredGlass_vs20, 1, s_StaticComboArray_ShatteredGlass_vs20, 3
  161. };
  162. class ConstructMe_ShatteredGlass_vs20
  163. {
  164. public:
  165. ConstructMe_ShatteredGlass_vs20()
  166. {
  167. GetShaderDLL()->AddShaderComboInformation( &ShatteredGlass_vs20_combos );
  168. }
  169. };
  170. static ConstructMe_ShatteredGlass_vs20 s_ConstructMe_ShatteredGlass_vs20;