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.

176 lines
4.5 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 splinerope_ps20_Static_Index
  9. {
  10. private:
  11. int m_nSHADER_SRGB_READ;
  12. #ifdef _DEBUG
  13. bool m_bSHADER_SRGB_READ;
  14. #endif
  15. public:
  16. void SetSHADER_SRGB_READ( int i )
  17. {
  18. Assert( i >= 0 && i <= 0 );
  19. m_nSHADER_SRGB_READ = i;
  20. #ifdef _DEBUG
  21. m_bSHADER_SRGB_READ = true;
  22. #endif
  23. }
  24. void SetSHADER_SRGB_READ( bool i )
  25. {
  26. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  27. m_nSHADER_SRGB_READ = i ? 1 : 0;
  28. #ifdef _DEBUG
  29. m_bSHADER_SRGB_READ = true;
  30. #endif
  31. }
  32. private:
  33. int m_nSHADOWDEPTH;
  34. #ifdef _DEBUG
  35. bool m_bSHADOWDEPTH;
  36. #endif
  37. public:
  38. void SetSHADOWDEPTH( int i )
  39. {
  40. Assert( i >= 0 && i <= 1 );
  41. m_nSHADOWDEPTH = i;
  42. #ifdef _DEBUG
  43. m_bSHADOWDEPTH = true;
  44. #endif
  45. }
  46. void SetSHADOWDEPTH( bool i )
  47. {
  48. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  49. m_nSHADOWDEPTH = i ? 1 : 0;
  50. #ifdef _DEBUG
  51. m_bSHADOWDEPTH = true;
  52. #endif
  53. }
  54. public:
  55. // CONSTRUCTOR
  56. splinerope_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  57. {
  58. #ifdef _DEBUG
  59. m_bSHADER_SRGB_READ = false;
  60. #endif // _DEBUG
  61. m_nSHADER_SRGB_READ = 0;
  62. #ifdef _DEBUG
  63. m_bSHADOWDEPTH = false;
  64. #endif // _DEBUG
  65. m_nSHADOWDEPTH = 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_bSHADER_SRGB_READ && m_bSHADOWDEPTH;
  73. Assert( bAllStaticVarsDefined );
  74. #endif // _DEBUG
  75. return ( 2 * m_nSHADER_SRGB_READ ) + ( 2 * m_nSHADOWDEPTH ) + 0;
  76. }
  77. };
  78. #define shaderStaticTest_splinerope_ps20 psh_forgot_to_set_static_SHADER_SRGB_READ + psh_forgot_to_set_static_SHADOWDEPTH + 0
  79. class splinerope_ps20_Dynamic_Index
  80. {
  81. private:
  82. int m_nWRITE_DEPTH_TO_DESTALPHA;
  83. #ifdef _DEBUG
  84. bool m_bWRITE_DEPTH_TO_DESTALPHA;
  85. #endif
  86. public:
  87. void SetWRITE_DEPTH_TO_DESTALPHA( int i )
  88. {
  89. Assert( i >= 0 && i <= 0 );
  90. m_nWRITE_DEPTH_TO_DESTALPHA = i;
  91. #ifdef _DEBUG
  92. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  93. #endif
  94. }
  95. void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
  96. {
  97. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  98. m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
  99. #ifdef _DEBUG
  100. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  101. #endif
  102. }
  103. private:
  104. int m_nPIXELFOGTYPE;
  105. #ifdef _DEBUG
  106. bool m_bPIXELFOGTYPE;
  107. #endif
  108. public:
  109. void SetPIXELFOGTYPE( int i )
  110. {
  111. Assert( i >= 0 && i <= 1 );
  112. m_nPIXELFOGTYPE = i;
  113. #ifdef _DEBUG
  114. m_bPIXELFOGTYPE = true;
  115. #endif
  116. }
  117. void SetPIXELFOGTYPE( bool i )
  118. {
  119. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  120. m_nPIXELFOGTYPE = i ? 1 : 0;
  121. #ifdef _DEBUG
  122. m_bPIXELFOGTYPE = true;
  123. #endif
  124. }
  125. public:
  126. // CONSTRUCTOR
  127. splinerope_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  128. {
  129. #ifdef _DEBUG
  130. m_bWRITE_DEPTH_TO_DESTALPHA = false;
  131. #endif // _DEBUG
  132. m_nWRITE_DEPTH_TO_DESTALPHA = 0;
  133. #ifdef _DEBUG
  134. m_bPIXELFOGTYPE = true;
  135. #endif // _DEBUG
  136. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  137. }
  138. int GetIndex()
  139. {
  140. // Asserts to make sure that we aren't using any skipped combinations.
  141. // Asserts to make sure that we are setting all of the combination vars.
  142. #ifdef _DEBUG
  143. bool bAllDynamicVarsDefined = m_bWRITE_DEPTH_TO_DESTALPHA && m_bPIXELFOGTYPE;
  144. Assert( bAllDynamicVarsDefined );
  145. #endif // _DEBUG
  146. return ( 1 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 1 * m_nPIXELFOGTYPE ) + 0;
  147. }
  148. };
  149. #define shaderDynamicTest_splinerope_ps20 psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
  150. static const ShaderComboInformation_t s_DynamicComboArray_splinerope_ps20[2] =
  151. {
  152. { "WRITE_DEPTH_TO_DESTALPHA", 0, 0 },
  153. { "PIXELFOGTYPE", 0, 1 },
  154. };
  155. static const ShaderComboInformation_t s_StaticComboArray_splinerope_ps20[2] =
  156. {
  157. { "SHADER_SRGB_READ", 0, 0 },
  158. { "SHADOWDEPTH", 0, 1 },
  159. };
  160. static const ShaderComboSemantics_t splinerope_ps20_combos =
  161. {
  162. "splinerope_ps20", s_DynamicComboArray_splinerope_ps20, 2, s_StaticComboArray_splinerope_ps20, 2
  163. };
  164. class ConstructMe_splinerope_ps20
  165. {
  166. public:
  167. ConstructMe_splinerope_ps20()
  168. {
  169. GetShaderDLL()->AddShaderComboInformation( &splinerope_ps20_combos );
  170. }
  171. };
  172. static ConstructMe_splinerope_ps20 s_ConstructMe_splinerope_ps20;