You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
3.3 KiB
C++
82 lines
3.3 KiB
C++
/*
|
|
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
|
* its licensors.
|
|
*
|
|
* For complete copyright and license terms please see the LICENSE at the root of this
|
|
* distribution (the "License"). All use of this software is governed by the License,
|
|
* or, if provided, by the license below or the license accompanying this file. Do not
|
|
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Atom/Feature/PostProcessing/SMAAFeatureProcessorInterface.h>
|
|
|
|
namespace AZ
|
|
{
|
|
|
|
namespace Render
|
|
{
|
|
static const char* const SMAAConvertToPerceptualColorPassTemplateName = "SMAAConvertToPerceptualColorTemplate";
|
|
|
|
//! SMAAFeatureProcessor implementation.
|
|
class SMAAFeatureProcessor final
|
|
: public SMAAFeatureProcessorInterface
|
|
{
|
|
public:
|
|
AZ_RTTI(AZ::Render::SMAAFeatureProcessor, "55E360D5-4810-4932-A782-7EA9104E9374", AZ::Render::SMAAFeatureProcessorInterface);
|
|
|
|
static void Reflect(AZ::ReflectContext* context);
|
|
|
|
SMAAFeatureProcessor();
|
|
virtual ~SMAAFeatureProcessor() = default;
|
|
|
|
// FeatureProcessor overrides ...
|
|
void Activate() override;
|
|
void Deactivate() override;
|
|
void Simulate(const SimulatePacket & packet) override;
|
|
void Render(const RenderPacket & packet) override;
|
|
|
|
// SMAAFeatureProcessor overrides ...
|
|
void SetEnable(bool enable) override;
|
|
void SetQualityByPreset(SMAAQualityPreset preset) override;
|
|
void SetEdgeDetectionMode(SMAAEdgeDetectionMode mode) override;
|
|
void SetOutputMode(SMAAOutputMode mode) override;
|
|
|
|
void SetChromaThreshold(float threshold) override;
|
|
void SetDepthThreshold(float threshold) override;
|
|
void SetLocalContrastAdaptationFactor(float factor) override;
|
|
void SetPredicationEnable(bool enable) override;
|
|
void SetPredicationThreshold(float threshold) override;
|
|
void SetPredicationScale(float scale) override;
|
|
void SetPredicationStrength(float strength) override;
|
|
|
|
void SetMaxSearchSteps(int steps) override;
|
|
void SetMaxSearchStepsDiagonal(int steps) override;
|
|
void SetCornerRounding(int cornerRounding) override;
|
|
void SetDiagonalDetectionEnable(bool enable) override;
|
|
void SetCornerDetectionEnable(bool enable) override;
|
|
|
|
const SMAAData& GetSettings() const override;
|
|
private:
|
|
SMAAFeatureProcessor(const SMAAFeatureProcessor&) = delete;
|
|
|
|
void UpdateConvertToPerceptualPass();
|
|
void UpdateEdgeDetectionPass();
|
|
void UpdateBlendingWeightCalculationPass();
|
|
void UpdateNeighborhoodBlendingPass();
|
|
|
|
static constexpr const char* FeatureProcessorName = "SMAAFeatureProcessor";
|
|
|
|
SMAAData m_data;
|
|
|
|
const AZ::Name m_convertToPerceptualColorPassTemplateNameId;
|
|
const AZ::Name m_edgeDetectioPassTemplateNameId;
|
|
const AZ::Name m_blendingWeightCalculationPassTemplateNameId;
|
|
const AZ::Name m_neighborhoodBlendingPassTemplateNameId;
|
|
};
|
|
} // namespace Render
|
|
} // namespace AZ
|