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.

204 lines
5.1 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $ALPHATESTREF == 1 ) && ( $SHADOWDEPTH == 1 )
  3. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  6. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  7. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  8. #include "shaderlib/cshader.h"
  9. class splinerope_ps20b_Static_Index
  10. {
  11. private:
  12. int m_nSHADER_SRGB_READ;
  13. #ifdef _DEBUG
  14. bool m_bSHADER_SRGB_READ;
  15. #endif
  16. public:
  17. void SetSHADER_SRGB_READ( int i )
  18. {
  19. Assert( i >= 0 && i <= 0 );
  20. m_nSHADER_SRGB_READ = i;
  21. #ifdef _DEBUG
  22. m_bSHADER_SRGB_READ = true;
  23. #endif
  24. }
  25. void SetSHADER_SRGB_READ( bool i )
  26. {
  27. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  28. m_nSHADER_SRGB_READ = i ? 1 : 0;
  29. #ifdef _DEBUG
  30. m_bSHADER_SRGB_READ = true;
  31. #endif
  32. }
  33. private:
  34. int m_nSHADOWDEPTH;
  35. #ifdef _DEBUG
  36. bool m_bSHADOWDEPTH;
  37. #endif
  38. public:
  39. void SetSHADOWDEPTH( int i )
  40. {
  41. Assert( i >= 0 && i <= 1 );
  42. m_nSHADOWDEPTH = i;
  43. #ifdef _DEBUG
  44. m_bSHADOWDEPTH = true;
  45. #endif
  46. }
  47. void SetSHADOWDEPTH( bool i )
  48. {
  49. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  50. m_nSHADOWDEPTH = i ? 1 : 0;
  51. #ifdef _DEBUG
  52. m_bSHADOWDEPTH = true;
  53. #endif
  54. }
  55. private:
  56. int m_nALPHATESTREF;
  57. #ifdef _DEBUG
  58. bool m_bALPHATESTREF;
  59. #endif
  60. public:
  61. void SetALPHATESTREF( int i )
  62. {
  63. Assert( i >= 0 && i <= 1 );
  64. m_nALPHATESTREF = i;
  65. #ifdef _DEBUG
  66. m_bALPHATESTREF = true;
  67. #endif
  68. }
  69. void SetALPHATESTREF( bool i )
  70. {
  71. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  72. m_nALPHATESTREF = i ? 1 : 0;
  73. #ifdef _DEBUG
  74. m_bALPHATESTREF = true;
  75. #endif
  76. }
  77. public:
  78. // CONSTRUCTOR
  79. splinerope_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  80. {
  81. #ifdef _DEBUG
  82. m_bSHADER_SRGB_READ = false;
  83. #endif // _DEBUG
  84. m_nSHADER_SRGB_READ = 0;
  85. #ifdef _DEBUG
  86. m_bSHADOWDEPTH = false;
  87. #endif // _DEBUG
  88. m_nSHADOWDEPTH = 0;
  89. #ifdef _DEBUG
  90. m_bALPHATESTREF = false;
  91. #endif // _DEBUG
  92. m_nALPHATESTREF = 0;
  93. }
  94. int GetIndex()
  95. {
  96. // Asserts to make sure that we aren't using any skipped combinations.
  97. // Asserts to make sure that we are setting all of the combination vars.
  98. #ifdef _DEBUG
  99. bool bAllStaticVarsDefined = m_bSHADER_SRGB_READ && m_bSHADOWDEPTH && m_bALPHATESTREF;
  100. Assert( bAllStaticVarsDefined );
  101. #endif // _DEBUG
  102. return ( 4 * m_nSHADER_SRGB_READ ) + ( 4 * m_nSHADOWDEPTH ) + ( 8 * m_nALPHATESTREF ) + 0;
  103. }
  104. };
  105. #define shaderStaticTest_splinerope_ps20b psh_forgot_to_set_static_SHADER_SRGB_READ + psh_forgot_to_set_static_SHADOWDEPTH + psh_forgot_to_set_static_ALPHATESTREF + 0
  106. class splinerope_ps20b_Dynamic_Index
  107. {
  108. private:
  109. int m_nWRITE_DEPTH_TO_DESTALPHA;
  110. #ifdef _DEBUG
  111. bool m_bWRITE_DEPTH_TO_DESTALPHA;
  112. #endif
  113. public:
  114. void SetWRITE_DEPTH_TO_DESTALPHA( int i )
  115. {
  116. Assert( i >= 0 && i <= 1 );
  117. m_nWRITE_DEPTH_TO_DESTALPHA = i;
  118. #ifdef _DEBUG
  119. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  120. #endif
  121. }
  122. void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
  123. {
  124. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  125. m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  128. #endif
  129. }
  130. private:
  131. int m_nPIXELFOGTYPE;
  132. #ifdef _DEBUG
  133. bool m_bPIXELFOGTYPE;
  134. #endif
  135. public:
  136. void SetPIXELFOGTYPE( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nPIXELFOGTYPE = i;
  140. #ifdef _DEBUG
  141. m_bPIXELFOGTYPE = true;
  142. #endif
  143. }
  144. void SetPIXELFOGTYPE( bool i )
  145. {
  146. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  147. m_nPIXELFOGTYPE = i ? 1 : 0;
  148. #ifdef _DEBUG
  149. m_bPIXELFOGTYPE = true;
  150. #endif
  151. }
  152. public:
  153. // CONSTRUCTOR
  154. splinerope_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  155. {
  156. #ifdef _DEBUG
  157. m_bWRITE_DEPTH_TO_DESTALPHA = false;
  158. #endif // _DEBUG
  159. m_nWRITE_DEPTH_TO_DESTALPHA = 0;
  160. #ifdef _DEBUG
  161. m_bPIXELFOGTYPE = true;
  162. #endif // _DEBUG
  163. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  164. }
  165. int GetIndex()
  166. {
  167. // Asserts to make sure that we aren't using any skipped combinations.
  168. // Asserts to make sure that we are setting all of the combination vars.
  169. #ifdef _DEBUG
  170. bool bAllDynamicVarsDefined = m_bWRITE_DEPTH_TO_DESTALPHA && m_bPIXELFOGTYPE;
  171. Assert( bAllDynamicVarsDefined );
  172. #endif // _DEBUG
  173. return ( 1 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  174. }
  175. };
  176. #define shaderDynamicTest_splinerope_ps20b psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
  177. static const ShaderComboInformation_t s_DynamicComboArray_splinerope_ps20b[2] =
  178. {
  179. { "WRITE_DEPTH_TO_DESTALPHA", 0, 1 },
  180. { "PIXELFOGTYPE", 0, 1 },
  181. };
  182. static const ShaderComboInformation_t s_StaticComboArray_splinerope_ps20b[3] =
  183. {
  184. { "SHADER_SRGB_READ", 0, 0 },
  185. { "SHADOWDEPTH", 0, 1 },
  186. { "ALPHATESTREF", 0, 1 },
  187. };
  188. static const ShaderComboSemantics_t splinerope_ps20b_combos =
  189. {
  190. "splinerope_ps20b", s_DynamicComboArray_splinerope_ps20b, 2, s_StaticComboArray_splinerope_ps20b, 3
  191. };
  192. class ConstructMe_splinerope_ps20b
  193. {
  194. public:
  195. ConstructMe_splinerope_ps20b()
  196. {
  197. GetShaderDLL()->AddShaderComboInformation( &splinerope_ps20b_combos );
  198. }
  199. };
  200. static ConstructMe_splinerope_ps20b s_ConstructMe_splinerope_ps20b;