UVs.azsl 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 <viewsrg.srgi>
  9. #include <Atom/Features/PBR/DefaultObjectSrg.azsli>
  10. #include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
  11. #include <Atom/Features/Pipeline/Forward/ForwardPassSrg.azsli>
  12. struct VertexInput
  13. {
  14. float3 m_position : POSITION;
  15. float2 m_uv : UV0;
  16. };
  17. struct VertexOutput
  18. {
  19. float4 m_position : SV_Position;
  20. float2 m_uv : UV0;
  21. };
  22. VertexOutput MainVS(VertexInput input)
  23. {
  24. VertexOutput output;
  25. float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(input.m_position, 1)).xyz;
  26. output.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0));
  27. output.m_uv = input.m_uv;
  28. return output;
  29. }
  30. struct PixelOutput
  31. {
  32. float4 m_color : SV_Target0;
  33. };
  34. PixelOutput MainPS(VertexOutput input)
  35. {
  36. PixelOutput output;
  37. output.m_color = float4(input.m_uv, 0, 1);
  38. return output;
  39. }