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.4 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 cloak_ps20_Static_Index
  9. {
  10. private:
  11. int m_nLIGHTWARPTEXTURE;
  12. #ifdef _DEBUG
  13. bool m_bLIGHTWARPTEXTURE;
  14. #endif
  15. public:
  16. void SetLIGHTWARPTEXTURE( int i )
  17. {
  18. Assert( i >= 0 && i <= 1 );
  19. m_nLIGHTWARPTEXTURE = i;
  20. #ifdef _DEBUG
  21. m_bLIGHTWARPTEXTURE = true;
  22. #endif
  23. }
  24. void SetLIGHTWARPTEXTURE( bool i )
  25. {
  26. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  27. m_nLIGHTWARPTEXTURE = i ? 1 : 0;
  28. #ifdef _DEBUG
  29. m_bLIGHTWARPTEXTURE = true;
  30. #endif
  31. }
  32. public:
  33. // CONSTRUCTOR
  34. cloak_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  35. {
  36. #ifdef _DEBUG
  37. m_bLIGHTWARPTEXTURE = false;
  38. #endif // _DEBUG
  39. m_nLIGHTWARPTEXTURE = 0;
  40. }
  41. int GetIndex()
  42. {
  43. // Asserts to make sure that we aren't using any skipped combinations.
  44. // Asserts to make sure that we are setting all of the combination vars.
  45. #ifdef _DEBUG
  46. bool bAllStaticVarsDefined = m_bLIGHTWARPTEXTURE;
  47. Assert( bAllStaticVarsDefined );
  48. #endif // _DEBUG
  49. return ( 12 * m_nLIGHTWARPTEXTURE ) + 0;
  50. }
  51. };
  52. #define shaderStaticTest_cloak_ps20 psh_forgot_to_set_static_LIGHTWARPTEXTURE + 0
  53. class cloak_ps20_Dynamic_Index
  54. {
  55. private:
  56. int m_nPIXELFOGTYPE;
  57. #ifdef _DEBUG
  58. bool m_bPIXELFOGTYPE;
  59. #endif
  60. public:
  61. void SetPIXELFOGTYPE( int i )
  62. {
  63. Assert( i >= 0 && i <= 1 );
  64. m_nPIXELFOGTYPE = i;
  65. #ifdef _DEBUG
  66. m_bPIXELFOGTYPE = true;
  67. #endif
  68. }
  69. void SetPIXELFOGTYPE( bool i )
  70. {
  71. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  72. m_nPIXELFOGTYPE = i ? 1 : 0;
  73. #ifdef _DEBUG
  74. m_bPIXELFOGTYPE = true;
  75. #endif
  76. }
  77. private:
  78. int m_nWRITEWATERFOGTODESTALPHA;
  79. #ifdef _DEBUG
  80. bool m_bWRITEWATERFOGTODESTALPHA;
  81. #endif
  82. public:
  83. void SetWRITEWATERFOGTODESTALPHA( int i )
  84. {
  85. Assert( i >= 0 && i <= 1 );
  86. m_nWRITEWATERFOGTODESTALPHA = i;
  87. #ifdef _DEBUG
  88. m_bWRITEWATERFOGTODESTALPHA = true;
  89. #endif
  90. }
  91. void SetWRITEWATERFOGTODESTALPHA( bool i )
  92. {
  93. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  94. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  95. #ifdef _DEBUG
  96. m_bWRITEWATERFOGTODESTALPHA = true;
  97. #endif
  98. }
  99. private:
  100. int m_nNUM_LIGHTS;
  101. #ifdef _DEBUG
  102. bool m_bNUM_LIGHTS;
  103. #endif
  104. public:
  105. void SetNUM_LIGHTS( int i )
  106. {
  107. Assert( i >= 0 && i <= 2 );
  108. m_nNUM_LIGHTS = i;
  109. #ifdef _DEBUG
  110. m_bNUM_LIGHTS = true;
  111. #endif
  112. }
  113. void SetNUM_LIGHTS( bool i )
  114. {
  115. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  116. m_nNUM_LIGHTS = i ? 1 : 0;
  117. #ifdef _DEBUG
  118. m_bNUM_LIGHTS = true;
  119. #endif
  120. }
  121. public:
  122. // CONSTRUCTOR
  123. cloak_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  124. {
  125. #ifdef _DEBUG
  126. m_bPIXELFOGTYPE = true;
  127. #endif // _DEBUG
  128. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  129. #ifdef _DEBUG
  130. m_bWRITEWATERFOGTODESTALPHA = false;
  131. #endif // _DEBUG
  132. m_nWRITEWATERFOGTODESTALPHA = 0;
  133. #ifdef _DEBUG
  134. m_bNUM_LIGHTS = false;
  135. #endif // _DEBUG
  136. m_nNUM_LIGHTS = 0;
  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_bPIXELFOGTYPE && m_bWRITEWATERFOGTODESTALPHA && m_bNUM_LIGHTS;
  144. Assert( bAllDynamicVarsDefined );
  145. #endif // _DEBUG
  146. return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nWRITEWATERFOGTODESTALPHA ) + ( 4 * m_nNUM_LIGHTS ) + 0;
  147. }
  148. };
  149. #define shaderDynamicTest_cloak_ps20 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_NUM_LIGHTS + 0
  150. static const ShaderComboInformation_t s_DynamicComboArray_cloak_ps20[3] =
  151. {
  152. { "PIXELFOGTYPE", 0, 1 },
  153. { "WRITEWATERFOGTODESTALPHA", 0, 1 },
  154. { "NUM_LIGHTS", 0, 2 },
  155. };
  156. static const ShaderComboInformation_t s_StaticComboArray_cloak_ps20[1] =
  157. {
  158. { "LIGHTWARPTEXTURE", 0, 1 },
  159. };
  160. static const ShaderComboSemantics_t cloak_ps20_combos =
  161. {
  162. "cloak_ps20", s_DynamicComboArray_cloak_ps20, 3, s_StaticComboArray_cloak_ps20, 1
  163. };
  164. class ConstructMe_cloak_ps20
  165. {
  166. public:
  167. ConstructMe_cloak_ps20()
  168. {
  169. GetShaderDLL()->AddShaderComboInformation( &cloak_ps20_combos );
  170. }
  171. };
  172. static ConstructMe_cloak_ps20 s_ConstructMe_cloak_ps20;