Editor.HDRNITLevel
Editor.HDRNITLevel
#Overview
name: Editor.HDRNITLevel
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Sets The desired NIT level of the editor when running on HDR
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Editor.HDRNITLevel is to set the desired NIT (Nits) level of the editor when running in High Dynamic Range (HDR) mode. This setting is primarily used for the rendering system, specifically for HDR display output in the Unreal Editor.
This setting variable is utilized by several Unreal Engine subsystems and modules:
- The Renderer module, particularly in post-processing passes for device encoding and tonemapping.
- The SlateRHIRenderer module, which is responsible for rendering the editor’s user interface.
- The UnrealEd module, which handles editor-specific settings and configurations.
The value of this variable is set in multiple ways:
- It’s initially set to a default value of 160.0f when the console variable is created.
- It can be modified through the editor’s experimental settings (UEditorExperimentalSettings).
- It can be changed at runtime via console commands.
The associated variable CVarEditorHDRNITLevel interacts closely with Editor.HDRNITLevel. They share the same value, and CVarEditorHDRNITLevel is used to set and retrieve the value in the C++ code.
Developers should be aware of the following when using this variable:
- It only affects the editor’s display output when running in HDR mode.
- Changing this value will impact the perceived brightness and color accuracy of the editor interface and viewport.
- The optimal value may vary depending on the capabilities of the HDR display being used.
Best practices when using this variable include:
- Calibrate the value based on the specific HDR display being used for development.
- Consider the target display capabilities of the end-users when setting this value.
- Use in conjunction with other HDR-related settings for a comprehensive HDR setup in the editor.
Regarding the associated variable CVarEditorHDRNITLevel:
The purpose of CVarEditorHDRNITLevel is to provide a programmatic interface to the Editor.HDRNITLevel setting. It allows C++ code to easily access and modify the HDR NIT level setting.
This console variable is used within the UnrealEd module, specifically in the UEditorExperimentalSettings class. It’s used to synchronize the editor’s HDR NIT level setting with the project settings.
The value of CVarEditorHDRNITLevel is set in the following ways:
- Initially, it’s set to the same default value as Editor.HDRNITLevel (160.0f).
- It’s updated whenever the HDREditorNITLevel property in UEditorExperimentalSettings is changed.
Developers should be aware that changes to CVarEditorHDRNITLevel will directly affect the Editor.HDRNITLevel setting, and vice versa. They should use this variable when they need to programmatically access or modify the HDR NIT level within C++ code.
Best practices for using CVarEditorHDRNITLevel include:
- Use it for reading the current HDR NIT level in C++ code that needs this information.
- When modifying the value, consider the implications on the editor’s display output and user experience.
- Ensure that changes to this variable are properly synchronized with the UEditorExperimentalSettings to maintain consistency across the editor.
#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:176
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
TEXT("Editor.HDRNITLevel"),
160.0f,
TEXT("Sets The desired NIT level of the editor when running on HDR"),
ECVF_Default);
UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
: Super(ObjectInitializer)
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessDeviceEncodingOnly.cpp:209
Scope (from outer to inner):
file
function FScreenPassTexture AddDeviceEncodingOnlyPass
Source code excerpt:
#if WITH_EDITOR
{
static auto CVarHDRNITLevel = IConsoleManager::Get().FindConsoleVariable(TEXT("Editor.HDRNITLevel"));
if (CVarHDRNITLevel)
{
EditorNITLevel = CVarHDRNITLevel->GetFloat();
}
}
#endif
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessTonemap.cpp:693
Scope (from outer to inner):
file
function FScreenPassTexture AddTonemapPass
Source code excerpt:
#if WITH_EDITOR
{
static auto CVarHDRNITLevel = IConsoleManager::Get().FindConsoleVariable(TEXT("Editor.HDRNITLevel"));
if (CVarHDRNITLevel)
{
EditorNITLevel = CVarHDRNITLevel->GetFloat();
}
}
#endif
#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateShaders.h:562
Scope (from outer to inner):
file
class class FHDREditorConvertPS : public FGlobalShader
function void SetParameters
Source code excerpt:
SetTextureParameter(BatchedParameters, SceneTexture, SceneSampler, TStaticSamplerState<SF_Point>::GetRHI(), SceneTextureRHI);
static auto CVarHDRNITLevel = IConsoleManager::Get().FindConsoleVariable(TEXT("Editor.HDRNITLevel"));
SetShaderValue(BatchedParameters, UILevel, CVarHDRNITLevel->GetFloat());
}
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters& Parameters);
static const TCHAR* GetSourceFilename()
#Associated Variable and Callsites
This variable is associated with another variable named CVarEditorHDRNITLevel
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:175
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
TEXT("Editor.HDRNITLevel"),
160.0f,
TEXT("Sets The desired NIT level of the editor when running on HDR"),
ECVF_Default);
UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:210
Scope (from outer to inner):
file
function void UEditorExperimentalSettings::PostInitProperties
Source code excerpt:
CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
Super::PostInitProperties();
}
void UEditorExperimentalSettings::PostEditChangeProperty( struct FPropertyChangedEvent& PropertyChangedEvent )
{
Super::PostEditChangeProperty(PropertyChangedEvent);
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:230
Scope (from outer to inner):
file
function void UEditorExperimentalSettings::PostEditChangeProperty
Source code excerpt:
else if (Name == GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, HDREditorNITLevel))
{
CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
}
if (!FUnrealEdMisc::Get().IsDeletePreferences())
{
SaveConfig();
}