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.

181 lines
5.1 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 teeth_flashlight_ps30_Static_Index
  14. {
  15. private:
  16. int m_nFLASHLIGHTDEPTHFILTERMODE;
  17. #ifdef _DEBUG
  18. bool m_bFLASHLIGHTDEPTHFILTERMODE;
  19. #endif
  20. public:
  21. void SetFLASHLIGHTDEPTHFILTERMODE( int i )
  22. {
  23. Assert( i >= 0 && i <= 2 );
  24. m_nFLASHLIGHTDEPTHFILTERMODE = i;
  25. #ifdef _DEBUG
  26. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  27. #endif
  28. }
  29. void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
  30. {
  31. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  32. m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
  33. #ifdef _DEBUG
  34. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  35. #endif
  36. }
  37. public:
  38. // CONSTRUCTOR
  39. teeth_flashlight_ps30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  40. {
  41. #ifdef _DEBUG
  42. m_bFLASHLIGHTDEPTHFILTERMODE = false;
  43. #endif // _DEBUG
  44. m_nFLASHLIGHTDEPTHFILTERMODE = 0;
  45. }
  46. int GetIndex()
  47. {
  48. // Asserts to make sure that we aren't using any skipped combinations.
  49. // Asserts to make sure that we are setting all of the combination vars.
  50. #ifdef _DEBUG
  51. bool bAllStaticVarsDefined = m_bFLASHLIGHTDEPTHFILTERMODE;
  52. Assert( bAllStaticVarsDefined );
  53. #endif // _DEBUG
  54. return ( 8 * m_nFLASHLIGHTDEPTHFILTERMODE ) + 0;
  55. }
  56. };
  57. #define shaderStaticTest_teeth_flashlight_ps30 psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + 0
  58. class teeth_flashlight_ps30_Dynamic_Index
  59. {
  60. private:
  61. int m_nPIXELFOGTYPE;
  62. #ifdef _DEBUG
  63. bool m_bPIXELFOGTYPE;
  64. #endif
  65. public:
  66. void SetPIXELFOGTYPE( int i )
  67. {
  68. Assert( i >= 0 && i <= 1 );
  69. m_nPIXELFOGTYPE = i;
  70. #ifdef _DEBUG
  71. m_bPIXELFOGTYPE = true;
  72. #endif
  73. }
  74. void SetPIXELFOGTYPE( bool i )
  75. {
  76. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  77. m_nPIXELFOGTYPE = i ? 1 : 0;
  78. #ifdef _DEBUG
  79. m_bPIXELFOGTYPE = true;
  80. #endif
  81. }
  82. private:
  83. int m_nFLASHLIGHTSHADOWS;
  84. #ifdef _DEBUG
  85. bool m_bFLASHLIGHTSHADOWS;
  86. #endif
  87. public:
  88. void SetFLASHLIGHTSHADOWS( int i )
  89. {
  90. Assert( i >= 0 && i <= 1 );
  91. m_nFLASHLIGHTSHADOWS = i;
  92. #ifdef _DEBUG
  93. m_bFLASHLIGHTSHADOWS = true;
  94. #endif
  95. }
  96. void SetFLASHLIGHTSHADOWS( bool i )
  97. {
  98. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  99. m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
  100. #ifdef _DEBUG
  101. m_bFLASHLIGHTSHADOWS = true;
  102. #endif
  103. }
  104. private:
  105. int m_nUBERLIGHT;
  106. #ifdef _DEBUG
  107. bool m_bUBERLIGHT;
  108. #endif
  109. public:
  110. void SetUBERLIGHT( int i )
  111. {
  112. Assert( i >= 0 && i <= 1 );
  113. m_nUBERLIGHT = i;
  114. #ifdef _DEBUG
  115. m_bUBERLIGHT = true;
  116. #endif
  117. }
  118. void SetUBERLIGHT( bool i )
  119. {
  120. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  121. m_nUBERLIGHT = i ? 1 : 0;
  122. #ifdef _DEBUG
  123. m_bUBERLIGHT = true;
  124. #endif
  125. }
  126. public:
  127. // CONSTRUCTOR
  128. teeth_flashlight_ps30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  129. {
  130. #ifdef _DEBUG
  131. m_bPIXELFOGTYPE = true;
  132. #endif // _DEBUG
  133. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  134. #ifdef _DEBUG
  135. m_bFLASHLIGHTSHADOWS = false;
  136. #endif // _DEBUG
  137. m_nFLASHLIGHTSHADOWS = 0;
  138. #ifdef _DEBUG
  139. m_bUBERLIGHT = false;
  140. #endif // _DEBUG
  141. m_nUBERLIGHT = 0;
  142. }
  143. int GetIndex()
  144. {
  145. // Asserts to make sure that we aren't using any skipped combinations.
  146. // Asserts to make sure that we are setting all of the combination vars.
  147. #ifdef _DEBUG
  148. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE && m_bFLASHLIGHTSHADOWS && m_bUBERLIGHT;
  149. Assert( bAllDynamicVarsDefined );
  150. #endif // _DEBUG
  151. return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nFLASHLIGHTSHADOWS ) + ( 4 * m_nUBERLIGHT ) + 0;
  152. }
  153. };
  154. #define shaderDynamicTest_teeth_flashlight_ps30 psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_UBERLIGHT + 0
  155. static const ShaderComboInformation_t s_DynamicComboArray_teeth_flashlight_ps30[3] =
  156. {
  157. { "PIXELFOGTYPE", 0, 1 },
  158. { "FLASHLIGHTSHADOWS", 0, 1 },
  159. { "UBERLIGHT", 0, 1 },
  160. };
  161. static const ShaderComboInformation_t s_StaticComboArray_teeth_flashlight_ps30[1] =
  162. {
  163. { "FLASHLIGHTDEPTHFILTERMODE", 0, 2 },
  164. };
  165. static const ShaderComboSemantics_t teeth_flashlight_ps30_combos =
  166. {
  167. "teeth_flashlight_ps30", s_DynamicComboArray_teeth_flashlight_ps30, 3, s_StaticComboArray_teeth_flashlight_ps30, 1
  168. };
  169. class ConstructMe_teeth_flashlight_ps30
  170. {
  171. public:
  172. ConstructMe_teeth_flashlight_ps30()
  173. {
  174. GetShaderDLL()->AddShaderComboInformation( &teeth_flashlight_ps30_combos );
  175. }
  176. };
  177. static ConstructMe_teeth_flashlight_ps30 s_ConstructMe_teeth_flashlight_ps30;