Editor.HDRSupport
Editor.HDRSupport
#Overview
name: Editor.HDRSupport
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Sets whether or not we should allow the editor to run on HDR monitors
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Editor.HDRSupport is to control whether the Unreal Editor should run on HDR monitors. This setting is part of the editor’s experimental features and affects the rendering system, specifically the display output.
This setting variable is primarily used in the Unreal Editor subsystem and the D3D11RHI (Direct3D 11 Rendering Hardware Interface) module. It’s referenced in the UnrealEd and Windows D3D11 Viewport components of the engine.
The value of this variable is set through the UEditorExperimentalSettings class. It’s initialized in the PostInitProperties function and can be changed via the PostEditChangeProperty function when the corresponding setting is modified in the editor.
The Editor.HDRSupport variable interacts directly with the bHDREditor property of the UEditorExperimentalSettings class. When bHDREditor is changed, the Editor.HDRSupport console variable is updated accordingly.
Developers should be aware that this is an experimental feature, and enabling HDR support in the editor may have performance implications or cause unexpected behavior. It’s important to test thoroughly when enabling this feature.
Best practices for using this variable include:
- Only enable it if you’re specifically working on HDR content or testing HDR functionality.
- Ensure your monitor and graphics hardware support HDR before enabling.
- Be prepared for potential performance impacts or visual discrepancies when enabled.
Regarding the associated variable CVarEditorHDRSupport:
The purpose of CVarEditorHDRSupport is to provide a programmatic way to access and modify the Editor.HDRSupport setting within the C++ code.
This console variable is used in the UnrealEd module, specifically in the SettingsClasses.cpp file. It’s created as a static TAutoConsoleVariable, which allows it to be accessed globally throughout the engine.
The value of CVarEditorHDRSupport is set based on the bHDREditor property in the UEditorExperimentalSettings class. It’s updated whenever the bHDREditor property changes.
CVarEditorHDRSupport interacts closely with the bHDREditor property and the Editor.HDRSupport console variable. They all represent the same setting but in different contexts (C++ code, UObject property, and console variable respectively).
Developers should be aware that changes to CVarEditorHDRSupport will affect the editor’s HDR behavior. It’s important to use the appropriate method to change this setting based on the context (through the settings UI, directly modifying the UObject property, or using the console variable).
Best practices for using CVarEditorHDRSupport include:
- Use it for runtime checks of whether HDR is enabled in the editor.
- Be cautious about changing its value directly, as it should typically be modified through the editor settings.
- Consider any performance or compatibility implications when reading or modifying this value.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:170
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarEditorHDRSupport(
TEXT("Editor.HDRSupport"),
0,
TEXT("Sets whether or not we should allow the editor to run on HDR monitors"),
ECVF_Default);
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
TEXT("Editor.HDRNITLevel"),
#Loc: <Workspace>/Engine/Source/Runtime/Windows/D3D11RHI/Private/Windows/WindowsD3D11Viewport.cpp:386
Scope (from outer to inner):
file
function void FD3D11Viewport::CheckHDRMonitorStatus
Source code excerpt:
#if WITH_EDITOR
static auto CVarHDREnable = IConsoleManager::Get().FindConsoleVariable(TEXT("Editor.HDRSupport"));
if (CVarHDREnable->GetInt() != 0)
{
FlushRenderingCommands();
EnsureColorSpace(SwapChain, DisplayColorGamut, DisplayOutputFormat, PixelFormat);
}
#Associated Variable and Callsites
This variable is associated with another variable named CVarEditorHDRSupport
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:169
Scope: file
Source code excerpt:
*****************************************************************************/
static TAutoConsoleVariable<int32> CVarEditorHDRSupport(
TEXT("Editor.HDRSupport"),
0,
TEXT("Sets whether or not we should allow the editor to run on HDR monitors"),
ECVF_Default);
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:209
Scope (from outer to inner):
file
function void UEditorExperimentalSettings::PostInitProperties
Source code excerpt:
PRAGMA_ENABLE_DEPRECATION_WARNINGS
CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
Super::PostInitProperties();
}
void UEditorExperimentalSettings::PostEditChangeProperty( struct FPropertyChangedEvent& PropertyChangedEvent )
{
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:226
Scope (from outer to inner):
file
function void UEditorExperimentalSettings::PostEditChangeProperty
Source code excerpt:
else if (Name == GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bHDREditor))
{
CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
}
else if (Name == GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, HDREditorNITLevel))
{
CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
}