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.

76 lines
1.7 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #include "BaseVSShader.h"
  8. #include "morphweight_vs30.inc"
  9. #include "morphweight_ps30.inc"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. //#define V1 1
  13. DEFINE_FALLBACK_SHADER( MorphWeight, MorphWeight_DX9 )
  14. BEGIN_VS_SHADER_FLAGS( MorphWeight_DX9, "Help for morphweight", SHADER_NOT_EDITABLE )
  15. BEGIN_SHADER_PARAMS
  16. END_SHADER_PARAMS
  17. SHADER_INIT_PARAMS()
  18. {
  19. }
  20. SHADER_FALLBACK
  21. {
  22. if ( !g_pHardwareConfig->SupportsPixelShaders_3_0() )
  23. {
  24. return "Wireframe";
  25. }
  26. return 0;
  27. }
  28. SHADER_INIT
  29. {
  30. }
  31. SHADER_DRAW
  32. {
  33. SHADOW_STATE
  34. {
  35. pShaderShadow->EnableDepthTest( false );
  36. pShaderShadow->EnableDepthWrites( false );
  37. pShaderShadow->EnableAlphaWrites( true );
  38. pShaderShadow->EnableCulling( false );
  39. pShaderShadow->FogMode( SHADER_FOGMODE_DISABLED, false );
  40. DECLARE_STATIC_VERTEX_SHADER( morphweight_vs30 );
  41. SET_STATIC_VERTEX_SHADER( morphweight_vs30 );
  42. DECLARE_STATIC_PIXEL_SHADER( morphweight_ps30 );
  43. SET_STATIC_PIXEL_SHADER( morphweight_ps30 );
  44. // Texcoord0 is the texcoord to write the weights into
  45. // Texcoord1 contains the morph weights
  46. int pTexCoord[2] = { 2, 4 };
  47. pShaderShadow->VertexShaderVertexFormat( VERTEX_FORMAT_USE_EXACT_FORMAT, 2, pTexCoord, 0 );
  48. }
  49. DYNAMIC_STATE
  50. {
  51. DECLARE_DYNAMIC_VERTEX_SHADER( morphweight_vs30 );
  52. SET_DYNAMIC_VERTEX_SHADER( morphweight_vs30 );
  53. DECLARE_DYNAMIC_PIXEL_SHADER( morphweight_ps30 );
  54. SET_DYNAMIC_PIXEL_SHADER( morphweight_ps30 );
  55. }
  56. Draw();
  57. }
  58. END_SHADER