/* * Copyright (c) Contributors to the Open 3D Engine Project * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include namespace AZ { namespace Render { static const char* const LookModificationTransformPassTemplateName{ "LookModificationTransformTemplate" }; static const char* const ExposureShaderVariantOptionName{ "o_enableExposureControlFeature" }; static const char* const ColorGradingShaderVariantOptionName{ "o_enableColorGradingLut" }; /** * The look modification composite pass. If color grading LUTs are enabled, this pass will apply the blended LUT. */ class LookModificationCompositePass : public AZ::RPI::FullscreenTrianglePass , public PostProcessingShaderOptionBase { public: AZ_RTTI(LookModificationCompositePass, "{D7DF3E8A-B642-4D51-ABC2-ADB2B60FCE1D}", AZ::RPI::FullscreenTrianglePass); AZ_CLASS_ALLOCATOR(LookModificationCompositePass, SystemAllocator, 0); virtual ~LookModificationCompositePass() = default; //! Creates a LookModificationPass static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); //! Set whether exposure control is enabled void SetExposureControlEnabled(bool enabled); //! Set shaper parameters void SetShaperParameters(const ShaperParams& shaperParams); protected: LookModificationCompositePass(const RPI::PassDescriptor& descriptor); //! Pass behavior overrides void InitializeInternal() override; void FrameBeginInternal(FramePrepareParams params) final; private: void InitializeShaderVariant(); void UpdateCurrentShaderVariant(); // Scope producer functions... void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; void UpdateExposureFeatureState(); void UpdateLookModificationFeatureState(); void SetColorGradingLutEnabled(bool enabled); bool m_exposureControlEnabled = false; bool m_colorGradingLutEnabled = false; Render::DisplayMapperLut m_blendedColorGradingLut; Render::ShaperParams m_colorGradingShaperParams; const AZ::Name m_exposureShaderVariantOptionName; const AZ::Name m_colorGradingShaderVariantOptionName; bool m_needToUpdateShaderVariant = true; RHI::ShaderInputNameIndex m_shaderColorGradingLutImageIndex = "m_gradingLut"; RHI::ShaderInputNameIndex m_shaderColorGradingShaperTypeIndex = "m_shaperType"; RHI::ShaderInputNameIndex m_shaderColorGradingShaperBiasIndex = "m_shaperBias"; RHI::ShaderInputNameIndex m_shaderColorGradingShaperScaleIndex = "m_shaperScale"; }; } // namespace Render } // namespace AZ