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.

33 lines
895 B

  1. //========= Copyright � 1996-2007, Valve Corporation, All rights reserved. ============//
  2. // STATIC: "STAGE" "0..2"
  3. #include "common_ps_fxc.h"
  4. sampler g_tPortalColorSampler : register( s0 );
  5. sampler g_tPortalMaskSampler : register( s1 );
  6. const float3 g_vConst1 : register( c1 );
  7. #define g_flPortalOpenAmount g_vConst1.x
  8. #define g_flPortalActive g_vConst1.y
  9. #define g_flPortalColorScale g_vConst1.z
  10. struct PS_INPUT
  11. {
  12. float2 vUv0 : TEXCOORD0;
  13. float2 vUv1 : TEXCOORD1;
  14. };
  15. float4 main( PS_INPUT i ) : COLOR
  16. {
  17. float4 result;
  18. result.rgba = tex2D( g_tPortalColorSampler, i.vUv0.xy );
  19. result.rgb *= g_flPortalColorScale + g_flPortalColorScale + g_flPortalColorScale + g_flPortalColorScale; // This is divided by 4 in C code
  20. #if ( STAGE == 2 ) // Color layer
  21. result.a += tex2D( g_tPortalMaskSampler, i.vUv1.xy ).a * ( 1.0f - g_flPortalActive );
  22. #endif
  23. return result;
  24. }