Merge pull request #1050 from aws-lumberyard-dev/Atom/mnaumov/ATOM-15631
[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
|
||||
|
||||
+27
-1
@@ -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()
|
||||
@@ -71,11 +96,12 @@ namespace AZ
|
||||
;
|
||||
|
||||
serializeContext->Class<DisplayMapperConfigurationDescriptor>()
|
||||
->Version(1)
|
||||
->Version(2)
|
||||
->Field("Name", &DisplayMapperConfigurationDescriptor::m_name)
|
||||
->Field("OperationType", &DisplayMapperConfigurationDescriptor::m_operationType)
|
||||
->Field("LdrGradingLutEnabled", &DisplayMapperConfigurationDescriptor::m_ldrGradingLutEnabled)
|
||||
->Field("LdrColorGradingLut", &DisplayMapperConfigurationDescriptor::m_ldrColorGradingLut)
|
||||
->Field("AcesParameterOverrides", &DisplayMapperConfigurationDescriptor::m_acesParameterOverrides)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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:
|
||||
AZ_RTTI(AZ::Render::DisplayMapperComponentRequests, "{9E2E8AF5-1176-44B4-A461-E09867753349}");
|
||||
|
||||
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
|
||||
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
|
||||
|
||||
//! Load preconfigured preset for specific ODT mode
|
||||
virtual void LoadPreset(OutputDeviceTransformType preset) = 0;
|
||||
//! Set display mapper type
|
||||
virtual void SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType) = 0;
|
||||
//! Get display mapper type
|
||||
virtual DisplayMapperOperationType GetDisplayMapperOperationType() const = 0;
|
||||
//! Set ACES parameter overrides for ACES mapping, display mapper must be set to Aces to see the difference
|
||||
virtual void SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides) = 0;
|
||||
//! Get ACES parameter overrides
|
||||
virtual const AcesParameterOverrides& GetAcesParameterOverrides() const = 0;
|
||||
|
||||
// Enable or disable ACES parameter overrides
|
||||
virtual void SetOverrideAcesParameters(bool value) = 0;
|
||||
// Check if ACES parameters are overriding default preset values
|
||||
virtual bool GetOverrideAcesParameters() const = 0;
|
||||
|
||||
// Set gamma adjustment to compensate for dim surround
|
||||
virtual void SetAlterSurround(bool value) = 0;
|
||||
// Get gamma adjustment to compensate for dim surround
|
||||
virtual bool GetAlterSurround() const = 0;
|
||||
|
||||
// Set desaturation to compensate for luminance difference
|
||||
virtual void SetApplyDesaturation(bool value) = 0;
|
||||
// Get desaturation to compensate for luminance difference
|
||||
virtual bool GetApplyDesaturation() const = 0;
|
||||
|
||||
// Set color appearance transform (CAT) from ACES white point to assumed observer adapted white point
|
||||
virtual void SetApplyCATD60toD65(bool value) = 0;
|
||||
// Get color appearance transform (CAT) from ACES white point to assumed observer adapted white point
|
||||
virtual bool GetApplyCATD60toD65() const = 0;
|
||||
|
||||
// Set reference black luminance value
|
||||
virtual void SetCinemaLimitsBlack(float value) = 0;
|
||||
// Get reference black luminance value
|
||||
virtual float GetCinemaLimitsBlack() const = 0;
|
||||
|
||||
// Set reference white luminance value
|
||||
virtual void SetCinemaLimitsWhite(float value) = 0;
|
||||
// Get reference white luminance value
|
||||
virtual float GetCinemaLimitsWhite() const = 0;
|
||||
|
||||
// Set min luminance value
|
||||
virtual void SetMinPoint(float value) = 0;
|
||||
// Get min luminance value
|
||||
virtual float GetMinPoint() const = 0;
|
||||
|
||||
// Set mid luminance value
|
||||
virtual void SetMidPoint(float value) = 0;
|
||||
// Get mid luminance value
|
||||
virtual float GetMidPoint() const = 0;
|
||||
|
||||
// Set max luminance value
|
||||
virtual void SetMaxPoint(float value) = 0;
|
||||
// Get max luminance value
|
||||
virtual float GetMaxPoint() const = 0;
|
||||
|
||||
// Set gamma adjustment value
|
||||
virtual void SetSurroundGamma(float value) = 0;
|
||||
// Get gamma adjustment value
|
||||
virtual float GetSurroundGamma() const = 0;
|
||||
|
||||
// Set optional gamma value that is applied as basic gamma curve OETF
|
||||
virtual void SetGamma(float value) = 0;
|
||||
// Get optional gamma value that is applied as basic gamma curve OETF
|
||||
virtual float GetGamma() const = 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 OnDisplayMapperOperationTypeUpdated([[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
|
||||
|
||||
+282
@@ -10,6 +10,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "AtomLyIntegration/CommonFeatures/CoreLights/AreaLightBus.h"
|
||||
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
@@ -32,6 +34,69 @@ namespace AZ
|
||||
->Version(0)
|
||||
->Field("Configuration", &DisplayMapperComponentController::m_configuration);
|
||||
}
|
||||
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->EBus<DisplayMapperComponentRequestBus>("DisplayMapperComponentRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Category, "render")
|
||||
->Attribute(AZ::Script::Attributes::Module, "render")
|
||||
// LoadPreset
|
||||
->Event("LoadPreset", &DisplayMapperComponentRequestBus::Events::LoadPreset)
|
||||
// DisplayMapperOperationType
|
||||
->Event("SetDisplayMapperOperationType", &DisplayMapperComponentRequestBus::Events::SetDisplayMapperOperationType)
|
||||
->Event("GetDisplayMapperOperationType", &DisplayMapperComponentRequestBus::Events::GetDisplayMapperOperationType)
|
||||
->VirtualProperty("DisplayMapperOperationType", "GetDisplayMapperOperationType", "SetDisplayMapperOperationType")
|
||||
// AcesParameterOverrides
|
||||
->Event("SetAcesParameterOverrides", &DisplayMapperComponentRequestBus::Events::SetAcesParameterOverrides)
|
||||
->Event("GetAcesParameterOverrides", &DisplayMapperComponentRequestBus::Events::GetAcesParameterOverrides)
|
||||
->VirtualProperty("AcesParameterOverrides", "GetAcesParameterOverrides", "SetAcesParameterOverrides")
|
||||
// OverrideAcesParameters
|
||||
->Event("SetOverrideAcesParameters", &DisplayMapperComponentRequestBus::Events::SetOverrideAcesParameters)
|
||||
->Event("GetOverrideAcesParameters", &DisplayMapperComponentRequestBus::Events::GetOverrideAcesParameters)
|
||||
->VirtualProperty("OverrideAcesParameters", "GetOverrideAcesParameters", "SetOverrideAcesParameters")
|
||||
// AlterSurround
|
||||
->Event("SetAlterSurround", &DisplayMapperComponentRequestBus::Events::SetAlterSurround)
|
||||
->Event("GetAlterSurround", &DisplayMapperComponentRequestBus::Events::GetAlterSurround)
|
||||
->VirtualProperty("AlterSurround", "GetAlterSurround", "SetAlterSurround")
|
||||
// ApplyDesaturation
|
||||
->Event("SetApplyDesaturation", &DisplayMapperComponentRequestBus::Events::SetApplyDesaturation)
|
||||
->Event("GetApplyDesaturation", &DisplayMapperComponentRequestBus::Events::GetApplyDesaturation)
|
||||
->VirtualProperty("ApplyDesaturation", "GetApplyDesaturation", "SetApplyDesaturation")
|
||||
// ApplyCATD60toD65
|
||||
->Event("SetApplyCATD60toD65", &DisplayMapperComponentRequestBus::Events::SetApplyCATD60toD65)
|
||||
->Event("GetApplyCATD60toD65", &DisplayMapperComponentRequestBus::Events::GetApplyCATD60toD65)
|
||||
->VirtualProperty("ApplyCATD60toD65", "GetApplyCATD60toD65", "SetApplyCATD60toD65")
|
||||
// CinemaLimitsBlack
|
||||
->Event("SetCinemaLimitsBlack", &DisplayMapperComponentRequestBus::Events::SetCinemaLimitsBlack)
|
||||
->Event("GetCinemaLimitsBlack", &DisplayMapperComponentRequestBus::Events::GetCinemaLimitsBlack)
|
||||
->VirtualProperty("CinemaLimitsBlack", "GetCinemaLimitsBlack", "SetCinemaLimitsBlack")
|
||||
// CinemaLimitsWhite
|
||||
->Event("SetCinemaLimitsWhite", &DisplayMapperComponentRequestBus::Events::SetCinemaLimitsWhite)
|
||||
->Event("GetCinemaLimitsWhite", &DisplayMapperComponentRequestBus::Events::GetCinemaLimitsWhite)
|
||||
->VirtualProperty("CinemaLimitsWhite", "GetCinemaLimitsWhite", "SetCinemaLimitsWhite")
|
||||
// MinPoint
|
||||
->Event("SetMinPoint", &DisplayMapperComponentRequestBus::Events::SetMinPoint)
|
||||
->Event("GetMinPoint", &DisplayMapperComponentRequestBus::Events::GetMinPoint)
|
||||
->VirtualProperty("MinPoint", "GetMinPoint", "SetMinPoint")
|
||||
// MidPoint
|
||||
->Event("SetMidPoint", &DisplayMapperComponentRequestBus::Events::SetMidPoint)
|
||||
->Event("GetMidPoint", &DisplayMapperComponentRequestBus::Events::GetMidPoint)
|
||||
->VirtualProperty("MidPoint", "GetMidPoint", "SetMidPoint")
|
||||
// MaxPoint
|
||||
->Event("SetMaxPoint", &DisplayMapperComponentRequestBus::Events::SetMaxPoint)
|
||||
->Event("GetMaxPoint", &DisplayMapperComponentRequestBus::Events::GetMaxPoint)
|
||||
->VirtualProperty("MaxPoint", "GetMaxPoint", "SetMaxPoint")
|
||||
// SurroundGamma
|
||||
->Event("SetSurroundGamma", &DisplayMapperComponentRequestBus::Events::SetSurroundGamma)
|
||||
->Event("GetSurroundGamma", &DisplayMapperComponentRequestBus::Events::GetSurroundGamma)
|
||||
->VirtualProperty("SurroundGamma", "GetSurroundGamma", "SetSurroundGamma")
|
||||
// Gamma
|
||||
->Event("SetGamma", &DisplayMapperComponentRequestBus::Events::SetGamma)
|
||||
->Event("GetGamma", &DisplayMapperComponentRequestBus::Events::GetGamma)
|
||||
->VirtualProperty("Gamma", "GetGamma", "SetGamma")
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
@@ -57,10 +122,14 @@ namespace AZ
|
||||
void DisplayMapperComponentController::Activate(EntityId entityId)
|
||||
{
|
||||
m_entityId = entityId;
|
||||
|
||||
DisplayMapperComponentRequestBus::Handler::BusConnect(m_entityId);
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::Deactivate()
|
||||
{
|
||||
DisplayMapperComponentRequestBus::Handler::BusDisconnect(m_entityId);
|
||||
|
||||
m_postProcessInterface = nullptr;
|
||||
m_entityId.SetInvalid();
|
||||
}
|
||||
@@ -76,6 +145,219 @@ 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::OnDisplayMapperOperationTypeUpdated,
|
||||
m_configuration.m_displayMapperOperation);
|
||||
}
|
||||
}
|
||||
|
||||
DisplayMapperOperationType DisplayMapperComponentController::GetDisplayMapperOperationType() const
|
||||
{
|
||||
return 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);
|
||||
}
|
||||
|
||||
const AcesParameterOverrides& DisplayMapperComponentController::GetAcesParameterOverrides() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetOverrideAcesParameters(bool value)
|
||||
{
|
||||
if (m_configuration.m_acesParameterOverrides.m_overrideDefaults == value)
|
||||
{
|
||||
return; // prevents flickering when set via TrackView
|
||||
}
|
||||
m_configuration.m_acesParameterOverrides.m_overrideDefaults = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayMapperComponentController::GetOverrideAcesParameters() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_overrideDefaults;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetAlterSurround(bool value)
|
||||
{
|
||||
if (m_configuration.m_acesParameterOverrides.m_alterSurround != value)
|
||||
{
|
||||
return; // prevents flickering when set via TrackView
|
||||
}
|
||||
m_configuration.m_acesParameterOverrides.m_alterSurround = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayMapperComponentController::GetAlterSurround() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_alterSurround;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetApplyDesaturation(bool value)
|
||||
{
|
||||
if (m_configuration.m_acesParameterOverrides.m_applyDesaturation != value)
|
||||
{
|
||||
return; // prevents flickering when set via TrackView
|
||||
}
|
||||
m_configuration.m_acesParameterOverrides.m_applyDesaturation = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayMapperComponentController::GetApplyDesaturation() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_applyDesaturation;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetApplyCATD60toD65(bool value)
|
||||
{
|
||||
if (m_configuration.m_acesParameterOverrides.m_applyCATD60toD65 != value)
|
||||
{
|
||||
return; // prevents flickering when set via TrackView
|
||||
}
|
||||
m_configuration.m_acesParameterOverrides.m_applyCATD60toD65 = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayMapperComponentController::GetApplyCATD60toD65() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_applyCATD60toD65;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetCinemaLimitsBlack(float value)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides.m_cinemaLimitsBlack = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
float DisplayMapperComponentController::GetCinemaLimitsBlack() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_cinemaLimitsBlack;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetCinemaLimitsWhite(float value)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides.m_cinemaLimitsWhite = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
float DisplayMapperComponentController::GetCinemaLimitsWhite() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_cinemaLimitsWhite;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetMinPoint(float value)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides.m_minPoint = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
float DisplayMapperComponentController::GetMinPoint() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_minPoint;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetMidPoint(float value)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides.m_midPoint = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
float DisplayMapperComponentController::GetMidPoint() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_midPoint;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetMaxPoint(float value)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides.m_maxPoint = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
float DisplayMapperComponentController::GetMaxPoint() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_maxPoint;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetSurroundGamma(float value)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides.m_surroundGamma = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
float DisplayMapperComponentController::GetSurroundGamma() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_surroundGamma;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::SetGamma(float value)
|
||||
{
|
||||
m_configuration.m_acesParameterOverrides.m_gamma = value;
|
||||
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
|
||||
{
|
||||
OnConfigChanged();
|
||||
}
|
||||
}
|
||||
|
||||
float DisplayMapperComponentController::GetGamma() const
|
||||
{
|
||||
return m_configuration.m_acesParameterOverrides.m_gamma;
|
||||
}
|
||||
|
||||
void DisplayMapperComponentController::OnConfigChanged()
|
||||
{
|
||||
// Register the configuration with the AcesDisplayMapperFeatureProcessor for this scene.
|
||||
|
||||
+34
@@ -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,35 @@ namespace AZ
|
||||
void SetConfiguration(const DisplayMapperComponentConfig& config);
|
||||
const DisplayMapperComponentConfig& GetConfiguration() const;
|
||||
|
||||
//! DisplayMapperComponentRequestBus::Handler overrides...
|
||||
void LoadPreset(OutputDeviceTransformType preset) override;
|
||||
void SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType) override;
|
||||
DisplayMapperOperationType GetDisplayMapperOperationType() const override;
|
||||
void SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides) override;
|
||||
const AcesParameterOverrides& GetAcesParameterOverrides() const override;
|
||||
void SetOverrideAcesParameters(bool value) override;
|
||||
bool GetOverrideAcesParameters() const override;
|
||||
void SetAlterSurround(bool value) override;
|
||||
bool GetAlterSurround() const override;
|
||||
void SetApplyDesaturation(bool value) override;
|
||||
bool GetApplyDesaturation() const override;
|
||||
void SetApplyCATD60toD65(bool value) override;
|
||||
bool GetApplyCATD60toD65() const override;
|
||||
void SetCinemaLimitsBlack(float value) override;
|
||||
float GetCinemaLimitsBlack() const override;
|
||||
void SetCinemaLimitsWhite(float value) override;
|
||||
float GetCinemaLimitsWhite() const override;
|
||||
void SetMinPoint(float value) override;
|
||||
float GetMinPoint() const override;
|
||||
void SetMidPoint(float value) override;
|
||||
float GetMidPoint() const override;
|
||||
void SetMaxPoint(float value) override;
|
||||
float GetMaxPoint() const override;
|
||||
void SetSurroundGamma(float value) override;
|
||||
float GetSurroundGamma() const override;
|
||||
void SetGamma(float value) override;
|
||||
float GetGamma() const override;
|
||||
|
||||
private:
|
||||
AZ_DISABLE_COPY(DisplayMapperComponentController);
|
||||
|
||||
|
||||
+53
-17
@@ -10,10 +10,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h"
|
||||
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <PostProcess/DisplayMapper/EditorDisplayMapperComponent.h>
|
||||
#include <Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -54,54 +53,89 @@ namespace AZ
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
|
||||
// m_overrideDefaults
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_overrideDefaults, "Override Defaults",
|
||||
"When enabled allows parameter overrides for ACES configuration")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
// m_alterSurround
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_alterSurround, "Alter Surround",
|
||||
"Apply gamma adjustment to compensate for dim surround")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
// m_applyDesaturation
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_applyDesaturation, "Alter Desaturation",
|
||||
"Apply desaturation to compensate for luminance difference")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
// m_applyCATD60toD65
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_applyCATD60toD65, "Alter CAT D60 to D65",
|
||||
"Apply Color appearance transform (CAT) from ACES white point to assumed observer adapted white point")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
|
||||
// m_cinemaLimitsBlack
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsBlack,
|
||||
Edit::UIHandlers::Slider, &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)
|
||||
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
// m_cinemaLimitsWhite
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsWhite,
|
||||
Edit::UIHandlers::Slider, &AcesParameterOverrides::m_cinemaLimitsWhite,
|
||||
"Cinema Limit (white)",
|
||||
"Reference white luminance value")
|
||||
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_cinemaLimitsBlack)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 4000.f)
|
||||
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
// m_minPoint
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_minPoint, "Min Point (luminance)",
|
||||
Edit::UIHandlers::Slider, &AcesParameterOverrides::m_minPoint, "Min Point (luminance)",
|
||||
"Linear extension below this")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.002f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, &AcesParameterOverrides::m_midPoint)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues)
|
||||
|
||||
// m_midPoint
|
||||
->DataElement(Edit::UIHandlers::Slider, &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::AttributesAndValues)
|
||||
|
||||
// m_maxPoint
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_midPoint, "Mid Point (luminance)",
|
||||
"Middle gray")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
->DataElement(
|
||||
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_maxPoint, "Max Point (luminance)",
|
||||
Edit::UIHandlers::Slider, &AcesParameterOverrides::m_maxPoint, "Max Point (luminance)",
|
||||
"Linear extension above this")
|
||||
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_midPoint)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 4000.f)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues)
|
||||
|
||||
// m_surroundGamma
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Slider, &AcesParameterOverrides::m_surroundGamma, "Surround Gamma",
|
||||
"Gamma adjustment to be applied to compensate for the condition of the viewing environment")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.6f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 1.2f)
|
||||
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
// m_gamma
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &AcesParameterOverrides::m_surroundGamma, "Surround Gamma",
|
||||
"Gamma adjustment to be applied to compensate for the condition of the viewing environment")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &AcesParameterOverrides::m_gamma, "Gamma",
|
||||
AZ::Edit::UIHandlers::Slider, &AcesParameterOverrides::m_gamma, "Gamma",
|
||||
"Optional gamma value that is applied as basic gamma curve OETF")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.2f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 4.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
|
||||
// Load preset group
|
||||
@@ -145,6 +179,8 @@ namespace AZ
|
||||
|
||||
if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->Class<EditorDisplayMapperComponent>()->RequestBus("DisplayMapperComponentRequestBus");
|
||||
|
||||
behaviorContext->ConstantProperty("EditorDisplayMapperComponentTypeId", BehaviorConstant(Uuid(EditorDisplayMapperComponentTypeId)))
|
||||
->Attribute(AZ::Script::Attributes::Module, "render")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
|
||||
|
||||
+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