3
0

PostProcessSettings.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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/PostProcess/PostProcessSettingsInterface.h>
  10. #include <Atom/Feature/PostProcess/PostFxLayerCategoriesConstants.h>
  11. #include <PostProcess/PostProcessBase.h>
  12. #include <PostProcess/Bloom/BloomSettings.h>
  13. #include <PostProcess/DepthOfField/DepthOfFieldSettings.h>
  14. #include <PostProcess/ExposureControl/ExposureControlSettings.h>
  15. #include <PostProcess/Ssao/SsaoSettings.h>
  16. #include <PostProcess/LookModification/LookModificationSettings.h>
  17. #include <PostProcess/ColorGrading/HDRColorGradingSettings.h>
  18. #include <PostProcess/ChromaticAberration/ChromaticAberrationSettings.h>
  19. #include <ScreenSpace/DeferredFogSettings.h>
  20. namespace AZ
  21. {
  22. namespace Render
  23. {
  24. //! A collection of post process settings
  25. //! This class is responsible for managing and blending sub-settings classes
  26. //! for post effects like depth of field, anti-aliasing, SSAO, etc.
  27. class PostProcessSettings final
  28. : public PostProcessSettingsInterface
  29. , public PostProcessBase
  30. {
  31. friend class PostProcessFeatureProcessor;
  32. public:
  33. AZ_RTTI(AZ::Render::PostProcessSettings, "{B4DE4B9F-83D2-4FD8-AD58-C0D1D4AEA23F}",
  34. AZ::Render::PostProcessSettingsInterface, AZ::Render::PostProcessBase);
  35. AZ_CLASS_ALLOCATOR(PostProcessSettings, SystemAllocator);
  36. PostProcessSettings(PostProcessFeatureProcessor* featureProcessor);
  37. // PostProcessSettingsInterface overrides...
  38. void OnConfigChanged() override;
  39. // Auto-gen function declarations related to sub-settings members
  40. #define POST_PROCESS_MEMBER(ClassName, MemberName) \
  41. ClassName* Get##ClassName() { return MemberName.get(); } \
  42. ClassName##Interface* GetOrCreate##ClassName##Interface() override; \
  43. void Remove##ClassName##Interface() override; \
  44. #include <Atom/Feature/PostProcess/PostProcessSettings.inl>
  45. #undef POST_PROCESS_MEMBER
  46. // Auto-gen getter and setter functions for post process members...
  47. #include <Atom/Feature/ParamMacros/StartParamFunctionsOverrideImpl.inl>
  48. #include <Atom/Feature/PostProcess/PostProcessParams.inl>
  49. #include <Atom/Feature/ParamMacros/EndParams.inl>
  50. // Getter & setter for layer category value
  51. int GetLayerCategoryValue() const { return m_layerCategoryValue; }
  52. void SetLayerCategoryValue(int layerCategoryValue) override { m_layerCategoryValue = layerCategoryValue; }
  53. // camera-to-blendWeight setters and getters
  54. void CopyViewToBlendWeightSettings(const ViewBlendWeightMap& perViewBlendWeights) override;
  55. float GetBlendWeightForView(AZ::RPI::View* view) const;
  56. private:
  57. // Applies owned sub-settings onto target's settings using providing blendFactor,
  58. // this class's overrideFactor and per-param override settings for individual sub-settings
  59. void ApplySettingsTo(PostProcessSettings* targetSettings, float blendFactor = 1.0f) const;
  60. // Called from the PostProcessFeatureProcessor on aggregated PostProcessSettings
  61. // (More detail: The PostProcessFeatureProcessor will blend together PostProcessSettings based on application
  62. // frequency (Level, Volume, Camera) and per-setting override values. Simulate will be called on those combined settings)
  63. void Simulate(float deltaTime);
  64. // Auto-gen post process members...
  65. #include <Atom/Feature/ParamMacros/StartParamMembers.inl>
  66. #include <Atom/Feature/PostProcess/PostProcessParams.inl>
  67. #include <Atom/Feature/ParamMacros/EndParams.inl>
  68. // Auto-gen sub-settings members
  69. #define POST_PROCESS_MEMBER(ClassName, MemberName) \
  70. AZStd::unique_ptr<ClassName> MemberName; \
  71. #include <Atom/Feature/PostProcess/PostProcessSettings.inl>
  72. #undef POST_PROCESS_MEMBER
  73. // This camera-to-blendWeights setting will be used by feature processor to
  74. // blend postfxs per camera
  75. ViewBlendWeightMap m_perViewBlendWeights;
  76. // Integer representation of PostFx layer
  77. int m_layerCategoryValue = PostFx::DefaultLayerCategoryValue;
  78. };
  79. }
  80. }