SMAAFeatureProcessor.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. namespace AZ
  11. {
  12. namespace Render
  13. {
  14. static const char* const SMAAConvertToPerceptualColorPassTemplateName = "SMAAConvertToPerceptualColorTemplate";
  15. //! SMAAFeatureProcessor implementation.
  16. class SMAAFeatureProcessor final
  17. : public SMAAFeatureProcessorInterface
  18. {
  19. public:
  20. AZ_CLASS_ALLOCATOR(SMAAFeatureProcessor, AZ::SystemAllocator)
  21. AZ_RTTI(AZ::Render::SMAAFeatureProcessor, "55E360D5-4810-4932-A782-7EA9104E9374", AZ::Render::SMAAFeatureProcessorInterface);
  22. static void Reflect(AZ::ReflectContext* context);
  23. SMAAFeatureProcessor();
  24. virtual ~SMAAFeatureProcessor() = default;
  25. // FeatureProcessor overrides ...
  26. void Activate() override;
  27. void Deactivate() override;
  28. void Simulate(const SimulatePacket & packet) override;
  29. void Render(const RenderPacket & packet) override;
  30. // SMAAFeatureProcessor overrides ...
  31. void SetEnable(bool enable) override;
  32. void SetQualityByPreset(SMAAQualityPreset preset) override;
  33. void SetEdgeDetectionMode(SMAAEdgeDetectionMode mode) override;
  34. void SetOutputMode(SMAAOutputMode mode) override;
  35. void SetChromaThreshold(float threshold) override;
  36. void SetDepthThreshold(float threshold) override;
  37. void SetLocalContrastAdaptationFactor(float factor) override;
  38. void SetPredicationEnable(bool enable) override;
  39. void SetPredicationThreshold(float threshold) override;
  40. void SetPredicationScale(float scale) override;
  41. void SetPredicationStrength(float strength) override;
  42. void SetMaxSearchSteps(int steps) override;
  43. void SetMaxSearchStepsDiagonal(int steps) override;
  44. void SetCornerRounding(int cornerRounding) override;
  45. void SetDiagonalDetectionEnable(bool enable) override;
  46. void SetCornerDetectionEnable(bool enable) override;
  47. const SMAAData& GetSettings() const override;
  48. private:
  49. SMAAFeatureProcessor(const SMAAFeatureProcessor&) = delete;
  50. void UpdateConvertToPerceptualPass();
  51. void UpdateEdgeDetectionPass();
  52. void UpdateBlendingWeightCalculationPass();
  53. void UpdateNeighborhoodBlendingPass();
  54. static constexpr const char* FeatureProcessorName = "SMAAFeatureProcessor";
  55. SMAAData m_data;
  56. const AZ::Name m_convertToPerceptualColorPassTemplateNameId;
  57. const AZ::Name m_edgeDetectioPassTemplateNameId;
  58. const AZ::Name m_blendingWeightCalculationPassTemplateNameId;
  59. const AZ::Name m_neighborhoodBlendingPassTemplateNameId;
  60. };
  61. } // namespace Render
  62. } // namespace AZ