ReflectionScreenSpaceTracePass.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/Pass.h>
  10. #include <Atom/RPI.Public/Pass/FullscreenTrianglePass.h>
  11. #include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
  12. #include <Atom/RPI.Public/Shader/Shader.h>
  13. namespace AZ
  14. {
  15. namespace Render
  16. {
  17. //! This pass traces screenspace reflections from the previous frame image.
  18. class ReflectionScreenSpaceTracePass
  19. : public RPI::FullscreenTrianglePass
  20. {
  21. AZ_RPI_PASS(ReflectionScreenSpaceTracePass);
  22. public:
  23. AZ_RTTI(Render::ReflectionScreenSpaceTracePass, "{70FD45E9-8363-4AA1-A514-3C24AC975E53}", FullscreenTrianglePass);
  24. AZ_CLASS_ALLOCATOR(Render::ReflectionScreenSpaceTracePass, SystemAllocator);
  25. //! Creates a new pass without a PassTemplate
  26. static RPI::Ptr<ReflectionScreenSpaceTracePass> Create(const RPI::PassDescriptor& descriptor);
  27. Data::Instance<RPI::AttachmentImage>& GetPreviousFrameImageAttachment() { return m_previousFrameImageAttachment; }
  28. private:
  29. explicit ReflectionScreenSpaceTracePass(const RPI::PassDescriptor& descriptor);
  30. // Pass behavior overrides...
  31. void BuildInternal() override;
  32. void CompileResources(const RHI::FrameGraphCompileContext& context) override;
  33. Data::Instance<RPI::AttachmentImage> m_previousFrameImageAttachment;
  34. RHI::ShaderInputNameIndex m_invOutputScaleNameIndex = "m_invOutputScale";
  35. RHI::ShaderInputNameIndex m_outputWidthNameIndex = "m_outputWidth";
  36. RHI::ShaderInputNameIndex m_outputHeightNameIndex = "m_outputHeight";
  37. RHI::ShaderInputNameIndex m_rayTracingEnabledNameIndex = "m_rayTracingEnabled";
  38. RHI::ShaderInputNameIndex m_rayTraceFallbackDataNameIndex = "m_rayTraceFallbackData";
  39. RHI::ShaderInputNameIndex m_maxRayDistanceNameIndex = "m_maxRayDistance";
  40. RHI::ShaderInputNameIndex m_maxDepthThresholdNameIndex = "m_maxDepthThreshold";
  41. RHI::ShaderInputNameIndex m_maxRoughnessNameIndex = "m_maxRoughness";
  42. RHI::ShaderInputNameIndex m_roughnessBiasNameIndex = "m_roughnessBias";
  43. };
  44. } // namespace RPI
  45. } // namespace AZ