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.

62 lines
1.3 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( Occlusion, Occlusion_DX8 )
  12. BEGIN_VS_SHADER_FLAGS( Occlusion_DX8, "Help for Occlusion", 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. {
  22. return "Wireframe";
  23. }
  24. return 0;
  25. }
  26. SHADER_INIT
  27. {
  28. }
  29. SHADER_DRAW
  30. {
  31. SHADOW_STATE
  32. {
  33. pShaderShadow->EnableColorWrites( false );
  34. pShaderShadow->EnableAlphaWrites( false );
  35. pShaderShadow->EnableDepthWrites( false );
  36. pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 1, 0, 0 );
  37. writez_Static_Index vshIndex;
  38. pShaderShadow->SetVertexShader( "writez", vshIndex.GetIndex() );
  39. pShaderShadow->SetPixelShader( "white" );
  40. }
  41. DYNAMIC_STATE
  42. {
  43. writez_Dynamic_Index vshIndex;
  44. vshIndex.SetDOWATERFOG( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
  45. pShaderAPI->SetVertexShaderIndex( vshIndex.GetIndex() );
  46. pShaderAPI->SetPixelShaderIndex( 0 );
  47. }
  48. Draw();
  49. }
  50. END_SHADER