UVs.azsl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. * its licensors.
  4. *
  5. * For complete copyright and license terms please see the LICENSE at the root of this
  6. * distribution (the "License"). All use of this software is governed by the License,
  7. * or, if provided, by the license below or the license accompanying this file. Do not
  8. * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. *
  11. */
  12. #include <viewsrg.srgi>
  13. #include <Atom/RPI/ShaderResourceGroups/DefaultObjectSrg.azsli>
  14. #include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
  15. #include <Atom/Features/PBR/ForwardPassSrg.azsli>
  16. struct VertexInput
  17. {
  18. float3 m_position : POSITION;
  19. float2 m_uv : UV0;
  20. };
  21. struct VertexOutput
  22. {
  23. float4 m_position : SV_Position;
  24. float2 m_uv : UV0;
  25. };
  26. VertexOutput MainVS(VertexInput input)
  27. {
  28. VertexOutput output;
  29. float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(input.m_position, 1)).xyz;
  30. output.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0));
  31. output.m_uv = input.m_uv;
  32. return output;
  33. }
  34. struct PixelOutput
  35. {
  36. float4 m_color : SV_Target0;
  37. };
  38. PixelOutput MainPS(VertexOutput input)
  39. {
  40. PixelOutput output;
  41. output.m_color = float4(input.m_uv, 0, 1);
  42. return output;
  43. }