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.

97 lines
3.1 KiB

  1. //========= Copyright � 1996-2007, Valve Corporation, All rights reserved. ============//
  2. #ifndef ICESURFACE_HELPER_H
  3. #define ICESURFACE_HELPER_H
  4. #ifdef _WIN32
  5. #pragma once
  6. #endif
  7. #include <string.h>
  8. //-----------------------------------------------------------------------------
  9. // Forward declarations
  10. //-----------------------------------------------------------------------------
  11. class CBaseVSShader;
  12. class IMaterialVar;
  13. class IShaderDynamicAPI;
  14. class IShaderShadow;
  15. //-----------------------------------------------------------------------------
  16. // Struct to hold shader param indices
  17. //-----------------------------------------------------------------------------
  18. struct PaintBlobVars_t
  19. {
  20. PaintBlobVars_t()
  21. {
  22. memset( this, 0xFF, sizeof( PaintBlobVars_t ) );
  23. }
  24. int m_nBackSurface;
  25. int m_nBumpStrength;
  26. int m_nFresnelBumpStrength;
  27. int m_nNormalMap;
  28. int m_nBaseTexture;
  29. int m_nLightWarpTexture;
  30. int m_nFresnelWarpTexture;
  31. int m_nOpacityTexture;
  32. int m_nSpecMap;
  33. int m_nUVScale;
  34. int m_nEnvMap;
  35. int m_nInteriorEnable;
  36. int m_nInteriorFogStrength;
  37. int m_nInteriorBackgroundBoost;
  38. int m_nInteriorAmbientScale;
  39. int m_nInteriorBackLightScale;
  40. int m_nInteriorRefractStrength;
  41. int m_nFresnelParams;
  42. int m_nDiffuseScale;
  43. int m_nSpecExp;
  44. int m_nSpecScale;
  45. int m_nSpecExp2;
  46. int m_nSpecScale2;
  47. int m_nRimLightExp;
  48. int m_nRimLightScale;
  49. int m_nBaseColorTint;
  50. int m_nUVProjOffset;
  51. int m_nBBMin;
  52. int m_nBBMax;
  53. int m_nFlashlightTexture;
  54. int m_nFlashlightTextureFrame;
  55. int m_nBumpFrame;
  56. int m_nContactShadows;
  57. };
  58. // default shader param values
  59. static const int kDefaultBackSurface = 0;
  60. static const float kDefaultBumpStrength = 1.0f;
  61. static const float kDefaultFresnelBumpStrength = 1.0f;
  62. static const float kDefaultUVScale = 0.02f;
  63. static const int kDefaultInteriorEnable = 1;
  64. static const float kDefaultInteriorFogStrength = 0.06f;
  65. static const float kDefaultInteriorBackgroundBoost = 0.0f;
  66. static const float kDefaultInteriorAmbientScale = 0.3f;
  67. static const float kDefaultInteriorBackLightScale = 0.3f;
  68. static const float kDefaultInteriorRefractStrength = 0.015f;
  69. static const float kDefaultFresnelParams[3] = { 0.0f, 0.5f, 2.0f };
  70. static const float kDefaultBaseColorTint[3] = { 1.0f, 1.0f, 1.0f };
  71. static const float kDefaultDiffuseScale = 1.0f;
  72. static const float kDefaultSpecExp = 1.0f;
  73. static const float kDefaultSpecScale = 1.0f;
  74. static const float kDefaultRimLightExp = 10.0f;
  75. static const float kDefaultRimLightScale = 1.0f;
  76. static const float kDefaultUVProjOffset[3] = { 0.0f, 0.0f, 0.0f };
  77. static const float kDefaultBB[3] = { 0.0f, 0.0f, 0.0f };
  78. static const int kDefaultBumpFrame = 0;
  79. static const int kDefaultContactShadows = 0;
  80. void InitParamsPaintBlob( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, PaintBlobVars_t &info );
  81. void InitPaintBlob( CBaseVSShader *pShader, IMaterialVar** params, PaintBlobVars_t &info );
  82. void DrawPaintBlob( CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI *pShaderAPI,
  83. IShaderShadow* pShaderShadow, PaintBlobVars_t &info, VertexCompressionType_t vertexCompression );
  84. #endif // ICESURFACE_HELPER_H