Counter Strike : Global Offensive Source Code
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.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "BaseVSShader.h"
  8. #include "screenspaceeffect.inc"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. BEGIN_VS_SHADER_FLAGS( YUV, "Help for YUV", 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 DX8 + above
  24. if ( IsPC() && !g_pHardwareConfig->SupportsVertexAndPixelShaders())
  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. pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 1, 0, 0 );
  37. screenspaceeffect_Static_Index vshIndex;
  38. pShaderShadow->SetVertexShader( "ScreenSpaceEffect", vshIndex.GetIndex() );
  39. pShaderShadow->SetPixelShader( "YUV" );
  40. }
  41. DYNAMIC_STATE
  42. {
  43. pShaderAPI->BindStandardTexture( SHADER_SAMPLER0, false, TEXTURE_FRAME_BUFFER_FULL_TEXTURE_0 );
  44. screenspaceeffect_Dynamic_Index vshIndex;
  45. vshIndex.SetDOWATERFOG( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
  46. pShaderAPI->SetVertexShaderIndex( vshIndex.GetIndex() );
  47. }
  48. Draw();
  49. }
  50. END_SHADER