ColorMesh.azsl 821 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 InstanceSrg : SRG_PerObject
  10. {
  11. row_major float4x4 m_objectMatrix;
  12. float4 m_color;
  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. OUT.m_position = mul(InstanceSrg::m_objectMatrix, float4(vsInput.m_position, 1.0));
  26. return OUT;
  27. }
  28. struct PSOutput
  29. {
  30. float4 m_color : SV_Target0;
  31. };
  32. PSOutput MainPS(VSOutput vsOutput)
  33. {
  34. PSOutput OUT;
  35. OUT.m_color = InstanceSrg::m_color;
  36. return OUT;
  37. }