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.

154 lines
4.3 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_ps20_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_ps20_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_ps20 psh_forgot_to_set_static_TRANSLUCENT + psh_forgot_to_set_static_LIGHTING_PREVIEW + 0
  84. class unlittwotexture_ps20_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. public:
  109. // CONSTRUCTOR
  110. unlittwotexture_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  111. {
  112. #ifdef _DEBUG
  113. m_bPIXELFOGTYPE = true;
  114. #endif // _DEBUG
  115. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  116. }
  117. int GetIndex()
  118. {
  119. // Asserts to make sure that we aren't using any skipped combinations.
  120. // Asserts to make sure that we are setting all of the combination vars.
  121. #ifdef _DEBUG
  122. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  123. Assert( bAllDynamicVarsDefined );
  124. #endif // _DEBUG
  125. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  126. }
  127. };
  128. #define shaderDynamicTest_unlittwotexture_ps20 0
  129. static const ShaderComboInformation_t s_DynamicComboArray_unlittwotexture_ps20[1] =
  130. {
  131. { "PIXELFOGTYPE", 0, 1 },
  132. };
  133. static const ShaderComboInformation_t s_StaticComboArray_unlittwotexture_ps20[2] =
  134. {
  135. { "TRANSLUCENT", 0, 1 },
  136. { "LIGHTING_PREVIEW", 0, 0 },
  137. };
  138. static const ShaderComboSemantics_t unlittwotexture_ps20_combos =
  139. {
  140. "unlittwotexture_ps20", s_DynamicComboArray_unlittwotexture_ps20, 1, s_StaticComboArray_unlittwotexture_ps20, 2
  141. };
  142. class ConstructMe_unlittwotexture_ps20
  143. {
  144. public:
  145. ConstructMe_unlittwotexture_ps20()
  146. {
  147. GetShaderDLL()->AddShaderComboInformation( &unlittwotexture_ps20_combos );
  148. }
  149. };
  150. static ConstructMe_unlittwotexture_ps20 s_ConstructMe_unlittwotexture_ps20;