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.

60 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "BaseVSShader.h"
  8. #include "writez.inc"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. DEFINE_FALLBACK_SHADER( WriteZ, WriteZ_DX8 )
  12. BEGIN_VS_SHADER_FLAGS( WriteZ_DX8, "Help for WriteZ", SHADER_NOT_EDITABLE )
  13. BEGIN_SHADER_PARAMS
  14. END_SHADER_PARAMS
  15. SHADER_INIT_PARAMS()
  16. {
  17. }
  18. SHADER_FALLBACK
  19. {
  20. if ( IsPC() && g_pHardwareConfig->GetDXSupportLevel() < 80 )
  21. return "WriteZ_DX6";
  22. return 0;
  23. }
  24. SHADER_INIT
  25. {
  26. }
  27. SHADER_DRAW
  28. {
  29. SHADOW_STATE
  30. {
  31. pShaderShadow->EnableColorWrites( false );
  32. pShaderShadow->EnableAlphaWrites( false );
  33. writez_Static_Index vshIndex;
  34. pShaderShadow->SetVertexShader( "writez", vshIndex.GetIndex() );
  35. pShaderShadow->SetPixelShader( "white" );
  36. pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 1, 0, 0 );
  37. }
  38. DYNAMIC_STATE
  39. {
  40. writez_Dynamic_Index vshIndex;
  41. vshIndex.SetDOWATERFOG( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
  42. pShaderAPI->SetVertexShaderIndex( vshIndex.GetIndex() );
  43. }
  44. Draw();
  45. }
  46. END_SHADER