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.

182 lines
5.0 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( CROSSHAIR_MODE == 1 ) && ( LIGHTING_PREVIEW > 0 )
  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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  9. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  10. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  11. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  12. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  13. #include "shaderlib/cshader.h"
  14. class unlittwotexture_ps20_Static_Index
  15. {
  16. private:
  17. int m_nTRANSLUCENT;
  18. #ifdef _DEBUG
  19. bool m_bTRANSLUCENT;
  20. #endif
  21. public:
  22. void SetTRANSLUCENT( int i )
  23. {
  24. Assert( i >= 0 && i <= 1 );
  25. m_nTRANSLUCENT = i;
  26. #ifdef _DEBUG
  27. m_bTRANSLUCENT = true;
  28. #endif
  29. }
  30. void SetTRANSLUCENT( bool i )
  31. {
  32. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  33. m_nTRANSLUCENT = i ? 1 : 0;
  34. #ifdef _DEBUG
  35. m_bTRANSLUCENT = true;
  36. #endif
  37. }
  38. private:
  39. int m_nLIGHTING_PREVIEW;
  40. #ifdef _DEBUG
  41. bool m_bLIGHTING_PREVIEW;
  42. #endif
  43. public:
  44. void SetLIGHTING_PREVIEW( int i )
  45. {
  46. Assert( i >= 0 && i <= 3 );
  47. m_nLIGHTING_PREVIEW = i;
  48. #ifdef _DEBUG
  49. m_bLIGHTING_PREVIEW = true;
  50. #endif
  51. }
  52. void SetLIGHTING_PREVIEW( bool i )
  53. {
  54. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 3 );
  55. m_nLIGHTING_PREVIEW = i ? 1 : 0;
  56. #ifdef _DEBUG
  57. m_bLIGHTING_PREVIEW = true;
  58. #endif
  59. }
  60. private:
  61. int m_nCROSSHAIR_MODE;
  62. #ifdef _DEBUG
  63. bool m_bCROSSHAIR_MODE;
  64. #endif
  65. public:
  66. void SetCROSSHAIR_MODE( int i )
  67. {
  68. Assert( i >= 0 && i <= 1 );
  69. m_nCROSSHAIR_MODE = i;
  70. #ifdef _DEBUG
  71. m_bCROSSHAIR_MODE = true;
  72. #endif
  73. }
  74. void SetCROSSHAIR_MODE( bool i )
  75. {
  76. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  77. m_nCROSSHAIR_MODE = i ? 1 : 0;
  78. #ifdef _DEBUG
  79. m_bCROSSHAIR_MODE = true;
  80. #endif
  81. }
  82. public:
  83. // CONSTRUCTOR
  84. unlittwotexture_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  85. {
  86. #ifdef _DEBUG
  87. m_bTRANSLUCENT = false;
  88. #endif // _DEBUG
  89. m_nTRANSLUCENT = 0;
  90. #ifdef _DEBUG
  91. m_bLIGHTING_PREVIEW = false;
  92. #endif // _DEBUG
  93. m_nLIGHTING_PREVIEW = 0;
  94. #ifdef _DEBUG
  95. m_bCROSSHAIR_MODE = false;
  96. #endif // _DEBUG
  97. m_nCROSSHAIR_MODE = 0;
  98. }
  99. int GetIndex()
  100. {
  101. // Asserts to make sure that we aren't using any skipped combinations.
  102. // Asserts to make sure that we are setting all of the combination vars.
  103. #ifdef _DEBUG
  104. bool bAllStaticVarsDefined = m_bTRANSLUCENT && m_bLIGHTING_PREVIEW && m_bCROSSHAIR_MODE;
  105. Assert( bAllStaticVarsDefined );
  106. #endif // _DEBUG
  107. return ( 2 * m_nTRANSLUCENT ) + ( 4 * m_nLIGHTING_PREVIEW ) + ( 16 * m_nCROSSHAIR_MODE ) + 0;
  108. }
  109. };
  110. #define shaderStaticTest_unlittwotexture_ps20 psh_forgot_to_set_static_TRANSLUCENT + psh_forgot_to_set_static_LIGHTING_PREVIEW + psh_forgot_to_set_static_CROSSHAIR_MODE + 0
  111. class unlittwotexture_ps20_Dynamic_Index
  112. {
  113. private:
  114. int m_nPIXELFOGTYPE;
  115. #ifdef _DEBUG
  116. bool m_bPIXELFOGTYPE;
  117. #endif
  118. public:
  119. void SetPIXELFOGTYPE( int i )
  120. {
  121. Assert( i >= 0 && i <= 1 );
  122. m_nPIXELFOGTYPE = i;
  123. #ifdef _DEBUG
  124. m_bPIXELFOGTYPE = true;
  125. #endif
  126. }
  127. void SetPIXELFOGTYPE( bool i )
  128. {
  129. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  130. m_nPIXELFOGTYPE = i ? 1 : 0;
  131. #ifdef _DEBUG
  132. m_bPIXELFOGTYPE = true;
  133. #endif
  134. }
  135. public:
  136. // CONSTRUCTOR
  137. unlittwotexture_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  138. {
  139. #ifdef _DEBUG
  140. m_bPIXELFOGTYPE = true;
  141. #endif // _DEBUG
  142. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  143. }
  144. int GetIndex()
  145. {
  146. // Asserts to make sure that we aren't using any skipped combinations.
  147. // Asserts to make sure that we are setting all of the combination vars.
  148. #ifdef _DEBUG
  149. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  150. Assert( bAllDynamicVarsDefined );
  151. #endif // _DEBUG
  152. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  153. }
  154. };
  155. #define shaderDynamicTest_unlittwotexture_ps20 0
  156. static const ShaderComboInformation_t s_DynamicComboArray_unlittwotexture_ps20[1] =
  157. {
  158. { "PIXELFOGTYPE", 0, 1 },
  159. };
  160. static const ShaderComboInformation_t s_StaticComboArray_unlittwotexture_ps20[3] =
  161. {
  162. { "TRANSLUCENT", 0, 1 },
  163. { "LIGHTING_PREVIEW", 0, 3 },
  164. { "CROSSHAIR_MODE", 0, 1 },
  165. };
  166. static const ShaderComboSemantics_t unlittwotexture_ps20_combos =
  167. {
  168. "unlittwotexture_ps20", s_DynamicComboArray_unlittwotexture_ps20, 1, s_StaticComboArray_unlittwotexture_ps20, 3
  169. };
  170. class ConstructMe_unlittwotexture_ps20
  171. {
  172. public:
  173. ConstructMe_unlittwotexture_ps20()
  174. {
  175. GetShaderDLL()->AddShaderComboInformation( &unlittwotexture_ps20_combos );
  176. }
  177. };
  178. static ConstructMe_unlittwotexture_ps20 s_ConstructMe_unlittwotexture_ps20;