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 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. public:
  53. // CONSTRUCTOR
  54. shadow_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  55. {
  56. #ifdef _DEBUG
  57. m_bDEFERRED_SHADOWS = false;
  58. #endif // _DEBUG
  59. m_nDEFERRED_SHADOWS = 0;
  60. #ifdef _DEBUG
  61. m_bDOPIXELFOG = true;
  62. #endif // _DEBUG
  63. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  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_bDEFERRED_SHADOWS && m_bDOPIXELFOG;
  71. Assert( bAllStaticVarsDefined );
  72. #endif // _DEBUG
  73. return ( 2 * m_nDEFERRED_SHADOWS ) + ( 4 * m_nDOPIXELFOG ) + 0;
  74. }
  75. };
  76. #define shaderStaticTest_shadow_vs20 vsh_forgot_to_set_static_DEFERRED_SHADOWS + 0
  77. class shadow_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. shadow_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_shadow_vs20 0
  122. static const ShaderComboInformation_t s_DynamicComboArray_shadow_vs20[1] =
  123. {
  124. { "DOWATERFOG", 0, 1 },
  125. };
  126. static const ShaderComboInformation_t s_StaticComboArray_shadow_vs20[2] =
  127. {
  128. { "DEFERRED_SHADOWS", 0, 1 },
  129. { "DOPIXELFOG", 0, 1 },
  130. };
  131. static const ShaderComboSemantics_t shadow_vs20_combos =
  132. {
  133. "shadow_vs20", s_DynamicComboArray_shadow_vs20, 1, s_StaticComboArray_shadow_vs20, 2
  134. };
  135. class ConstructMe_shadow_vs20
  136. {
  137. public:
  138. ConstructMe_shadow_vs20()
  139. {
  140. GetShaderDLL()->AddShaderComboInformation( &shadow_vs20_combos );
  141. }
  142. };
  143. static ConstructMe_shadow_vs20 s_ConstructMe_shadow_vs20;