IndirectRendering.azsli 676 B

123456789101112131415161718192021222324252627282930
  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. #pragma once
  9. #include <Atom/Features/SrgSemantics.azsli>
  10. struct InstanceData
  11. {
  12. float4 m_color;
  13. float4 m_offset;
  14. float4 m_scale;
  15. float4 m_velocity;
  16. };
  17. float3 TransformInstancePos(float3 pos, InstanceData instanceData)
  18. {
  19. return (pos * instanceData.m_scale.xyz) + instanceData.m_offset.xyz;
  20. }
  21. ShaderResourceGroup IndirectSceneSrg : SRG_PerDraw
  22. {
  23. StructuredBuffer<InstanceData> m_instancesData;
  24. row_major float4x4 m_matrix;
  25. }