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.

85 lines
2.6 KiB

  1. //========= Copyright � 1996-2006, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Multiblending shader for Spy in TF2 (and probably many other things to come)
  4. //
  5. // $NoKeywords: $
  6. //=====================================================================================//
  7. #include "BaseVSShader.h"
  8. #include "convar.h"
  9. #include "multiblend_dx9_helper.h"
  10. // NOTE: This has to be the last file included!
  11. #include "tier0/memdbgon.h"
  12. DEFINE_FALLBACK_SHADER( Multiblend, Multiblend_DX90 )
  13. BEGIN_VS_SHADER( Multiblend_DX90, "Help for Multiblend" )
  14. BEGIN_SHADER_PARAMS
  15. SHADER_PARAM( SPECTEXTURE, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  16. SHADER_PARAM( BASETEXTURE2, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  17. SHADER_PARAM( SPECTEXTURE2, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  18. SHADER_PARAM( BASETEXTURE3, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  19. SHADER_PARAM( SPECTEXTURE3, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  20. SHADER_PARAM( BASETEXTURE4, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  21. SHADER_PARAM( SPECTEXTURE4, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  22. SHADER_PARAM( ROTATION, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
  23. SHADER_PARAM( SCALE, SHADER_PARAM_TYPE_FLOAT, "1.0", "" )
  24. SHADER_PARAM( ROTATION2, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
  25. SHADER_PARAM( SCALE2, SHADER_PARAM_TYPE_FLOAT, "1.0", "" )
  26. SHADER_PARAM( ROTATION3, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
  27. SHADER_PARAM( SCALE3, SHADER_PARAM_TYPE_FLOAT, "1.0", "" )
  28. SHADER_PARAM( ROTATION4, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
  29. SHADER_PARAM( SCALE4, SHADER_PARAM_TYPE_FLOAT, "1.0", "" )
  30. END_SHADER_PARAMS
  31. void SetupVars( Multiblend_DX9_Vars_t& info )
  32. {
  33. info.m_nBaseTextureTransform = BASETEXTURETRANSFORM;
  34. info.m_nBaseTexture = BASETEXTURE;
  35. info.m_nSpecTexture = SPECTEXTURE;
  36. info.m_nBaseTexture2 = BASETEXTURE2;
  37. info.m_nSpecTexture2 = SPECTEXTURE2;
  38. info.m_nBaseTexture3 = BASETEXTURE3;
  39. info.m_nSpecTexture3 = SPECTEXTURE3;
  40. info.m_nBaseTexture4 = BASETEXTURE4;
  41. info.m_nSpecTexture4 = SPECTEXTURE4;
  42. info.m_nRotation = ROTATION;
  43. info.m_nRotation2 = ROTATION2;
  44. info.m_nRotation3 = ROTATION3;
  45. info.m_nRotation4 = ROTATION4;
  46. info.m_nScale = SCALE;
  47. info.m_nScale2 = SCALE2;
  48. info.m_nScale3 = SCALE3;
  49. info.m_nScale4 = SCALE4;
  50. }
  51. SHADER_INIT_PARAMS()
  52. {
  53. Multiblend_DX9_Vars_t info;
  54. SetupVars( info );
  55. InitParamsMultiblend_DX9( this, params, pMaterialName, info );
  56. }
  57. SHADER_FALLBACK
  58. {
  59. return 0;
  60. }
  61. SHADER_INIT
  62. {
  63. Multiblend_DX9_Vars_t info;
  64. SetupVars( info );
  65. InitMultiblend_DX9( this, params, info );
  66. }
  67. SHADER_DRAW
  68. {
  69. Multiblend_DX9_Vars_t info;
  70. SetupVars( info );
  71. DrawMultiblend_DX9( this, params, pShaderAPI, pShaderShadow, info, vertexCompression );
  72. }
  73. END_SHADER