SMAANeighborhoodBlendingPass.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/Feature/PostProcessing/SMAAFeatureProcessorInterface.h>
  10. #include <PostProcessing/SMAABasePass.h>
  11. namespace AZ
  12. {
  13. namespace Render
  14. {
  15. static const char* const SMAANeighborhoodBlendingPassTemplateName = "SMAANeighborhoodBlendingTemplate";
  16. //! The SMAA neighborhood blending pass implementation. The third pass of the SMAA applies anti-aliasing by blending with neighborhood pixels
  17. //! using the blending weight texture output from previous pass.
  18. class SMAANeighborhoodBlendingPass final
  19. : public SMAABasePass
  20. {
  21. public:
  22. AZ_RTTI(SMAANeighborhoodBlendingPass, "{EED89560-137F-4666-8E43-FF8A004F82A5}", SMAABasePass);
  23. AZ_CLASS_ALLOCATOR(SMAANeighborhoodBlendingPass, SystemAllocator);
  24. virtual ~SMAANeighborhoodBlendingPass() = default;
  25. //! Creates a SMAANeighborhoodBlendingPass
  26. static RPI::Ptr<SMAANeighborhoodBlendingPass> Create(const RPI::PassDescriptor& descriptor);
  27. void SetOutputMode(SMAAOutputMode mode);
  28. private:
  29. SMAANeighborhoodBlendingPass(const RPI::PassDescriptor& descriptor);
  30. // Pass behavior overrides
  31. void InitializeInternal() override;
  32. // SMAABasePass functions...
  33. void UpdateSRG() override;
  34. void GetCurrentShaderOption(AZ::RPI::ShaderOptionGroup& shaderOption) const override;
  35. RHI::ShaderInputNameIndex m_renderTargetMetricsShaderInputIndex = "m_renderTargetMetrics";
  36. const AZ::Name m_blendingOutputModeOptionName;
  37. // [GFX TODO][ATOM-3977] Since these parameters don't have control method, they are fixed at the moment. They will be controlled by feature processor in the future.
  38. SMAAOutputMode m_outputMode = SMAAOutputMode::BlendResultWithProvisionalTonemap;
  39. };
  40. } // namespace Render
  41. } // namespace AZ