TextureMapCubemapArray.azsl 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. ShaderResourceGroup TextureMapSrg : SRG_PerObject
  10. {
  11. TextureCubeArray texture;
  12. Sampler m_sampler
  13. {
  14. MaxAnisotropy = 16;
  15. AddressU = Wrap;
  16. AddressV = Wrap;
  17. AddressW = Wrap;
  18. };
  19. }
  20. struct VSInput
  21. {
  22. float3 m_position : POSITION;
  23. float4 m_uvwx : UV0;
  24. };
  25. struct VSOutput
  26. {
  27. float4 m_position : SV_Position;
  28. float4 m_uvwx : UV0;
  29. };
  30. VSOutput MainVS(VSInput vsInput)
  31. {
  32. VSOutput OUT;
  33. OUT.m_position = float4(vsInput.m_position, 1.0);
  34. OUT.m_uvwx = vsInput.m_uvwx;
  35. return OUT;
  36. }
  37. struct PSOutput
  38. {
  39. float4 m_color : SV_Target0;
  40. };
  41. PSOutput MainPS(VSOutput psInput)
  42. {
  43. PSOutput OUT;
  44. OUT.m_color = TextureMapSrg::texture.Sample(TextureMapSrg::m_sampler, psInput.m_uvwx);
  45. return OUT;
  46. }