TerrainClipmapDebugPass.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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/FullscreenTrianglePass.h>
  11. #include <Atom/RPI.Reflect/Pass/PassDescriptor.h>
  12. #include <TerrainRenderer/TerrainClipmapManager.h>
  13. namespace Terrain
  14. {
  15. //! The debug render pass to display a single clipmap at the bottom-right corner.
  16. //! It is located between the DebugOverlay pass and the UI pass.
  17. //! By slightly modifying the fullscreen pass, we can still use a single triangle
  18. //! but have a constant-sized texture in terms of viewport, whose size is adjustable by CVars.
  19. //! See TerrainClipmapDebugPass.cpp for CVars controls.
  20. class TerrainClipmapDebugPass : public AZ::RPI::FullscreenTrianglePass
  21. {
  22. AZ_RPI_PASS(TerrainClipmapDebugPass);
  23. public:
  24. AZ_RTTI(Terrain::TerrainClipmapDebugPass, "{BF1ED790-34BB-4E09-803B-09BF5BBFF0BD}", AZ::RPI::FullscreenTrianglePass);
  25. AZ_CLASS_ALLOCATOR(Terrain::TerrainClipmapDebugPass, AZ::SystemAllocator);
  26. virtual ~TerrainClipmapDebugPass() = default;
  27. static AZ::RPI::Ptr<TerrainClipmapDebugPass> Create(const AZ::RPI::PassDescriptor& descriptor);
  28. void SetupFrameGraphDependencies(AZ::RHI::FrameGraphInterface frameGraph) override;
  29. void CompileResources(const AZ::RHI::FrameGraphCompileContext& context) override;
  30. //! Return true when both the enable CVar and standard enable flag are true.
  31. bool IsEnabled() const override;
  32. private:
  33. TerrainClipmapDebugPass(const AZ::RPI::PassDescriptor& descriptor);
  34. };
  35. }