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.

48 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Header: $
  6. // $NoKeywords: $
  7. //===========================================================================//
  8. #include "shaderlib/cshader.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. BEGIN_SHADER_FLAGS( ViewAlpha, "Help for ViewAlpha", SHADER_NOT_EDITABLE )
  12. BEGIN_SHADER_PARAMS
  13. END_SHADER_PARAMS
  14. SHADER_INIT
  15. {
  16. LoadTexture( BASETEXTURE );
  17. }
  18. SHADER_DRAW
  19. {
  20. SHADOW_STATE
  21. {
  22. pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
  23. pShaderShadow->EnableCustomPixelPipe( true );
  24. pShaderShadow->CustomTextureStages( 1 );
  25. pShaderShadow->CustomTextureOperation( SHADER_TEXTURE_STAGE0,
  26. SHADER_TEXCHANNEL_COLOR, SHADER_TEXOP_SELECTARG1,
  27. SHADER_TEXARG_TEXTUREALPHA, SHADER_TEXARG_CONSTANTCOLOR );
  28. pShaderShadow->CustomTextureOperation( SHADER_TEXTURE_STAGE0,
  29. SHADER_TEXCHANNEL_ALPHA, SHADER_TEXOP_SELECTARG1,
  30. SHADER_TEXARG_TEXTURE, SHADER_TEXARG_VERTEXCOLOR );
  31. pShaderShadow->DrawFlags( SHADER_DRAW_POSITION | SHADER_DRAW_TEXCOORD0 );
  32. }
  33. DYNAMIC_STATE
  34. {
  35. BindTexture( SHADER_SAMPLER0, BASETEXTURE, FRAME );
  36. SetFixedFunctionTextureTransform( MATERIAL_TEXTURE0, BASETEXTURETRANSFORM );
  37. }
  38. Draw( );
  39. }
  40. END_SHADER