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 unlittwotexture_ps20b_Static_Index
  14. {
  15. private:
  16. int m_nTRANSLUCENT;
  17. #ifdef _DEBUG
  18. bool m_bTRANSLUCENT;
  19. #endif
  20. public:
  21. void SetTRANSLUCENT( int i )
  22. {
  23. Assert( i >= 0 && i <= 1 );
  24. m_nTRANSLUCENT = i;
  25. #ifdef _DEBUG
  26. m_bTRANSLUCENT = true;
  27. #endif
  28. }
  29. void SetTRANSLUCENT( bool i )
  30. {
  31. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  32. m_nTRANSLUCENT = i ? 1 : 0;
  33. #ifdef _DEBUG
  34. m_bTRANSLUCENT = true;
  35. #endif
  36. }
  37. private:
  38. int m_nLIGHTING_PREVIEW;
  39. #ifdef _DEBUG
  40. bool m_bLIGHTING_PREVIEW;
  41. #endif
  42. public:
  43. void SetLIGHTING_PREVIEW( int i )
  44. {
  45. Assert( i >= 0 && i <= 0 );
  46. m_nLIGHTING_PREVIEW = i;
  47. #ifdef _DEBUG
  48. m_bLIGHTING_PREVIEW = true;
  49. #endif
  50. }
  51. void SetLIGHTING_PREVIEW( bool i )
  52. {
  53. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  54. m_nLIGHTING_PREVIEW = i ? 1 : 0;
  55. #ifdef _DEBUG
  56. m_bLIGHTING_PREVIEW = true;
  57. #endif
  58. }
  59. public:
  60. // CONSTRUCTOR
  61. unlittwotexture_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  62. {
  63. #ifdef _DEBUG
  64. m_bTRANSLUCENT = false;
  65. #endif // _DEBUG
  66. m_nTRANSLUCENT = 0;
  67. #ifdef _DEBUG
  68. m_bLIGHTING_PREVIEW = false;
  69. #endif // _DEBUG
  70. m_nLIGHTING_PREVIEW = 0;
  71. }
  72. int GetIndex()
  73. {
  74. // Asserts to make sure that we aren't using any skipped combinations.
  75. // Asserts to make sure that we are setting all of the combination vars.
  76. #ifdef _DEBUG
  77. bool bAllStaticVarsDefined = m_bTRANSLUCENT && m_bLIGHTING_PREVIEW;
  78. Assert( bAllStaticVarsDefined );
  79. #endif // _DEBUG
  80. return ( 2 * m_nTRANSLUCENT ) + ( 4 * m_nLIGHTING_PREVIEW ) + 0;
  81. }
  82. };
  83. #define shaderStaticTest_unlittwotexture_ps20b psh_forgot_to_set_static_TRANSLUCENT + psh_forgot_to_set_static_LIGHTING_PREVIEW + 0
  84. class unlittwotexture_ps20b_Dynamic_Index
  85. {
  86. private:
  87. int m_nPIXELFOGTYPE;
  88. #ifdef _DEBUG
  89. bool m_bPIXELFOGTYPE;
  90. #endif
  91. public:
  92. void SetPIXELFOGTYPE( int i )
  93. {
  94. Assert( i >= 0 && i <= 1 );
  95. m_nPIXELFOGTYPE = i;
  96. #ifdef _DEBUG
  97. m_bPIXELFOGTYPE = true;
  98. #endif
  99. }
  100. void SetPIXELFOGTYPE( bool i )
  101. {
  102. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  103. m_nPIXELFOGTYPE = i ? 1 : 0;
  104. #ifdef _DEBUG
  105. m_bPIXELFOGTYPE = true;
  106. #endif
  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 <= 0 );
  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 ) <= 0 );
  125. m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  128. #endif
  129. }
  130. public:
  131. // CONSTRUCTOR
  132. unlittwotexture_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  133. {
  134. #ifdef _DEBUG
  135. m_bPIXELFOGTYPE = true;
  136. #endif // _DEBUG
  137. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  138. #ifdef _DEBUG
  139. m_bWRITE_DEPTH_TO_DESTALPHA = false;
  140. #endif // _DEBUG
  141. m_nWRITE_DEPTH_TO_DESTALPHA = 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_bWRITE_DEPTH_TO_DESTALPHA;
  149. Assert( bAllDynamicVarsDefined );
  150. #endif // _DEBUG
  151. return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nWRITE_DEPTH_TO_DESTALPHA ) + 0;
  152. }
  153. };
  154. #define shaderDynamicTest_unlittwotexture_ps20b psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
  155. static const ShaderComboInformation_t s_DynamicComboArray_unlittwotexture_ps20b[2] =
  156. {
  157. { "PIXELFOGTYPE", 0, 1 },
  158. { "WRITE_DEPTH_TO_DESTALPHA", 0, 0 },
  159. };
  160. static const ShaderComboInformation_t s_StaticComboArray_unlittwotexture_ps20b[2] =
  161. {
  162. { "TRANSLUCENT", 0, 1 },
  163. { "LIGHTING_PREVIEW", 0, 0 },
  164. };
  165. static const ShaderComboSemantics_t unlittwotexture_ps20b_combos =
  166. {
  167. "unlittwotexture_ps20b", s_DynamicComboArray_unlittwotexture_ps20b, 2, s_StaticComboArray_unlittwotexture_ps20b, 2
  168. };
  169. class ConstructMe_unlittwotexture_ps20b
  170. {
  171. public:
  172. ConstructMe_unlittwotexture_ps20b()
  173. {
  174. GetShaderDLL()->AddShaderComboInformation( &unlittwotexture_ps20b_combos );
  175. }
  176. };
  177. static ConstructMe_unlittwotexture_ps20b s_ConstructMe_unlittwotexture_ps20b;