| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #pragma once
- #include <Atom/Feature/PostProcess/PostProcessSettingsInterface.h>
- #include <Atom/Feature/PostProcess/PostFxLayerCategoriesConstants.h>
- #include <PostProcess/PostProcessBase.h>
- #include <PostProcess/Bloom/BloomSettings.h>
- #include <PostProcess/DepthOfField/DepthOfFieldSettings.h>
- #include <PostProcess/ExposureControl/ExposureControlSettings.h>
- #include <PostProcess/Ssao/SsaoSettings.h>
- #include <PostProcess/LookModification/LookModificationSettings.h>
- #include <PostProcess/ColorGrading/HDRColorGradingSettings.h>
- #include <PostProcess/ChromaticAberration/ChromaticAberrationSettings.h>
- #include <PostProcess/PaniniProjection/PaniniProjectionSettings.h>
- #include <PostProcess/FilmGrain/FilmGrainSettings.h>
- #include <PostProcess/WhiteBalance/WhiteBalanceSettings.h>
- #include <PostProcess/Vignette/VignetteSettings.h>
- #include <ScreenSpace/DeferredFogSettings.h>
- namespace AZ
- {
- namespace Render
- {
- //! A collection of post process settings
- //! This class is responsible for managing and blending sub-settings classes
- //! for post effects like depth of field, anti-aliasing, SSAO, etc.
- class PostProcessSettings final
- : public PostProcessSettingsInterface
- , public PostProcessBase
- {
- friend class PostProcessFeatureProcessor;
- public:
- AZ_RTTI(AZ::Render::PostProcessSettings, "{E4BD5945-F4C6-4B68-B1D3-28700BD2BF88}",
- AZ::Render::PostProcessSettingsInterface, AZ::Render::PostProcessBase);
- AZ_CLASS_ALLOCATOR(PostProcessSettings, SystemAllocator);
- PostProcessSettings(PostProcessFeatureProcessor* featureProcessor);
- // PostProcessSettingsInterface overrides...
- void OnConfigChanged() override;
- // Auto-gen function declarations related to sub-settings members
- #define POST_PROCESS_MEMBER(ClassName, MemberName) \
- ClassName* Get##ClassName() { return MemberName.get(); } \
- ClassName##Interface* GetOrCreate##ClassName##Interface() override; \
- void Remove##ClassName##Interface() override; \
- #include <Atom/Feature/PostProcess/PostProcessSettings.inl>
- #undef POST_PROCESS_MEMBER
- // Auto-gen getter and setter functions for post process members...
- #include <Atom/Feature/ParamMacros/StartParamFunctionsOverrideImpl.inl>
- #include <Atom/Feature/PostProcess/PostProcessParams.inl>
- #include <Atom/Feature/ParamMacros/EndParams.inl>
- // Getter & setter for layer category value
- int GetLayerCategoryValue() const { return m_layerCategoryValue; }
- void SetLayerCategoryValue(int layerCategoryValue) override { m_layerCategoryValue = layerCategoryValue; }
- // camera-to-blendWeight setters and getters
- void CopyViewToBlendWeightSettings(const ViewBlendWeightMap& perViewBlendWeights) override;
- float GetBlendWeightForView(AZ::RPI::View* view) const;
- private:
- // Applies owned sub-settings onto target's settings using providing blendFactor,
- // this class's overrideFactor and per-param override settings for individual sub-settings
- void ApplySettingsTo(PostProcessSettings* targetSettings, float blendFactor = 1.0f) const;
- // Called from the PostProcessFeatureProcessor on aggregated PostProcessSettings
- // (More detail: The PostProcessFeatureProcessor will blend together PostProcessSettings based on application
- // frequency (Level, Volume, Camera) and per-setting override values. Simulate will be called on those combined settings)
- void Simulate(float deltaTime);
- // Auto-gen post process members...
- #include <Atom/Feature/ParamMacros/StartParamMembers.inl>
- #include <Atom/Feature/PostProcess/PostProcessParams.inl>
- #include <Atom/Feature/ParamMacros/EndParams.inl>
- // Auto-gen sub-settings members
- #define POST_PROCESS_MEMBER(ClassName, MemberName) \
- AZStd::unique_ptr<ClassName> MemberName; \
- #include <Atom/Feature/PostProcess/PostProcessSettings.inl>
- #undef POST_PROCESS_MEMBER
- // This camera-to-blendWeights setting will be used by feature processor to
- // blend postfxs per camera
- ViewBlendWeightMap m_perViewBlendWeights;
- // Integer representation of PostFx layer
- int m_layerCategoryValue = PostFx::DefaultLayerCategoryValue;
- };
- }
- }
|