r.HDR.Display.MinLuminanceLog10
r.HDR.Display.MinLuminanceLog10
#Overview
name: r.HDR.Display.MinLuminanceLog10
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The configured minimum display output nit level (log10 value)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HDR.Display.MinLuminanceLog10 is to configure the minimum display output nit level for HDR rendering in Unreal Engine 5. This setting is critical for the HDR rendering system to accurately map the scene’s dynamic range to the display’s capabilities.
This setting variable is primarily used by the rendering subsystem of Unreal Engine 5. It’s specifically utilized in the HDR (High Dynamic Range) rendering pipeline, which is part of the core rendering module.
The value of this variable is set as a console variable with a default value of -4.0f. It can be modified at runtime through the console or programmatically.
This variable interacts closely with other HDR-related variables, particularly:
- r.HDR.Display.MidLuminance
- r.HDR.Display.MaxLuminance
- r.HDR.Aces.SceneColorMultiplier
- r.HDR.Aces.GamutCompression
Developers must be aware that this variable uses a logarithmic scale (base 10). The actual minimum luminance in nits is 10 raised to the power of this value. For example, the default value of -4.0f corresponds to a minimum luminance of 0.0001 nits.
Best practices when using this variable include:
- Adjusting it based on the capabilities of the target display devices.
- Considering it in conjunction with the mid and max luminance settings for a balanced HDR output.
- Testing the HDR output on various displays to ensure the intended visual result.
The associated variable CVarHDRDisplayMinLuminanceLog10 is an internal representation of the same setting. It’s used to access the value of r.HDR.Display.MinLuminanceLog10 within the engine’s C++ code. This variable is created as a TAutoConsoleVariable, which allows for efficient access to the console variable’s value.
The CVarHDRDisplayMinLuminanceLog10 is used in the HDRConfigureCVars function to calculate the actual minimum luminance value by raising 10 to the power of its value. This calculated value is then used to configure the ACES (Academy Color Encoding System) tonemapping parameters, which are crucial for the HDR rendering pipeline.
Developers should be aware that changes to r.HDR.Display.MinLuminanceLog10 will be reflected in CVarHDRDisplayMinLuminanceLog10, and vice versa. When accessing this setting programmatically, it’s generally recommended to use the console variable interface rather than directly accessing the CVarHDRDisplayMinLuminanceLog10 variable.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderCore.cpp:379
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarHDRDisplayMinLuminanceLog10(
TEXT("r.HDR.Display.MinLuminanceLog10"),
-4.0f,
TEXT("The configured minimum display output nit level (log10 value)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarHDRDisplayMidLuminance(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:947
Scope (from outer to inner):
file
function void HDRSettingChangedSinkCallback
Source code excerpt:
static const auto CVarHDROutputEnabled = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.HDR.EnableHDROutput"));
check(CVarHDROutputEnabled);
static const auto CVarHDRMinLuminanceLog10 = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.HDR.Display.MinLuminanceLog10"));
static const auto CVarHDRMidLuminance = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.HDR.Display.MidLuminance"));
static const auto CVarHDRMaxLuminance = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.HDR.Display.MaxLuminance"));
static const auto CVarHDRSceneColorMultiplier = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.HDR.Aces.SceneColorMultiplier"));
static const auto CVarHDRGamutCompression = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.HDR.Aces.GamutCompression"));
if (GRHIVendorId == 0)
#Associated Variable and Callsites
This variable is associated with another variable named CVarHDRDisplayMinLuminanceLog10
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderCore.cpp:378
Scope: file
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarHDRDisplayMinLuminanceLog10(
TEXT("r.HDR.Display.MinLuminanceLog10"),
-4.0f,
TEXT("The configured minimum display output nit level (log10 value)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderCore.cpp:640
Scope (from outer to inner):
file
function void HDRConfigureCVars
Source code excerpt:
CVarDisplayColorGamut->Set((int32)ColorGamut, ECVF_SetByDeviceProfile);
float HDRDisplayMinLuminance = FMath::Pow(10, CVarHDRDisplayMinLuminanceLog10.GetValueOnAnyThread());
ConfigureACESTonemapParams(GACESTonemapParams, HDRDisplayMinLuminance, CVarHDRDisplayMidLuminance.GetValueOnAnyThread(), CVarHDRDisplayMaxLuminance.GetValueOnAnyThread());
}
RENDERCORE_API FMatrix44f GamutToXYZMatrix(EDisplayColorGamut ColorGamut)
{
static const FMatrix44f sRGB_2_XYZ_MAT(