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.

69 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. #ifndef EYE_REFRACT_HELPER_H
  3. #define EYE_REFRACT_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. // Init params/ init/ draw methods
  17. //-----------------------------------------------------------------------------
  18. struct Eye_Refract_Vars_t
  19. {
  20. Eye_Refract_Vars_t() { memset( this, 0xFF, sizeof(Eye_Refract_Vars_t) ); }
  21. int m_nFrame;
  22. int m_nIris;
  23. int m_nIrisFrame;
  24. int m_nEyeOrigin;
  25. int m_nIrisU;
  26. int m_nIrisV;
  27. int m_nDilation;
  28. int m_nGlossiness;
  29. int m_nIntro;
  30. int m_nEntityOrigin; // Needed for intro
  31. int m_nWarpParam;
  32. int m_nCorneaTexture;
  33. int m_nAmbientOcclTexture;
  34. int m_nEnvmap;
  35. int m_nSphereTexKillCombo;
  36. int m_nRaytraceSphere;
  37. int m_nParallaxStrength;
  38. int m_nCorneaBumpStrength;
  39. int m_nAmbientOcclColor;
  40. int m_nEyeballRadius;
  41. int m_nDiffuseWarpTexture;
  42. };
  43. // Default values (Arrays should only be vec[4])
  44. static const int kDefaultIntro = 0;
  45. static const float kDefaultEyeOrigin[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
  46. static const float kDefaultIrisU[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
  47. static const float kDefaultIrisV[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
  48. static const float kDefaultDilation = 0.5f;
  49. static const float kDefaultGlossiness = 1.0f;
  50. static const float kDefaultWarpParam = 0.0f;
  51. static const int kDefaultSphereTexKillCombo = 0;
  52. static const int kDefaultRaytraceSphere = 0;
  53. static const float kDefaultParallaxStrength = 0.25f;
  54. static const float kDefaultCorneaBumpStrength = 1.0f;
  55. static const float kDefaultAmbientOcclColor[4] = { 0.33f, 0.33f, 0.33f, 0.0f };
  56. static const float kDefaultEyeballRadius = 0.5f;
  57. void InitParams_Eyes_Refract( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, Eye_Refract_Vars_t &info );
  58. void Init_Eyes_Refract( CBaseVSShader *pShader, IMaterialVar** params, Eye_Refract_Vars_t &info );
  59. void Draw_Eyes_Refract( CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI *pShaderAPI,
  60. IShaderShadow* pShaderShadow, Eye_Refract_Vars_t &info, VertexCompressionType_t vertexCompression );
  61. #endif // EYES_DX8_DX9_HELPER_H