SkyAtmosphereParentPass.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/Memory/SystemAllocator.h>
  10. #include <Atom/RPI.Public/Pass/ParentPass.h>
  11. #include <Atom/RPI.Public/Pass/RenderPass.h>
  12. #include <SkyAtmosphere/SkyAtmospherePass.h>
  13. #include <AzCore/Math/Vector3.h>
  14. #include <AzCore/std/containers/unordered_set.h>
  15. namespace AZ::Render
  16. {
  17. static const char* const SkyAtmosphereParentPassTemplateName = "SkyAtmosphereParentPassTemplate";
  18. class SkyAtmosphereParentPass final
  19. : public RPI::ParentPass
  20. {
  21. using Base = RPI::ParentPass;
  22. AZ_RPI_PASS(SkyAtmosphereParentPass);
  23. public:
  24. AZ_RTTI(SkyAtmosphereParentPass, "{3FF065BD-67B6-4D46-9589-BFAF6364D4ED}", Base);
  25. AZ_CLASS_ALLOCATOR(SkyAtmosphereParentPass, SystemAllocator);
  26. virtual ~SkyAtmosphereParentPass() = default;
  27. static RPI::Ptr<SkyAtmosphereParentPass> Create(const RPI::PassDescriptor& descriptor);
  28. void CreateAtmospherePass(SkyAtmosphereFeatureProcessorInterface::AtmosphereId id);
  29. void ReleaseAtmospherePass(SkyAtmosphereFeatureProcessorInterface::AtmosphereId id);
  30. void UpdateAtmospherePassSRG(SkyAtmosphereFeatureProcessorInterface::AtmosphereId id, const SkyAtmosphereParams& params);
  31. private:
  32. SkyAtmosphereParentPass() = delete;
  33. explicit SkyAtmosphereParentPass(const RPI::PassDescriptor& descriptor);
  34. void CreateChildPassesInternal() override;
  35. RPI::Ptr<SkyAtmospherePass> GetPass(SkyAtmosphereFeatureProcessorInterface::AtmosphereId id) const;
  36. AZStd::unordered_set<SkyAtmosphereFeatureProcessorInterface::AtmosphereId> m_atmosphereIds;
  37. };
  38. } // namespace AZ::Render