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.

67 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "BaseVSShader.h"
  8. #include "screenspaceeffect_vs20.inc"
  9. #include "hsv_ps20.inc"
  10. #include "hsv_ps20b.inc"
  11. BEGIN_VS_SHADER_FLAGS( HSV, "Help for HSV", SHADER_NOT_EDITABLE )
  12. BEGIN_SHADER_PARAMS
  13. END_SHADER_PARAMS
  14. SHADER_INIT_PARAMS()
  15. {
  16. SET_FLAGS2( MATERIAL_VAR2_NEEDS_FULL_FRAME_BUFFER_TEXTURE );
  17. }
  18. SHADER_INIT
  19. {
  20. }
  21. SHADER_FALLBACK
  22. {
  23. // Requires DX9 + above
  24. if (g_pHardwareConfig->GetDXSupportLevel() < 90)
  25. {
  26. Assert( 0 );
  27. return "Wireframe";
  28. }
  29. return 0;
  30. }
  31. SHADER_DRAW
  32. {
  33. SHADOW_STATE
  34. {
  35. pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
  36. int fmt = VERTEX_POSITION;
  37. pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0 );
  38. DECLARE_STATIC_VERTEX_SHADER( screenspaceeffect_vs20 );
  39. SET_STATIC_VERTEX_SHADER( screenspaceeffect_vs20 );
  40. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  41. {
  42. DECLARE_STATIC_PIXEL_SHADER( hsv_ps20b );
  43. SET_STATIC_PIXEL_SHADER( hsv_ps20b );
  44. }
  45. else
  46. {
  47. DECLARE_STATIC_PIXEL_SHADER( hsv_ps20 );
  48. SET_STATIC_PIXEL_SHADER( hsv_ps20 );
  49. }
  50. }
  51. DYNAMIC_STATE
  52. {
  53. pShaderAPI->BindStandardTexture( SHADER_SAMPLER0, TEXTURE_FRAME_BUFFER_FULL_TEXTURE_0 );
  54. DECLARE_DYNAMIC_VERTEX_SHADER( screenspaceeffect_vs20 );
  55. SET_DYNAMIC_VERTEX_SHADER( screenspaceeffect_vs20 );
  56. }
  57. Draw();
  58. }
  59. END_SHADER