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.

71 lines
2.2 KiB

  1. //========= Copyright (c) 1996-2006, 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. return 0;
  44. }
  45. SHADER_INIT
  46. {
  47. AftershockVars_t info;
  48. SetupVarsAftershock( info );
  49. InitAftershock( this, params, info );
  50. }
  51. SHADER_DRAW
  52. {
  53. AftershockVars_t info;
  54. SetupVarsAftershock( info );
  55. DrawAftershock( this, params, pShaderAPI, pShaderShadow, info, vertexCompression );
  56. }
  57. END_SHADER