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.

96 lines
3.0 KiB

  1. //========= Copyright � Valve Corporation, All rights reserved. ============//
  2. #ifndef SOLIDENERGY_HELPER_H
  3. #define SOLIDENERGY_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 SolidEnergyVars_t
  19. {
  20. SolidEnergyVars_t()
  21. {
  22. memset( this, 0xFF, sizeof( SolidEnergyVars_t ) );
  23. }
  24. int m_nBaseTexture;
  25. int m_nBaseTextureTransform;
  26. int m_nDetail1Texture;
  27. int m_nDetail1Scale;
  28. int m_nDetail1Frame;
  29. int m_nDetail1BlendMode;
  30. int m_nDetail1TextureTransform;
  31. int m_nDetail2Texture;
  32. int m_nDetail2Scale;
  33. int m_nDetail2Frame;
  34. int m_nDetail2BlendMode;
  35. int m_nDetail2TextureTransform;
  36. int m_nTangentTOpacityRanges;
  37. int m_nTangentSOpacityRanges;
  38. int m_nFresnelOpacityRanges;
  39. int m_nNeedsTangentT;
  40. int m_nNeedsTangentS;
  41. int m_nNeedsNormals;
  42. int m_nDepthBlend;
  43. int m_nDepthBlendScale;
  44. int m_nFlowMap;
  45. int m_nFlowMapFrame;
  46. int m_nFlowMapScrollRate;
  47. int m_nFlowNoiseTexture;
  48. int m_nTime;
  49. int m_nFlowWorldUVScale;
  50. int m_nFlowNormalUVScale;
  51. int m_nFlowTimeIntervalInSeconds;
  52. int m_nFlowUVScrollDistance;
  53. int m_nFlowNoiseScale;
  54. int m_nFlowLerpExp;
  55. int m_nFlowBoundsTexture;
  56. int m_nPowerUp;
  57. int m_nFlowColorIntensity;
  58. int m_nFlowColor;
  59. int m_nFlowVortexColor;
  60. int m_nFlowVortexSize;
  61. int m_nFlowVortex1;
  62. int m_nFlowVortexPos1;
  63. int m_nFlowVortex2;
  64. int m_nFlowVortexPos2;
  65. int m_nFlowCheap;
  66. int m_nModel;
  67. int m_nOutputIntensity;
  68. };
  69. // default shader param values
  70. static const float kDefaultDetailScale = 1.0f;
  71. static const int kDefaultDetailFrame = 0;
  72. static const int kDefaultDetailBlendMode = 0;
  73. static const int kMaxDetailBlendMode = 1;
  74. static const float kDefaultFalloffRanges[4] = { 1.0f, 0.9f, 0.0f, 0.7f };
  75. static const float kDefaultDepthBlendScale = 50.0;
  76. static const float kDefaultTimescale = 0.4f;
  77. static const float kDefaultScrollDist = 0.2f;
  78. static const float kDefaultNoiseScale = 0.0002f;
  79. static const float kDefaultPowerUpIntensity = 1.0f;
  80. static const float kDefaultVortexSize = 30.0f;
  81. static const float kDefaultFieldColor[3] = { 0.1f, 0.2f, 0.4f };
  82. static const float kDefaultVortexColor[3] = { 1.2f, 0.4f, 0.0f };
  83. static const float kDefaultIntensity = 1.0f;
  84. void InitParamsSolidEnergy( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, SolidEnergyVars_t &info );
  85. void InitSolidEnergy( CBaseVSShader *pShader, IMaterialVar** params, SolidEnergyVars_t &info );
  86. void DrawSolidEnergy( CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI *pShaderAPI,
  87. IShaderShadow* pShaderShadow, SolidEnergyVars_t &info, VertexCompressionType_t vertexCompression,
  88. CBasePerMaterialContextData **pContextDataPtr );
  89. #endif // SOLIDENERGY_HELPER_H