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.2 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 decalmodulate_ps30_Static_Index
  14. {
  15. private:
  16. int m_nVERTEXALPHA;
  17. #ifdef _DEBUG
  18. bool m_bVERTEXALPHA;
  19. #endif
  20. public:
  21. void SetVERTEXALPHA( int i )
  22. {
  23. Assert( i >= 0 && i <= 1 );
  24. m_nVERTEXALPHA = i;
  25. #ifdef _DEBUG
  26. m_bVERTEXALPHA = true;
  27. #endif
  28. }
  29. void SetVERTEXALPHA( bool i )
  30. {
  31. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  32. m_nVERTEXALPHA = i ? 1 : 0;
  33. #ifdef _DEBUG
  34. m_bVERTEXALPHA = true;
  35. #endif
  36. }
  37. private:
  38. int m_nFOGFADE;
  39. #ifdef _DEBUG
  40. bool m_bFOGFADE;
  41. #endif
  42. public:
  43. void SetFOGFADE( int i )
  44. {
  45. Assert( i >= 0 && i <= 1 );
  46. m_nFOGFADE = i;
  47. #ifdef _DEBUG
  48. m_bFOGFADE = true;
  49. #endif
  50. }
  51. void SetFOGFADE( bool i )
  52. {
  53. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  54. m_nFOGFADE = i ? 1 : 0;
  55. #ifdef _DEBUG
  56. m_bFOGFADE = true;
  57. #endif
  58. }
  59. public:
  60. // CONSTRUCTOR
  61. decalmodulate_ps30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  62. {
  63. #ifdef _DEBUG
  64. m_bVERTEXALPHA = false;
  65. #endif // _DEBUG
  66. m_nVERTEXALPHA = 0;
  67. #ifdef _DEBUG
  68. m_bFOGFADE = false;
  69. #endif // _DEBUG
  70. m_nFOGFADE = 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_bVERTEXALPHA && m_bFOGFADE;
  78. Assert( bAllStaticVarsDefined );
  79. #endif // _DEBUG
  80. return ( 2 * m_nVERTEXALPHA ) + ( 4 * m_nFOGFADE ) + 0;
  81. }
  82. };
  83. #define shaderStaticTest_decalmodulate_ps30 psh_forgot_to_set_static_VERTEXALPHA + psh_forgot_to_set_static_FOGFADE + 0
  84. class decalmodulate_ps30_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. decalmodulate_ps30_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_decalmodulate_ps30 0
  129. static const ShaderComboInformation_t s_DynamicComboArray_decalmodulate_ps30[1] =
  130. {
  131. { "PIXELFOGTYPE", 0, 1 },
  132. };
  133. static const ShaderComboInformation_t s_StaticComboArray_decalmodulate_ps30[2] =
  134. {
  135. { "VERTEXALPHA", 0, 1 },
  136. { "FOGFADE", 0, 1 },
  137. };
  138. static const ShaderComboSemantics_t decalmodulate_ps30_combos =
  139. {
  140. "decalmodulate_ps30", s_DynamicComboArray_decalmodulate_ps30, 1, s_StaticComboArray_decalmodulate_ps30, 2
  141. };
  142. class ConstructMe_decalmodulate_ps30
  143. {
  144. public:
  145. ConstructMe_decalmodulate_ps30()
  146. {
  147. GetShaderDLL()->AddShaderComboInformation( &decalmodulate_ps30_combos );
  148. }
  149. };
  150. static ConstructMe_decalmodulate_ps30 s_ConstructMe_decalmodulate_ps30;