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.

53 lines
1.4 KiB

  1. //========= Copyright � 1996-2006, Valve Corporation, All rights reserved. ============//
  2. #include "BaseVSShader.h"
  3. #include "volume_clouds_helper.h"
  4. // memdbgon must be the last include file in a .cpp file!!!
  5. #include "tier0/memdbgon.h"
  6. DEFINE_FALLBACK_SHADER( VolumeClouds, VolumeClouds_dx9 )
  7. BEGIN_VS_SHADER( VolumeClouds_dx9, "VolumeClouds" )
  8. BEGIN_SHADER_PARAMS
  9. SHADER_PARAM( REFRACTAMOUNT, SHADER_PARAM_TYPE_FLOAT, "2", "" )
  10. SHADER_PARAM( BASETEXTURE, SHADER_PARAM_TYPE_TEXTURE, "", "Texture 1" )
  11. SHADER_PARAM( BASETEXTURE2, SHADER_PARAM_TYPE_TEXTURE, "", "Texture 2" )
  12. SHADER_PARAM( BASETEXTURE3, SHADER_PARAM_TYPE_TEXTURE, "", "Texture 3" )
  13. SHADER_PARAM( TIME, SHADER_PARAM_TYPE_FLOAT, "0.0", "Needs CurrentTime Proxy" )
  14. END_SHADER_PARAMS
  15. void SetupVarsVolumeClouds( VolumeCloudsVars_t &info )
  16. {
  17. info.m_nRefractAmount = REFRACTAMOUNT;
  18. info.m_nTexture1 = BASETEXTURE;
  19. info.m_nTexture2 = BASETEXTURE2;
  20. info.m_nTexture3 = BASETEXTURE3;
  21. info.m_nTime = TIME;
  22. }
  23. SHADER_INIT_PARAMS()
  24. {
  25. VolumeCloudsVars_t info;
  26. SetupVarsVolumeClouds( info );
  27. InitParamsVolumeClouds( this, params, pMaterialName, info );
  28. }
  29. SHADER_FALLBACK
  30. {
  31. return 0;
  32. }
  33. SHADER_INIT
  34. {
  35. VolumeCloudsVars_t info;
  36. SetupVarsVolumeClouds( info );
  37. InitVolumeClouds( this, params, info );
  38. }
  39. SHADER_DRAW
  40. {
  41. VolumeCloudsVars_t info;
  42. SetupVarsVolumeClouds( info );
  43. DrawVolumeClouds( this, params, pShaderAPI, pShaderShadow, info, vertexCompression );
  44. }
  45. END_SHADER