r.DefaultFeature.AutoExposure.Bias
r.DefaultFeature.AutoExposure.Bias
#Overview
name: r.DefaultFeature.AutoExposure.Bias
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Engine default (project setting) for AutoExposure Exposure Bias (postprocess volume/camera/game setting still can override)\n
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DefaultFeature.AutoExposure.Bias is to set the default auto exposure bias for the engine’s post-processing system. This setting is part of the auto exposure feature, which adjusts the overall brightness of the scene to simulate the human eye’s adaptation to different lighting conditions.
This setting variable is primarily used by the rendering system, specifically in the post-processing pipeline for auto exposure calculations. It is referenced in the Engine module, particularly in the Scene and SceneView components.
The value of this variable is set as a console variable (CVar) in the engine’s initialization process. It can be accessed and modified at runtime through the console or programmatically.
Other variables that interact with r.DefaultFeature.AutoExposure.Bias include:
- r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange
- AutoExposureBias (in FPostProcessSettings)
- Other auto exposure related settings in FPostProcessSettings and FCameraExposureSettings
Developers should be aware of the following when using this variable:
- This setting provides a default value that can be overridden by post-process volumes, camera settings, or game-specific logic.
- Changes to this value will affect the global auto exposure behavior across the entire project.
- The value is used in initializing FCameraExposureSettings and FPostProcessSettings.
Best practices when using this variable include:
- Use it to set a project-wide baseline for auto exposure, but rely on more specific settings (like post-process volumes) for fine-tuning in individual scenes or areas.
- Be cautious when changing this value, as it can significantly impact the overall look of your game.
- Consider the interaction with other auto exposure settings to achieve the desired visual result.
- Use this in conjunction with other rendering settings to achieve a balanced and visually appealing result across different lighting scenarios in your game.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:171
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDefaultAutoExposureBias(
TEXT("r.DefaultFeature.AutoExposure.Bias"),
1.0f,
TEXT("Engine default (project setting) for AutoExposure Exposure Bias (postprocess volume/camera/game setting still can override)\n"));
static TAutoConsoleVariable<int32> CVarDefaultAutoExposureExtendDefaultLuminanceRange(
TEXT("r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange"),
0,
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scene.cpp:198
Scope (from outer to inner):
file
function FCameraExposureSettings::FCameraExposureSettings
Source code excerpt:
const bool bExtendedLuminanceRange = VarDefaultAutoExposureExtendDefaultLuminanceRange->GetValueOnAnyThread() == 1;
static const auto VarDefaultAutoExposureBias = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.DefaultFeature.AutoExposure.Bias"));
const float BaseAutoExposureBias = VarDefaultAutoExposureBias->GetValueOnAnyThread();
// next value might get overwritten by r.DefaultFeature.AutoExposure.Method
Method = AEM_Histogram;
LowPercent = 10.0f;
HighPercent = 90.0f;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scene.cpp:499
Scope (from outer to inner):
file
function FPostProcessSettings::FPostProcessSettings
Source code excerpt:
}
static const auto VarDefaultAutoExposureBias = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.DefaultFeature.AutoExposure.Bias"));
const float BaseAutoExposureBias = VarDefaultAutoExposureBias->GetValueOnAnyThread();
AutoExposureBias = BaseAutoExposureBias;
AutoExposureSpeedUp = 3.0f;
AutoExposureSpeedDown = 1.0f;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scene.cpp:876
Scope (from outer to inner):
file
function void FPostProcessSettings::PostSerialize
Source code excerpt:
const float ExtraAutoExposureBias = CalculateEyeAdaptationExposureVersionUpdate(*this, bExtendedLuminanceRange);
static const auto VarDefaultAutoExposureBias = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.DefaultFeature.AutoExposure.Bias"));
const float BaseAutoExposureBias = VarDefaultAutoExposureBias->GetValueOnAnyThread();
// We take this path if:
// 1. We did not originally have bOverride_AutoExposureBias
// 2. We now do have bOverride_AutoExposureBias (it changed during FRenderingObjectVersion::AutoExposureForceOverrideBiasFlag)
// 3. Our PPV had the serialized AutoExposureBias of 0.0, which would cause the default to change. Or the previous auto exposure