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.

29 lines
739 B

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. //
  3. // Purpose: Common pixel shader code for decaltexture usage
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef COMMON_DECALTEXTURE_FXC_H_
  9. #define COMMON_DECALTEXTURE_FXC_H_
  10. // decal blend modes
  11. float3 TextureCombineDecal( float3 baseColor, float4 decalColor, float3 decalLighting )
  12. {
  13. #if ( DECAL_BLEND_MODE == 0 )
  14. {
  15. baseColor.rgb = ( decalColor.rgb * decalLighting * decalColor.a ) + ( baseColor.rgb * ( 1.0f - decalColor.a) );
  16. }
  17. #elif ( DECAL_BLEND_MODE == 1 )
  18. {
  19. baseColor.rgb = baseColor.rgb * decalColor.rgb;
  20. }
  21. #endif
  22. return baseColor;
  23. }
  24. #endif // COMMON_DECALTEXTURE_FXC_H_