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.

86 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Header: $
  6. // $NoKeywords: $
  7. //===========================================================================//
  8. #include "BaseVSShader.h"
  9. #include "debugmrttexture_ps20.inc"
  10. #include "debugmrttexture_ps20b.inc"
  11. #include "debugmrttexture_vs20.inc"
  12. BEGIN_VS_SHADER_FLAGS( DebugMRTTexture, "Help for DebugMRTTexture", SHADER_NOT_EDITABLE )
  13. BEGIN_SHADER_PARAMS
  14. SHADER_PARAM( MRTINDEX, SHADER_PARAM_TYPE_INTEGER, "", "" )
  15. END_SHADER_PARAMS
  16. SHADER_FALLBACK
  17. {
  18. // if( g_pHardwareConfig->GetDXSupportLevel() < 90 )
  19. // {
  20. // return "UnlitGeneric_DX8";
  21. // }
  22. return 0;
  23. }
  24. SHADER_INIT_PARAMS()
  25. {
  26. }
  27. SHADER_INIT
  28. {
  29. LoadTexture( BASETEXTURE );
  30. }
  31. SHADER_DRAW
  32. {
  33. SHADOW_STATE
  34. {
  35. pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
  36. pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
  37. DECLARE_STATIC_VERTEX_SHADER( debugmrttexture_vs20 );
  38. SET_STATIC_VERTEX_SHADER( debugmrttexture_vs20 );
  39. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  40. {
  41. DECLARE_STATIC_PIXEL_SHADER( debugmrttexture_ps20b );
  42. SET_STATIC_PIXEL_SHADER_COMBO( MRTINDEX, params[MRTINDEX]->GetIntValue() );
  43. SET_STATIC_PIXEL_SHADER( debugmrttexture_ps20b );
  44. }
  45. else
  46. {
  47. DECLARE_STATIC_PIXEL_SHADER( debugmrttexture_ps20 );
  48. SET_STATIC_PIXEL_SHADER_COMBO( MRTINDEX, params[MRTINDEX]->GetIntValue() );
  49. SET_STATIC_PIXEL_SHADER( debugmrttexture_ps20 );
  50. }
  51. int numTexCoords = 2;
  52. pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, numTexCoords, 0, 0 );
  53. }
  54. DYNAMIC_STATE
  55. {
  56. BindTexture( SHADER_SAMPLER0, BASETEXTURE, FRAME );
  57. DECLARE_DYNAMIC_VERTEX_SHADER( debugmrttexture_vs20 );
  58. SET_DYNAMIC_VERTEX_SHADER( debugmrttexture_vs20 );
  59. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  60. {
  61. DECLARE_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20b );
  62. SET_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20b );
  63. }
  64. else
  65. {
  66. DECLARE_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20 );
  67. SET_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20 );
  68. }
  69. }
  70. Draw();
  71. }
  72. END_SHADER