MultipleViewsDepth.azsl 770 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 DepthViewSrg : SRG_PerObject
  10. {
  11. row_major float4x4 m_worldMatrix;
  12. row_major float4x4 m_viewProjectionMatrix;
  13. }
  14. struct VSInput
  15. {
  16. float3 m_position : POSITION;
  17. };
  18. struct VSOutput
  19. {
  20. float4 m_position : SV_Position;
  21. };
  22. VSOutput MainVS(VSInput vsInput)
  23. {
  24. VSOutput OUT;
  25. float4 worldPosition = mul(DepthViewSrg::m_worldMatrix, float4(vsInput.m_position, 1.0));
  26. OUT.m_position = mul(DepthViewSrg::m_viewProjectionMatrix, worldPosition);
  27. return OUT;
  28. }