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.

149 lines
3.8 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  3. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  6. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  7. #include "shaderlib/cshader.h"
  8. class shadow_ps20_Static_Index
  9. {
  10. private:
  11. int m_nDEFERRED_SHADOWS;
  12. #ifdef _DEBUG
  13. bool m_bDEFERRED_SHADOWS;
  14. #endif
  15. public:
  16. void SetDEFERRED_SHADOWS( int i )
  17. {
  18. Assert( i >= 0 && i <= 1 );
  19. m_nDEFERRED_SHADOWS = i;
  20. #ifdef _DEBUG
  21. m_bDEFERRED_SHADOWS = true;
  22. #endif
  23. }
  24. void SetDEFERRED_SHADOWS( bool i )
  25. {
  26. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  27. m_nDEFERRED_SHADOWS = i ? 1 : 0;
  28. #ifdef _DEBUG
  29. m_bDEFERRED_SHADOWS = true;
  30. #endif
  31. }
  32. private:
  33. int m_nBLOBBY_SHADOWS;
  34. #ifdef _DEBUG
  35. bool m_bBLOBBY_SHADOWS;
  36. #endif
  37. public:
  38. void SetBLOBBY_SHADOWS( int i )
  39. {
  40. Assert( i >= 0 && i <= 1 );
  41. m_nBLOBBY_SHADOWS = i;
  42. #ifdef _DEBUG
  43. m_bBLOBBY_SHADOWS = true;
  44. #endif
  45. }
  46. void SetBLOBBY_SHADOWS( bool i )
  47. {
  48. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  49. m_nBLOBBY_SHADOWS = i ? 1 : 0;
  50. #ifdef _DEBUG
  51. m_bBLOBBY_SHADOWS = true;
  52. #endif
  53. }
  54. public:
  55. // CONSTRUCTOR
  56. shadow_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  57. {
  58. #ifdef _DEBUG
  59. m_bDEFERRED_SHADOWS = false;
  60. #endif // _DEBUG
  61. m_nDEFERRED_SHADOWS = 0;
  62. #ifdef _DEBUG
  63. m_bBLOBBY_SHADOWS = false;
  64. #endif // _DEBUG
  65. m_nBLOBBY_SHADOWS = 0;
  66. }
  67. int GetIndex()
  68. {
  69. // Asserts to make sure that we aren't using any skipped combinations.
  70. // Asserts to make sure that we are setting all of the combination vars.
  71. #ifdef _DEBUG
  72. bool bAllStaticVarsDefined = m_bDEFERRED_SHADOWS && m_bBLOBBY_SHADOWS;
  73. Assert( bAllStaticVarsDefined );
  74. #endif // _DEBUG
  75. return ( 2 * m_nDEFERRED_SHADOWS ) + ( 4 * m_nBLOBBY_SHADOWS ) + 0;
  76. }
  77. };
  78. #define shaderStaticTest_shadow_ps20 psh_forgot_to_set_static_DEFERRED_SHADOWS + psh_forgot_to_set_static_BLOBBY_SHADOWS + 0
  79. class shadow_ps20_Dynamic_Index
  80. {
  81. private:
  82. int m_nPIXELFOGTYPE;
  83. #ifdef _DEBUG
  84. bool m_bPIXELFOGTYPE;
  85. #endif
  86. public:
  87. void SetPIXELFOGTYPE( int i )
  88. {
  89. Assert( i >= 0 && i <= 1 );
  90. m_nPIXELFOGTYPE = i;
  91. #ifdef _DEBUG
  92. m_bPIXELFOGTYPE = true;
  93. #endif
  94. }
  95. void SetPIXELFOGTYPE( bool i )
  96. {
  97. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  98. m_nPIXELFOGTYPE = i ? 1 : 0;
  99. #ifdef _DEBUG
  100. m_bPIXELFOGTYPE = true;
  101. #endif
  102. }
  103. public:
  104. // CONSTRUCTOR
  105. shadow_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  106. {
  107. #ifdef _DEBUG
  108. m_bPIXELFOGTYPE = true;
  109. #endif // _DEBUG
  110. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  111. }
  112. int GetIndex()
  113. {
  114. // Asserts to make sure that we aren't using any skipped combinations.
  115. // Asserts to make sure that we are setting all of the combination vars.
  116. #ifdef _DEBUG
  117. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  118. Assert( bAllDynamicVarsDefined );
  119. #endif // _DEBUG
  120. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  121. }
  122. };
  123. #define shaderDynamicTest_shadow_ps20 0
  124. static const ShaderComboInformation_t s_DynamicComboArray_shadow_ps20[1] =
  125. {
  126. { "PIXELFOGTYPE", 0, 1 },
  127. };
  128. static const ShaderComboInformation_t s_StaticComboArray_shadow_ps20[2] =
  129. {
  130. { "DEFERRED_SHADOWS", 0, 1 },
  131. { "BLOBBY_SHADOWS", 0, 1 },
  132. };
  133. static const ShaderComboSemantics_t shadow_ps20_combos =
  134. {
  135. "shadow_ps20", s_DynamicComboArray_shadow_ps20, 1, s_StaticComboArray_shadow_ps20, 2
  136. };
  137. class ConstructMe_shadow_ps20
  138. {
  139. public:
  140. ConstructMe_shadow_ps20()
  141. {
  142. GetShaderDLL()->AddShaderComboInformation( &shadow_ps20_combos );
  143. }
  144. };
  145. static ConstructMe_shadow_ps20 s_ConstructMe_shadow_ps20;