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.

147 lines
3.4 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 cable_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. public:
  53. // CONSTRUCTOR
  54. cable_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 = 0 ;
  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 ( 2 * m_nDOPIXELFOG ) + ( 4 * m_nHARDWAREFOGBLEND ) + 0;
  74. }
  75. };
  76. #define shaderStaticTest_cable_vs20 0
  77. class cable_vs20_Dynamic_Index
  78. {
  79. private:
  80. int m_nDOWATERFOG;
  81. #ifdef _DEBUG
  82. bool m_bDOWATERFOG;
  83. #endif
  84. public:
  85. void SetDOWATERFOG( int i )
  86. {
  87. Assert( i >= 0 && i <= 1 );
  88. m_nDOWATERFOG = i;
  89. #ifdef _DEBUG
  90. m_bDOWATERFOG = true;
  91. #endif
  92. }
  93. void SetDOWATERFOG( bool i )
  94. {
  95. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  96. m_nDOWATERFOG = i ? 1 : 0;
  97. #ifdef _DEBUG
  98. m_bDOWATERFOG = true;
  99. #endif
  100. }
  101. public:
  102. // CONSTRUCTOR
  103. cable_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  104. {
  105. #ifdef _DEBUG
  106. m_bDOWATERFOG = true;
  107. #endif // _DEBUG
  108. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  109. }
  110. int GetIndex()
  111. {
  112. // Asserts to make sure that we aren't using any skipped combinations.
  113. // Asserts to make sure that we are setting all of the combination vars.
  114. #ifdef _DEBUG
  115. bool bAllDynamicVarsDefined = m_bDOWATERFOG;
  116. Assert( bAllDynamicVarsDefined );
  117. #endif // _DEBUG
  118. return ( 1 * m_nDOWATERFOG ) + 0;
  119. }
  120. };
  121. #define shaderDynamicTest_cable_vs20 0
  122. static const ShaderComboInformation_t s_DynamicComboArray_cable_vs20[1] =
  123. {
  124. { "DOWATERFOG", 0, 1 },
  125. };
  126. static const ShaderComboInformation_t s_StaticComboArray_cable_vs20[2] =
  127. {
  128. { "DOPIXELFOG", 0, 1 },
  129. { "HARDWAREFOGBLEND", 0, 0 },
  130. };
  131. static const ShaderComboSemantics_t cable_vs20_combos =
  132. {
  133. "cable_vs20", s_DynamicComboArray_cable_vs20, 1, s_StaticComboArray_cable_vs20, 2
  134. };
  135. class ConstructMe_cable_vs20
  136. {
  137. public:
  138. ConstructMe_cable_vs20()
  139. {
  140. GetShaderDLL()->AddShaderComboInformation( &cable_vs20_combos );
  141. }
  142. };
  143. static ConstructMe_cable_vs20 s_ConstructMe_cable_vs20;