2
0

OpenXrSample.azsl 1001 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 OpenXrSrg : SRG_PerObject
  10. {
  11. row_major float4x4 m_worldMatrix;
  12. row_major float4x4 m_viewProjMatrix;
  13. }
  14. struct VSInput
  15. {
  16. float3 m_position : POSITION;
  17. float4 m_color : COLOR0;
  18. };
  19. struct VSOutput
  20. {
  21. float4 m_position : SV_Position;
  22. float4 m_color : COLOR0;
  23. };
  24. VSOutput MainVS(VSInput vsInput)
  25. {
  26. VSOutput OUT;
  27. OUT.m_position = mul(OpenXrSrg::m_worldMatrix, float4(vsInput.m_position, 1.0));
  28. OUT.m_position = mul(OpenXrSrg::m_viewProjMatrix, OUT.m_position);
  29. OUT.m_color = vsInput.m_color;
  30. return OUT;
  31. }
  32. struct PSOutput
  33. {
  34. float4 m_color : SV_Target0;
  35. };
  36. PSOutput MainPS(VSOutput vsOutput)
  37. {
  38. PSOutput OUT;
  39. OUT.m_color = vsOutput.m_color;
  40. return OUT;
  41. }