ReflectionScreenSpaceBlurPass.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 <Atom/RPI.Public/Pass/FullscreenTrianglePass.h>
  10. #include <Atom/RPI.Public/Pass/ParentPass.h>
  11. namespace AZ
  12. {
  13. namespace Render
  14. {
  15. //! This pass performs a separable Gaussian blur of the input reflection image
  16. //! to the lower mip levels of that image. The blurred mips are used as roughness levels
  17. //! when applying reflection data to a surface material.
  18. class ReflectionScreenSpaceBlurPass
  19. : public RPI::ParentPass
  20. {
  21. AZ_RPI_PASS(ReflectionScreenSpaceBlurPass);
  22. public:
  23. AZ_RTTI(Render::ReflectionScreenSpaceBlurPass, "{BC3D92C5-E38A-46FE-8EBD-CAD14E505946}", ParentPass);
  24. AZ_CLASS_ALLOCATOR(Render::ReflectionScreenSpaceBlurPass, SystemAllocator);
  25. //! Creates a new pass without a PassTemplate
  26. static RPI::Ptr<ReflectionScreenSpaceBlurPass> Create(const RPI::PassDescriptor& descriptor);
  27. private:
  28. explicit ReflectionScreenSpaceBlurPass(const RPI::PassDescriptor& descriptor);
  29. void CreateChildPassesInternal() override;
  30. // Pass Overrides...
  31. void ResetInternal() override;
  32. void BuildInternal() override;
  33. void FrameBeginInternal(FramePrepareParams params) override;
  34. RHI::Size m_imageSize;
  35. uint32_t m_mipLevels = 0;
  36. AZStd::vector<RPI::Ptr<RPI::FullscreenTrianglePass>> m_verticalBlurChildPasses;
  37. AZStd::vector<RPI::Ptr<RPI::FullscreenTrianglePass>> m_horizontalBlurChildPasses;
  38. };
  39. } // namespace RPI
  40. } // namespace AZ