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.

63 lines
1.9 KiB

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. // STATIC: "GENERATEBASETEXTURE" "0..1"
  3. // STATIC: "GENERATENORMAL" "0..1"
  4. // STATIC: "GENERATEMASKS1" "0..1"
  5. // STATIC: "CHEAPFILTERING" "0..1"
  6. // STATIC: "BASEALPHAPHONGMASK" "0..1"
  7. // STATIC: "BASEALPHAENVMASK" "0..1"
  8. // STATIC: "BUMPALPHAENVMASK" "0..1"
  9. // STATIC: "USEPATTERN" "0..4"
  10. #include "common_ps_fxc.h"
  11. // SKIP: ( $GENERATEBASETEXTURE == 1 ) && ( $GENERATENORMAL == 1 )
  12. // SKIP: ( $GENERATEBASETEXTURE == 1 ) && ( GENERATEMASKS1 == 1 )
  13. // SKIP: ( $GENERATENORMAL == 1 ) && ( $GENERATEMASKS1 == 1 )
  14. // SKIP: ( $CHEAPFILTERING == 1 ) && ( $GENERATEBASETEXTURE == 0 )
  15. // SKIP: ( $USEPATTERN > 0 ) && ( $GENERATEBASETEXTURE == 0 )
  16. // SKIP: ( $GENERATEBASETEXTURE == 0 ) && ( $GENERATENORMAL == 0 ) && ( GENERATEMASKS1 == 0 )
  17. // SKIP: ( $GENERATENORMAL == 0 ) && ( $BUMPALPHAENVMASK == 1 )
  18. // SKIP: ( $GENERATEBASETEXTURE == 0 ) && ( $BASEALPHAPHONGMASK == 1 )
  19. // SKIP: ( $GENERATEBASETEXTURE == 0 ) && ( $BASEALPHAENVMASK == 1 )
  20. #if ( GENERATENORMAL == 1 )
  21. sampler NormalMapSampler : register( s0 );
  22. #endif
  23. #if ( GENERATEMASKS1 == 1 )
  24. sampler Masks1Sampler : register( s1 );
  25. #endif
  26. #include "custom_character_fxc.h"
  27. struct PS_INPUT
  28. {
  29. float2 vTexCoord0 : TEXCOORD0;
  30. };
  31. // ======================= MAIN ======================= //
  32. float4_color_return_type main( PS_INPUT i ) : COLOR
  33. {
  34. float4 fvBaseTexture = float4( 1.0f, 1.0f, 1.0f, 1.0f );
  35. float4 fvNormal = float4( 1.0f, 1.0f, 1.0f, 1.0f );
  36. float4 fvMasks1 = float4( 1.0f, 1.0f, 1.0f, 1.0f );
  37. #if ( GENERATEMASKS1 == 1 )
  38. fvMasks1 = tex2D( Masks1Sampler, i.vTexCoord0 );
  39. #endif
  40. #if ( GENERATENORMAL == 1 )
  41. fvNormal = tex2D( NormalMapSampler, i.vTexCoord0 );
  42. #endif
  43. customizeCharacter( i.vTexCoord0.xy, fvBaseTexture, fvNormal, fvMasks1 );
  44. #if ( GENERATEMASKS1 == 1 )
  45. return fvMasks1;
  46. #endif
  47. #if ( GENERATENORMAL == 1 )
  48. return fvNormal;
  49. #endif
  50. return fvBaseTexture;
  51. }