Team Fortress 2 Source Code as on 22/4/2020
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.

145 lines
3.6 KiB

  1. //========= Copyright Valve Corporation, 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_nVertexAlphaTest;
  47. int m_nFlashlightNoLambert;
  48. int m_nFlashlightTexture;
  49. int m_nFlashlightTextureFrame;
  50. int m_nLightmap;
  51. int m_nSelfIllumTint;
  52. int m_nSelfIllumFresnel;
  53. int m_nSelfIllumFresnelMinMaxExp;
  54. int m_nPhongExponent;
  55. int m_nPhongTint;
  56. int m_nPhongAlbedoTint;
  57. int m_nPhongExponentTexture;
  58. int m_nDiffuseWarpTexture;
  59. int m_nPhongWarpTexture;
  60. int m_nPhongBoost;
  61. int m_nPhongFresnelRanges;
  62. int m_nPhongExponentFactor;
  63. int m_nSelfIllumEnvMapMask_Alpha;
  64. int m_nAmbientOnly;
  65. int m_nHDRColorScale;
  66. int m_nPhong;
  67. int m_nBaseMapAlphaPhongMask;
  68. int m_nEnvmapFresnel;
  69. int m_nDetailTextureCombineMode;
  70. int m_nDetailTextureBlendFactor;
  71. // Rim lighting parameters
  72. int m_nRimLight;
  73. int m_nRimLightPower;
  74. int m_nRimLightBoost;
  75. int m_nRimMask;
  76. int m_nSeamlessScale;
  77. int m_nSeamlessBase;
  78. int m_nSeamlessDetail;
  79. // distance coded line art parameters
  80. int m_nDistanceAlpha;
  81. int m_nDistanceAlphaFromDetail;
  82. int m_nSoftEdges;
  83. int m_nEdgeSoftnessStart;
  84. int m_nEdgeSoftnessEnd;
  85. int m_nScaleEdgeSoftnessBasedOnScreenRes;
  86. int m_nGlow;
  87. int m_nGlowColor;
  88. int m_nGlowAlpha;
  89. int m_nGlowStart;
  90. int m_nGlowEnd;
  91. int m_nGlowX;
  92. int m_nGlowY;
  93. int m_nOutline;
  94. int m_nOutlineColor;
  95. int m_nOutlineAlpha;
  96. int m_nOutlineStart0;
  97. int m_nOutlineStart1;
  98. int m_nOutlineEnd0;
  99. int m_nOutlineEnd1;
  100. int m_nScaleOutlineSoftnessBasedOnScreenRes;
  101. int m_nSeparateDetailUVs;
  102. int m_nDetailTextureTransform;
  103. int m_nLinearWrite;
  104. int m_nGammaColorRead;
  105. int m_nDetailTint;
  106. int m_nInvertPhongMask;
  107. int m_nDepthBlend;
  108. int m_nDepthBlendScale;
  109. int m_nSelfIllumMask;
  110. int m_nReceiveFlashlight;
  111. int m_nBlendTintByBaseAlpha;
  112. int m_nTintReplacesBaseColor;
  113. };
  114. void InitParamsVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info );
  115. void InitVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info );
  116. void DrawVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI *pShaderAPI, IShaderShadow* pShaderShadow,
  117. bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info, VertexCompressionType_t vertexCompression,
  118. CBasePerMaterialContextData **pContextDataPtr
  119. );
  120. #endif // VERTEXLITGENERIC_DX9_HELPER_H