Composite.azsl 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <Atom/Features/SrgSemantics.azsli>
  9. #include <Atom/Features/PostProcessing/FullscreenPixelInfo.azsli>
  10. #include <Atom/Features/PostProcessing/FullscreenVertex.azsli>
  11. ShaderResourceGroup PassSrg : SRG_PerPass
  12. {
  13. Texture2D<float4> m_image1;
  14. Texture2D<float4> m_image2;
  15. Sampler m_sampler
  16. {
  17. MinFilter = Linear;
  18. MagFilter = Linear;
  19. MipFilter = Linear;
  20. AddressU = Clamp;
  21. AddressV = Clamp;
  22. AddressW = Clamp;
  23. };
  24. }
  25. PSOutput MainPS(VSOutput IN)
  26. {
  27. PSOutput OUT;
  28. if(IN.m_texCoord.x <= 0.5)
  29. {
  30. OUT.m_color = PassSrg::m_image1.Sample(PassSrg::m_sampler, float2(IN.m_texCoord.x * 2, IN.m_texCoord.y));
  31. }
  32. else
  33. {
  34. OUT.m_color = PassSrg::m_image2.Sample(PassSrg::m_sampler, float2(IN.m_texCoord.x * 2 - 1, IN.m_texCoord.y));
  35. }
  36. return OUT;
  37. }