TransparencyExampleComponent.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <AzCore/Component/TickBus.h>
  10. #include <CommonSampleComponentBase.h>
  11. #include <Utils/Utils.h>
  12. namespace AtomSampleViewer
  13. {
  14. //! Depth sort testing for Transparency object
  15. class TransparencyExampleComponent final
  16. : public CommonSampleComponentBase
  17. , public AZ::TickBus::Handler
  18. {
  19. public:
  20. AZ_COMPONENT(TransparencyExampleComponent, "{36988524-5911-45F1-970C-32C889BAB1F1}", CommonSampleComponentBase);
  21. static void Reflect(AZ::ReflectContext* context);
  22. TransparencyExampleComponent();
  23. ~TransparencyExampleComponent() override = default;
  24. void Activate() override;
  25. void Deactivate() override;
  26. private:
  27. AZ_DISABLE_COPY_MOVE(TransparencyExampleComponent);
  28. // AZ::TickBus::Handler overrides...
  29. void OnTick(float deltaTime, AZ::ScriptTimePoint scriptTime) override;
  30. void Prepare();
  31. void LoadMesh(AZ::Transform transform);
  32. AZ::Data::Asset<AZ::RPI::ModelAsset> m_modelAsset;
  33. AZ::Data::Asset<AZ::RPI::MaterialAsset> m_materialAsset;
  34. AZStd::vector<AZ::Render::MeshFeatureProcessorInterface::MeshHandle> m_meshHandles;
  35. Utils::DefaultIBL m_defaultIbl;
  36. bool m_waitingForMeshes = false;
  37. uint32_t m_loadedMeshCounter = 0;
  38. float total = 0;
  39. };
  40. } // namespace AtomSampleViewer