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.

66 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Run procedural glint generation inner loop in pixel shader
  4. //
  5. // $Header: $
  6. // $NoKeywords: $
  7. //===========================================================================//
  8. #include "BaseVSShader.h"
  9. #include "shaderlib/cshader.h"
  10. #include "eyeglint_vs20.inc"
  11. #include "eyeglint_ps20.inc"
  12. #include "eyeglint_ps20b.inc"
  13. DEFINE_FALLBACK_SHADER( EyeGlint, EyeGlint_dx9 )
  14. BEGIN_VS_SHADER( EyeGlint_dx9, "Help for EyeGlint" )
  15. BEGIN_SHADER_PARAMS
  16. END_SHADER_PARAMS
  17. SHADER_INIT
  18. {
  19. }
  20. SHADER_FALLBACK
  21. {
  22. if ( g_pHardwareConfig->GetDXSupportLevel() < 90 )
  23. {
  24. return "Wireframe";
  25. }
  26. return 0;
  27. }
  28. SHADER_DRAW
  29. {
  30. SHADOW_STATE
  31. {
  32. pShaderShadow->EnableDepthWrites( false );
  33. pShaderShadow->EnableBlending( true );
  34. pShaderShadow->BlendFunc( SHADER_BLEND_ONE, SHADER_BLEND_ONE ); // Additive blending
  35. int pTexCoords[3] = { 2, 2, 3 };
  36. pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 3, pTexCoords, 0 );
  37. pShaderShadow->EnableCulling( false );
  38. pShaderShadow->EnableSRGBWrite( false ); // linear texture
  39. DECLARE_STATIC_VERTEX_SHADER( eyeglint_vs20 );
  40. SET_STATIC_VERTEX_SHADER( eyeglint_vs20 );
  41. SET_STATIC_PS2X_PIXEL_SHADER_NO_COMBOS( eyeglint );
  42. }
  43. DYNAMIC_STATE
  44. {
  45. DECLARE_DYNAMIC_VERTEX_SHADER( eyeglint_vs20 );
  46. SET_DYNAMIC_VERTEX_SHADER( eyeglint_vs20 );
  47. SET_DYNAMIC_PS2X_PIXEL_SHADER_NO_COMBOS( eyeglint );
  48. }
  49. Draw();
  50. }
  51. END_SHADER