[ATOM-15631] First pass on exposing Display Mapper properties to Behavior Context
This commit is contained in:
+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