[ATOM-15631] First pass on exposing Display Mapper properties to Behavior Context
This commit is contained in:
@@ -177,4 +177,5 @@ namespace AZ
|
||||
} // namespace Render
|
||||
|
||||
AZ_TYPE_INFO_SPECIALIZE(Render::DisplayMapperOperationType, "{41CA80B1-9E0D-41FB-A235-9638D2A905A5}");
|
||||
AZ_TYPE_INFO_SPECIALIZE(Render::OutputDeviceTransformType, "{B94085B7-C0D4-466A-A791-188A4559EC8D}");
|
||||
} // namespace AZ
|
||||
|
||||
+5
-3
@@ -12,11 +12,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
|
||||
#include <ACES/Aces.h>
|
||||
|
||||
#include <Atom/RPI.Reflect/Pass/PassAsset.h>
|
||||
#include <Atom/RPI.Reflect/Pass/PassData.h>
|
||||
#include <Atom/RPI.Reflect/System/AnyAsset.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -33,6 +35,7 @@ namespace AZ
|
||||
AZ_TYPE_INFO(AcesParameterOverrides, "{3EE8C0D4-3792-46C0-B91C-B89A81C36B91}");
|
||||
static void Reflect(ReflectContext* context);
|
||||
|
||||
// Load preconfigured preset for specific ODT mode defined by m_preset
|
||||
void LoadPreset();
|
||||
|
||||
// When enabled allows parameter overrides for ACES configuration
|
||||
@@ -98,6 +101,5 @@ namespace AZ
|
||||
|
||||
DisplayMapperConfigurationDescriptor m_config;
|
||||
};
|
||||
|
||||
} // namespace RPI
|
||||
} // namespace Render
|
||||
} // namespace AZ
|
||||
|
||||
+26
@@ -23,6 +23,15 @@ namespace AZ
|
||||
{
|
||||
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Enum<OutputDeviceTransformType>()
|
||||
->Version(0)
|
||||
->Value("48Nits", OutputDeviceTransformType::OutputDeviceTransformType_48Nits)
|
||||
->Value("1000Nits", OutputDeviceTransformType::OutputDeviceTransformType_1000Nits)
|
||||
->Value("2000Nits", OutputDeviceTransformType::OutputDeviceTransformType_2000Nits)
|
||||
->Value("4000Nits", OutputDeviceTransformType::OutputDeviceTransformType_4000Nits)
|
||||
->Value("NumOutputDeviceTransformTypes", OutputDeviceTransformType::NumOutputDeviceTransformTypes)
|
||||
;
|
||||
|
||||
serializeContext->Class<AcesParameterOverrides>()
|
||||
->Version(0)
|
||||
->Field("OverrideDefaults", &AcesParameterOverrides::m_overrideDefaults)
|
||||
@@ -38,6 +47,22 @@ namespace AZ
|
||||
->Field("SurroundGamma", &AcesParameterOverrides::m_surroundGamma)
|
||||
->Field("Gamma", &AcesParameterOverrides::m_gamma);
|
||||
}
|
||||
|
||||
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->Class<AcesParameterOverrides>("AcesParameterOverrides")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Category, "render")
|
||||
->Attribute(AZ::Script::Attributes::Module, "render")
|
||||
->Constructor()
|
||||
->Method("LoadPreset", &AcesParameterOverrides::LoadPreset)
|
||||
->Property("overrideDefaults", BehaviorValueProperty(&AcesParameterOverrides::m_overrideDefaults))
|
||||
->Property("preset", BehaviorValueProperty(&AcesParameterOverrides::m_preset))
|
||||
->Property("alterSurround", BehaviorValueProperty(&AcesParameterOverrides::m_alterSurround))
|
||||
->Property("applyDesaturation", BehaviorValueProperty(&AcesParameterOverrides::m_applyDesaturation))
|
||||
->Property("applyCATD60toD65", BehaviorValueProperty(&AcesParameterOverrides::m_applyCATD60toD65))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void AcesParameterOverrides::LoadPreset()
|
||||
@@ -76,6 +101,7 @@ namespace AZ
|
||||
->Field("OperationType", &DisplayMapperConfigurationDescriptor::m_operationType)
|
||||
->Field("LdrGradingLutEnabled", &DisplayMapperConfigurationDescriptor::m_ldrGradingLutEnabled)
|
||||
->Field("LdrColorGradingLut", &DisplayMapperConfigurationDescriptor::m_ldrColorGradingLut)
|
||||
->Field("AcesParameterOverrides", &DisplayMapperConfigurationDescriptor::m_acesParameterOverrides)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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 <AzCore/Component/ComponentBus.h>
|
||||
#include <Atom/Feature/Material/MaterialAssignment.h>
|
||||
#include <ACES/Aces.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Render
|
||||
{
|
||||
struct AcesParameterOverrides;
|
||||
|
||||
//! DisplayMapperComponentRequests provides an interface to request operations on a DisplayMapperComponent
|
||||
class DisplayMapperComponentRequests
|
||||
: public ComponentBus
|
||||
{
|
||||
public:
|
||||
//! Load preconfigured preset for specific ODT mode
|
||||
virtual void LoadPreset(OutputDeviceTransformType preset) = 0;
|
||||
//! Set display mapper type
|
||||
virtual void SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType) = 0;
|
||||
//! Set custom ACES parameters for ACES mapping, display mapper must be set to Aces to see the difference
|
||||
virtual void SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides) = 0;
|
||||
};
|
||||
using DisplayMapperComponentRequestBus = EBus<DisplayMapperComponentRequests>;
|
||||
|
||||
//! DisplayMapperComponent can send out notifications on the DisplayMapperComponentNotifications
|
||||
class DisplayMapperComponentNotifications : public ComponentBus
|
||||
{
|
||||
public:
|
||||
//! Notifies that display mapper type changed
|
||||
virtual void OntDisplayMapperOperationTypeUpdated([[maybe_unused]] const DisplayMapperOperationType& displayMapperOperationType)
|
||||
{
|
||||
}
|
||||
|
||||
//! Notifies that ACES parameter overrides changed
|
||||
virtual void OnAcesParameterOverridesUpdated([[maybe_unused]] const AcesParameterOverrides& acesParameterOverrides)
|
||||
{
|
||||
}
|
||||
};
|
||||
using DisplayMapperComponentNotificationBus = EBus<DisplayMapperComponentNotifications>;
|
||||
|
||||
} // namespace Render
|
||||
} // namespace AZ
|
||||
-1
@@ -39,6 +39,5 @@ namespace AZ
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Render
|
||||
} // namespace AZ
|
||||
|
||||
+33
@@ -76,6 +76,39 @@ namespace AZ
|
||||
return m_configuration;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::LoadPreset(OutputDeviceTransformType preset)
|
||||
{
|
||||
AcesParameterOverrides propertyOverrides;
|
||||
propertyOverrides.m_preset = preset;
|
||||
propertyOverrides.m_overrideDefaults = true;
|
||||
propertyOverrides.LoadPreset();
|
||||
SetAcesParameterOverrides(propertyOverrides);
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType)
|
||||
{
|
||||
if (m_configuration.m_displayMapperOperation != displayMapperOperationType)
|
||||
{
|
||||
m_configuration.m_displayMapperOperation = displayMapperOperationType;
|
||||
OnConfigChanged();
|
||||
DisplayMapperComponentNotificationBus::Broadcast(
|
||||
&DisplayMapperComponentNotificationBus::Handler::OntDisplayMapperOperationTypeUpdated,
|
||||
m_configuration.m_displayMapperOperation);
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides = parameterOverrides;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
DisplayMapperComponentNotificationBus::Broadcast(
|
||||
&DisplayMapperComponentNotificationBus::Handler::OnAcesParameterOverridesUpdated,
|
||||
m_configuration.m_acesParameterOverrides);
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::OnConfigChanged()
|
||||
{
|
||||
// Register the configuration with the AcesDisplayMapperFeatureProcessor for this scene.
|
||||
|
||||
+10
@@ -12,10 +12,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
|
||||
#include <AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentBus.h>
|
||||
|
||||
#include <Atom/Feature/PostProcess/PostProcessSettingsInterface.h>
|
||||
#include <Atom/Feature/PostProcess/PostProcessFeatureProcessorInterface.h>
|
||||
@@ -24,7 +26,10 @@ namespace AZ
|
||||
{
|
||||
namespace Render
|
||||
{
|
||||
struct AcesParameterOverrides;
|
||||
|
||||
class DisplayMapperComponentController final
|
||||
: DisplayMapperComponentRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
friend class EditorDisplayMapperComponent;
|
||||
@@ -43,6 +48,11 @@ namespace AZ
|
||||
void SetConfiguration(const DisplayMapperComponentConfig& config);
|
||||
const DisplayMapperComponentConfig& GetConfiguration() const;
|
||||
|
||||
//! DisplayMapperComponentRequestBus::Handler overrides...
|
||||
void LoadPreset(OutputDeviceTransformType preset) override;
|
||||
void SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType) override;
|
||||
void SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides) override;
|
||||
|
||||
private:
|
||||
AZ_DISABLE_COPY(DisplayMapperComponentController);
|
||||
|
||||
|
||||
+11
-2
@@ -76,23 +76,32 @@ namespace AZ
|
||||
Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsBlack,
|
||||
"Cinema Limit (black)",
|
||||
"Reference black luminance value")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.02f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, &AcesParameterOverrides::m_cinemaLimitsWhite)
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsWhite,
|
||||
"Cinema Limit (white)",
|
||||
"Reference white luminance value")
|
||||
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_cinemaLimitsBlack)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 4000)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_minPoint, "Min Point (luminance)",
|
||||
"Linear extension below this")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.002f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, &AcesParameterOverrides::m_midPoint)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_midPoint, "Mid Point (luminance)",
|
||||
"Middle gray")
|
||||
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_midPoint, "Mid Point (luminance)", "Middle gray")
|
||||
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_minPoint)
|
||||
->Attribute(AZ::Edit::Attributes::Max, &AcesParameterOverrides::m_maxPoint)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_maxPoint, "Max Point (luminance)",
|
||||
"Linear extension above this")
|
||||
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_midPoint)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 4000)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
->DataElement(
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ set(FILES
|
||||
Include/AtomLyIntegration/CommonFeatures/PostProcess/Bloom/BloomComponentConfig.h
|
||||
Include/AtomLyIntegration/CommonFeatures/PostProcess/DepthOfField/DepthOfFieldBus.h
|
||||
Include/AtomLyIntegration/CommonFeatures/PostProcess/DepthOfField/DepthOfFieldComponentConfig.h
|
||||
Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentBus.h
|
||||
Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h
|
||||
Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConstants.h
|
||||
Include/AtomLyIntegration/CommonFeatures/PostProcess/ExposureControl/ExposureControlBus.h
|
||||
|
||||
Reference in New Issue
Block a user