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.

107 lines
3.5 KiB

  1. //========= Copyright (c) 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 IceSurfaceVars_t
  19. {
  20. IceSurfaceVars_t()
  21. {
  22. memset( this, 0xFF, sizeof( IceSurfaceVars_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_nInteriorFogLimit;
  38. int m_nInteriorFogNormalBoost;
  39. int m_nInteriorBackgroundBoost;
  40. int m_nInteriorAmbientScale;
  41. int m_nInteriorBackLightScale;
  42. int m_nInteriorColor;
  43. int m_nInteriorRefractStrength;
  44. int m_nInteriorRefractBlur;
  45. int m_nFresnelParams;
  46. int m_nDiffuseScale;
  47. int m_nSpecExp;
  48. int m_nSpecScale;
  49. int m_nSpecExp2;
  50. int m_nSpecScale2;
  51. int m_nRimLightExp;
  52. int m_nRimLightScale;
  53. int m_nBaseColorTint;
  54. int m_nEnvMapTint;
  55. int m_nUVProjOffset;
  56. int m_nBBMin;
  57. int m_nBBMax;
  58. int m_nFlashlightTexture;
  59. int m_nFlashlightTextureFrame;
  60. int m_nBumpFrame;
  61. int m_nContactShadows;
  62. };
  63. // default shader param values
  64. static const int kDefaultBackSurface = 0;
  65. static const float kDefaultBumpStrength = 1.0f;
  66. static const float kDefaultFresnelBumpStrength = 1.0f;
  67. static const float kDefaultUVScale = 0.02f;
  68. static const int kDefaultInteriorEnable = 1;
  69. static const float kDefaultInteriorFogStrength = 0.06f;
  70. static const float kDefaultInteriorFogLimit = 0.8f;
  71. static const float kDefaultInteriorFogNormalBoost = 0.0f;
  72. static const float kDefaultInteriorBackgroundBoost = 0.0f;
  73. static const float kDefaultInteriorAmbientScale = 0.3f;
  74. static const float kDefaultInteriorBackLightScale = 0.3f;
  75. static const float kDefaultInteriorColor[3] = { 0.5f, 0.5f, 0.5f };
  76. static const float kDefaultInteriorRefractStrength = 0.015f;
  77. static const float kDefaultInteriorRefractBlur = 0.2f;
  78. static const float kDefaultFresnelParams[3] = { 0.0f, 0.5f, 2.0f };
  79. static const float kDefaultBaseColorTint[3] = { 1.0f, 1.0f, 1.0f };
  80. static const float kDefaultEnvMapTint[3] = { 1.0f, 1.0f, 1.0f };
  81. static const float kDefaultDiffuseScale = 1.0f;
  82. static const float kDefaultSpecExp = 1.0f;
  83. static const float kDefaultSpecScale = 1.0f;
  84. static const float kDefaultRimLightExp = 10.0f;
  85. static const float kDefaultRimLightScale = 1.0f;
  86. static const float kDefaultUVProjOffset[3] = { 0.0f, 0.0f, 0.0f };
  87. static const float kDefaultBB[3] = { 0.0f, 0.0f, 0.0f };
  88. static const int kDefaultBumpFrame = 0;
  89. static const int kDefaultContactShadows = 0;
  90. void InitParamsIceSurface( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, IceSurfaceVars_t &info );
  91. void InitIceSurface( CBaseVSShader *pShader, IMaterialVar** params, IceSurfaceVars_t &info );
  92. void DrawIceSurface( CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI *pShaderAPI,
  93. IShaderShadow* pShaderShadow, IceSurfaceVars_t &info, VertexCompressionType_t vertexCompression );
  94. #endif // ICESURFACE_HELPER_H