3
0

CubeMapCapture.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/RPI.Public/Scene.h>
  10. #include <CubeMapCapture/CubeMapRenderer.h>
  11. namespace AZ
  12. {
  13. namespace Render
  14. {
  15. // captures a cubeMap using the specified transform as the capture position
  16. class CubeMapCapture final
  17. : private CubeMapRenderer
  18. {
  19. public:
  20. CubeMapCapture() = default;
  21. ~CubeMapCapture() = default;
  22. void Init(RPI::Scene* scene);
  23. void Simulate();
  24. void OnRenderEnd();
  25. // initiates the cubeMap render and invokes the callback after all of the faces are rendered
  26. void RenderCubeMap(RenderCubeMapCallback callback, const AZStd::string& relativePath);
  27. // called by the feature processor, sets the default view if it's for the cubeMap capture pipeline
  28. void OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline);
  29. void SetRelativePath(const AZStd::string& relativePath) { m_relativePath = relativePath; }
  30. const AZStd::string& GetRelativePath() const { return m_relativePath; }
  31. void SetTransform(const AZ::Transform& transform);
  32. void SetExposure(float exposure);
  33. private:
  34. AZ_DISABLE_COPY_MOVE(CubeMapCapture);
  35. RPI::Scene* m_scene = nullptr;
  36. AZ::Transform m_transform = AZ::Transform::CreateIdentity();
  37. AZStd::string m_relativePath;
  38. float m_exposure = 0.0f;
  39. };
  40. } // namespace Render
  41. } // namespace AZ