DeferredFogComponentConfig.cpp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #include <AtomLyIntegration/CommonFeatures/ScreenSpace/DeferredFogComponentConfig.h>
  9. #include <AzCore/Serialization/SerializeContext.h>
  10. #include <AzCore/Serialization/EditContext.h>
  11. namespace AZ
  12. {
  13. namespace Render
  14. {
  15. void DeferredFogComponentConfig::Reflect(ReflectContext* context)
  16. {
  17. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  18. {
  19. serializeContext->Class<DeferredFogComponentConfig, ComponentConfig>()
  20. ->Version(1)
  21. // Auto-gen serialize context code...
  22. #define SERIALIZE_CLASS DeferredFogComponentConfig
  23. #define AZ_GFX_COMMON_PARAM(ValueType, Name, MemberName, DefaultValue) \
  24. ->Field(#Name, &SERIALIZE_CLASS::MemberName) \
  25. #include <Atom/Feature/ParamMacros/MapParamCommon.inl>
  26. #include <Atom/Feature/ScreenSpace/DeferredFogParams.inl>
  27. #include <Atom/Feature/ParamMacros/EndParams.inl>
  28. #undef SERIALIZE_CLASS
  29. ->Field("IsEnabled", &DeferredFogComponentConfig::m_enabled)
  30. ->Field("UseNoiseTextureShaderOption", &DeferredFogComponentConfig::m_useNoiseTextureShaderOption)
  31. ->Field("EnableFogLayerShaderOption", &DeferredFogComponentConfig::m_enableFogLayerShaderOption)
  32. ;
  33. }
  34. }
  35. void DeferredFogComponentConfig::CopySettingsFrom(DeferredFogSettingsInterface* settings)
  36. {
  37. if (!settings)
  38. {
  39. return;
  40. }
  41. #define COPY_SOURCE settings
  42. #define AZ_GFX_COMMON_PARAM(ValueType, Name, MemberName, DefaultValue) \
  43. MemberName = COPY_SOURCE->Get##Name(); \
  44. #include <Atom/Feature/ParamMacros/MapParamCommon.inl>
  45. #include <Atom/Feature/ScreenSpace/DeferredFogParams.inl>
  46. #include <Atom/Feature/ParamMacros/EndParams.inl>
  47. #undef COPY_SOURCE
  48. }
  49. void DeferredFogComponentConfig::CopySettingsTo(DeferredFogSettingsInterface* settings)
  50. {
  51. if (!settings)
  52. {
  53. return;
  54. }
  55. #define COPY_TARGET settings
  56. #define AZ_GFX_COMMON_PARAM(ValueType, Name, MemberName, DefaultValue) \
  57. COPY_TARGET->Set##Name(MemberName); \
  58. #include <Atom/Feature/ParamMacros/MapParamCommon.inl>
  59. #include <Atom/Feature/ScreenSpace/DeferredFogParams.inl>
  60. #include <Atom/Feature/ParamMacros/EndParams.inl>
  61. #undef COPY_TARGET
  62. }
  63. } // namespace Render
  64. } // namespace AZ