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.

202 lines
5.2 KiB

  1. //========= Copyright (c) 1996-2007, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef VERTEXLITGENERIC_DX9_HELPER_H
  8. #define VERTEXLITGENERIC_DX9_HELPER_H
  9. #include <string.h>
  10. //-----------------------------------------------------------------------------
  11. // Forward declarations
  12. //-----------------------------------------------------------------------------
  13. class CBaseVSShader;
  14. class IMaterialVar;
  15. class IShaderDynamicAPI;
  16. class IShaderShadow;
  17. //-----------------------------------------------------------------------------
  18. // Init params/ init/ draw methods
  19. //-----------------------------------------------------------------------------
  20. struct VertexLitGeneric_DX9_Vars_t
  21. {
  22. VertexLitGeneric_DX9_Vars_t() { memset( this, 0xFF, sizeof(*this) ); }
  23. int m_nBaseTexture;
  24. int m_nWrinkle;
  25. int m_nStretch;
  26. int m_nBaseTextureFrame;
  27. int m_nBaseTextureTransform;
  28. int m_nAlbedo;
  29. int m_nDetail;
  30. int m_nDetailFrame;
  31. int m_nDetailScale;
  32. int m_nEnvmap;
  33. int m_nEnvmapFrame;
  34. int m_nEnvmapMask;
  35. int m_nEnvmapMaskFrame;
  36. int m_nEnvmapMaskTransform;
  37. int m_nEnvmapTint;
  38. int m_nBumpmap;
  39. int m_nNormalWrinkle;
  40. int m_nNormalStretch;
  41. int m_nBumpFrame;
  42. int m_nBumpTransform;
  43. int m_nEnvmapContrast;
  44. int m_nEnvmapSaturation;
  45. int m_nAlphaTestReference;
  46. int m_nAllowFenceRenderStateHack;
  47. int m_nVertexAlphaTest;
  48. int m_nFlashlightNoLambert;
  49. int m_nLowQualityFlashlightShadows;
  50. int m_nFlashlightTexture;
  51. int m_nFlashlightTextureFrame;
  52. int m_nDisableCSMLookup;
  53. int m_nSelfIllumTint;
  54. int m_nSelfIllumFresnel;
  55. int m_nSelfIllumFresnelMinMaxExp;
  56. int m_nSelfIllumMaskScale;
  57. int m_nSelfIllumFresnelEnabledThisFrame;
  58. int m_nPhongExponent;
  59. int m_nPhongTint;
  60. int m_nPhongAlbedoTint;
  61. int m_nPhongExponentTexture;
  62. int m_nDiffuseWarpTexture;
  63. int m_nPhongWarpTexture;
  64. int m_nPhongBoost;
  65. int m_nPhongAlbedoBoost;
  66. int m_nPhongFresnelRanges;
  67. int m_nSelfIllumEnvMapMask_Alpha;
  68. int m_nAmbientOnly;
  69. int m_nHDRColorScale;
  70. int m_nPhong;
  71. int m_nForcePhong;
  72. int m_nBaseMapAlphaPhongMask;
  73. int m_nBaseMapLuminancePhongMask;
  74. int m_nEnvmapFresnel;
  75. int m_nDetailTextureCombineMode;
  76. int m_nDetailTextureBlendFactor;
  77. // Rim lighting parameters
  78. int m_nRimLight;
  79. int m_nRimLightPower;
  80. int m_nRimLightBoost;
  81. int m_nRimMask;
  82. int m_nSeamlessScale;
  83. int m_nSeamlessBase;
  84. int m_nSeamlessDetail;
  85. // distance coded line art parameters
  86. int m_nDistanceAlpha;
  87. int m_nDistanceAlphaFromDetail;
  88. int m_nSoftEdges;
  89. int m_nEdgeSoftnessStart;
  90. int m_nEdgeSoftnessEnd;
  91. int m_nScaleEdgeSoftnessBasedOnScreenRes;
  92. int m_nGlow;
  93. int m_nGlowColor;
  94. int m_nGlowAlpha;
  95. int m_nGlowStart;
  96. int m_nGlowEnd;
  97. int m_nGlowX;
  98. int m_nGlowY;
  99. int m_nOutline;
  100. int m_nOutlineColor;
  101. int m_nOutlineAlpha;
  102. int m_nOutlineStart0;
  103. int m_nOutlineStart1;
  104. int m_nOutlineEnd0;
  105. int m_nOutlineEnd1;
  106. int m_nScaleOutlineSoftnessBasedOnScreenRes;
  107. int m_nSeparateDetailUVs;
  108. int m_nDetailTextureTransform;
  109. int m_nLinearWrite;
  110. int m_nGammaColorRead;
  111. int m_nDetailTint;
  112. int m_nInvertPhongMask;
  113. int m_nSelfIllumMask;
  114. int m_nReceiveFlashlight;
  115. int m_nSinglePassFlashlight;
  116. int m_nShaderSrgbRead360;
  117. int m_nAmbientOcclusion;
  118. int m_nBlendTintByBaseAlpha;
  119. int m_nNoTint;
  120. int m_nDesaturateWithBaseAlpha;
  121. int m_nAllowDiffuseModulation;
  122. int m_nEnvMapFresnelMinMaxExp;
  123. int m_nBaseAlphaEnvMapMaskMinMaxExp;
  124. int m_nDisplacementMap;
  125. int m_nDisplacementWrinkleMap;
  126. int m_nPhongDisableHalfLambert;
  127. int m_nTreeSway;
  128. int m_nTreeSwayHeight;
  129. int m_nTreeSwayStartHeight;
  130. int m_nTreeSwayRadius;
  131. int m_nTreeSwayStartRadius;
  132. int m_nTreeSwaySpeed;
  133. int m_nTreeSwaySpeedHighWindMultiplier;
  134. int m_nTreeSwayStrength;
  135. int m_nTreeSwayScrumbleSpeed;
  136. int m_nTreeSwayScrumbleStrength;
  137. int m_nTreeSwayScrumbleFrequency;
  138. int m_nTreeSwayFalloffExp;
  139. int m_nTreeSwayScrumbleFalloffExp;
  140. int m_nTreeSwaySpeedLerpStart;
  141. int m_nTreeSwaySpeedLerpEnd;
  142. int m_nTreeSwayStatic;
  143. int m_nDecalTexture;
  144. int m_nDecalTextureCombineMode;
  145. int m_nEnvMapLightScale;
  146. int m_nEnvMapLightScaleMinMax;
  147. int m_nBlendWithSmokeGrenade;
  148. int m_nBlendWithSmokeGrenadePosEntity;
  149. int m_nBlendWithSmokeGrenadePosSmoke;
  150. int m_nModelDecalIgnoreZ;
  151. int m_nTintMaskTexture;
  152. int m_nEnvMapMaskInTintMaskTexture;
  153. };
  154. void InitParamsVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info );
  155. void InitVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info );
  156. void DrawVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI *pShaderAPI, IShaderShadow* pShaderShadow,
  157. bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info, VertexCompressionType_t vertexCompression,
  158. CBasePerMaterialContextData **pContextDataPtr );
  159. void DrawVertexLitGeneric_DX9_ExecuteFastPath( int *vsDynIndex, int *psDynIndex,
  160. CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI * pShaderAPI,
  161. VertexLitGeneric_DX9_Vars_t &info,
  162. VertexCompressionType_t vertexCompression, CBasePerMaterialContextData **pContextDataPtr,
  163. BOOL bCSMEnabled, BOOL bVertexLitGeneric = true );
  164. #endif // VERTEXLITGENERIC_DX9_HELPER_H