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.

76 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. #include "BaseVSShader.h"
  3. #include "aftershock_helper.h"
  4. // memdbgon must be the last include file in a .cpp file!!!
  5. #include "tier0/memdbgon.h"
  6. DEFINE_FALLBACK_SHADER( Aftershock, Aftershock_dx9 )
  7. BEGIN_VS_SHADER( Aftershock_dx9, "Aftershock" )
  8. BEGIN_SHADER_PARAMS
  9. SHADER_PARAM( COLORTINT, SHADER_PARAM_TYPE_COLOR, "[1 1 1]", "Color tint" )
  10. SHADER_PARAM( REFRACTAMOUNT, SHADER_PARAM_TYPE_FLOAT, "2", "" )
  11. SHADER_PARAM( NORMALMAP, SHADER_PARAM_TYPE_TEXTURE, "models/shadertest/shader1_normal", "normal map" )
  12. SHADER_PARAM( BUMPFRAME, SHADER_PARAM_TYPE_INTEGER, "0", "frame number for $bumpmap" )
  13. SHADER_PARAM( BUMPTRANSFORM, SHADER_PARAM_TYPE_MATRIX, "center .5 .5 scale 1 1 rotate 0 translate 0 0", "$bumpmap texcoord transform" )
  14. SHADER_PARAM( SILHOUETTETHICKNESS, SHADER_PARAM_TYPE_FLOAT, "1", "" )
  15. SHADER_PARAM( SILHOUETTECOLOR, SHADER_PARAM_TYPE_COLOR, "[1 1 1]", "Silhouette color tint" )
  16. SHADER_PARAM( GROUNDMIN, SHADER_PARAM_TYPE_FLOAT, "1", "" )
  17. SHADER_PARAM( GROUNDMAX, SHADER_PARAM_TYPE_FLOAT, "1", "" )
  18. SHADER_PARAM( BLURAMOUNT, SHADER_PARAM_TYPE_FLOAT, "1", "" )
  19. SHADER_PARAM( TIME, SHADER_PARAM_TYPE_FLOAT, "0.0", "Needs CurrentTime Proxy" )
  20. END_SHADER_PARAMS
  21. void SetupVarsAftershock( AftershockVars_t &info )
  22. {
  23. info.m_nColorTint = COLORTINT;
  24. info.m_nRefractAmount = REFRACTAMOUNT;
  25. info.m_nBumpmap = NORMALMAP;
  26. info.m_nBumpFrame = BUMPFRAME;
  27. info.m_nBumpTransform = BUMPTRANSFORM;
  28. info.m_nSilhouetteThickness = SILHOUETTETHICKNESS;
  29. info.m_nSilhouetteColor = SILHOUETTECOLOR;
  30. info.m_nGroundMin = GROUNDMIN;
  31. info.m_nGroundMax = GROUNDMAX;
  32. info.m_nBlurAmount = BLURAMOUNT;
  33. info.m_nTime = TIME;
  34. }
  35. SHADER_INIT_PARAMS()
  36. {
  37. AftershockVars_t info;
  38. SetupVarsAftershock( info );
  39. InitParamsAftershock( this, params, pMaterialName, info );
  40. }
  41. SHADER_FALLBACK
  42. {
  43. if ( g_pHardwareConfig->GetDXSupportLevel() < 90 )
  44. {
  45. return "Aftershock_dx8";
  46. }
  47. return 0;
  48. }
  49. SHADER_INIT
  50. {
  51. AftershockVars_t info;
  52. SetupVarsAftershock( info );
  53. InitAftershock( this, params, info );
  54. }
  55. SHADER_DRAW
  56. {
  57. AftershockVars_t info;
  58. SetupVarsAftershock( info );
  59. DrawAftershock( this, params, pShaderAPI, pShaderShadow, info, vertexCompression );
  60. }
  61. END_SHADER