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.

150 lines
3.9 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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  8. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  9. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  10. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  11. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  12. #include "shaderlib/cshader.h"
  13. class deferred_post_process_ps20b_Static_Index
  14. {
  15. private:
  16. int m_nFOW;
  17. #ifdef _DEBUG
  18. bool m_bFOW;
  19. #endif
  20. public:
  21. void SetFOW( int i )
  22. {
  23. Assert( i >= 0 && i <= 1 );
  24. m_nFOW = i;
  25. #ifdef _DEBUG
  26. m_bFOW = true;
  27. #endif
  28. }
  29. void SetFOW( bool i )
  30. {
  31. m_nFOW = i ? 1 : 0;
  32. #ifdef _DEBUG
  33. m_bFOW = true;
  34. #endif
  35. }
  36. private:
  37. int m_nDEBUG;
  38. #ifdef _DEBUG
  39. bool m_bDEBUG;
  40. #endif
  41. public:
  42. void SetDEBUG( int i )
  43. {
  44. Assert( i >= 0 && i <= 1 );
  45. m_nDEBUG = i;
  46. #ifdef _DEBUG
  47. m_bDEBUG = true;
  48. #endif
  49. }
  50. void SetDEBUG( bool i )
  51. {
  52. m_nDEBUG = i ? 1 : 0;
  53. #ifdef _DEBUG
  54. m_bDEBUG = true;
  55. #endif
  56. }
  57. public:
  58. // CONSTRUCTOR
  59. deferred_post_process_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  60. {
  61. #ifdef _DEBUG
  62. m_bFOW = false;
  63. #endif // _DEBUG
  64. m_nFOW = 0;
  65. #ifdef _DEBUG
  66. m_bDEBUG = false;
  67. #endif // _DEBUG
  68. m_nDEBUG = 0;
  69. }
  70. int GetIndex()
  71. {
  72. // Asserts to make sure that we aren't using any skipped combinations.
  73. // Asserts to make sure that we are setting all of the combination vars.
  74. #ifdef _DEBUG
  75. bool bAllStaticVarsDefined = m_bFOW && m_bDEBUG;
  76. Assert( bAllStaticVarsDefined );
  77. #endif // _DEBUG
  78. return ( 4 * m_nFOW ) + ( 8 * m_nDEBUG ) + 0;
  79. }
  80. };
  81. #define shaderStaticTest_deferred_post_process_ps20b psh_forgot_to_set_static_FOW + psh_forgot_to_set_static_DEBUG + 0
  82. class deferred_post_process_ps20b_Dynamic_Index
  83. {
  84. private:
  85. int m_nWRITEWATERFOGTODESTALPHA;
  86. #ifdef _DEBUG
  87. bool m_bWRITEWATERFOGTODESTALPHA;
  88. #endif
  89. public:
  90. void SetWRITEWATERFOGTODESTALPHA( int i )
  91. {
  92. Assert( i >= 0 && i <= 1 );
  93. m_nWRITEWATERFOGTODESTALPHA = i;
  94. #ifdef _DEBUG
  95. m_bWRITEWATERFOGTODESTALPHA = true;
  96. #endif
  97. }
  98. void SetWRITEWATERFOGTODESTALPHA( bool i )
  99. {
  100. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  101. #ifdef _DEBUG
  102. m_bWRITEWATERFOGTODESTALPHA = true;
  103. #endif
  104. }
  105. private:
  106. int m_nPIXELFOGTYPE;
  107. #ifdef _DEBUG
  108. bool m_bPIXELFOGTYPE;
  109. #endif
  110. public:
  111. void SetPIXELFOGTYPE( int i )
  112. {
  113. Assert( i >= 0 && i <= 1 );
  114. m_nPIXELFOGTYPE = i;
  115. #ifdef _DEBUG
  116. m_bPIXELFOGTYPE = true;
  117. #endif
  118. }
  119. void SetPIXELFOGTYPE( bool i )
  120. {
  121. m_nPIXELFOGTYPE = i ? 1 : 0;
  122. #ifdef _DEBUG
  123. m_bPIXELFOGTYPE = true;
  124. #endif
  125. }
  126. public:
  127. // CONSTRUCTOR
  128. deferred_post_process_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  129. {
  130. #ifdef _DEBUG
  131. m_bWRITEWATERFOGTODESTALPHA = false;
  132. #endif // _DEBUG
  133. m_nWRITEWATERFOGTODESTALPHA = 0;
  134. #ifdef _DEBUG
  135. m_bPIXELFOGTYPE = true;
  136. #endif // _DEBUG
  137. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  138. }
  139. int GetIndex()
  140. {
  141. // Asserts to make sure that we aren't using any skipped combinations.
  142. // Asserts to make sure that we are setting all of the combination vars.
  143. #ifdef _DEBUG
  144. bool bAllDynamicVarsDefined = m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE;
  145. Assert( bAllDynamicVarsDefined );
  146. #endif // _DEBUG
  147. return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  148. }
  149. };
  150. #define shaderDynamicTest_deferred_post_process_ps20b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + 0