r.EyeAdaptation.ExponentialTransitionDistance
r.EyeAdaptation.ExponentialTransitionDistance
#Overview
name: r.EyeAdaptation.ExponentialTransitionDistance
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The auto exposure moves linearly, but when it gets ExponentialTransitionDistance F-stops away from the\ntarget exposure it switches to as slower exponential function.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.EyeAdaptation.ExponentialTransitionDistance is to control the transition point in the auto-exposure system of Unreal Engine’s rendering pipeline. It determines when the eye adaptation mechanism switches from a linear to an exponential function as it approaches the target exposure.
This setting variable is primarily used in the rendering system, specifically in the post-processing stage for eye adaptation or auto-exposure.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the post-processing component responsible for eye adaptation.
The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with a default value of 1.5 F-stops.
The associated variable CVarEyeAdaptationExponentialTransitionDistance directly interacts with r.EyeAdaptation.ExponentialTransitionDistance. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the behavior of the auto-exposure system. It determines how quickly the exposure adjusts when there are significant changes in scene brightness. A lower value will cause the transition to exponential behavior to occur sooner, potentially resulting in smoother but slower adaptation. A higher value will maintain linear adaptation for longer, potentially resulting in faster but more abrupt changes.
Best practices when using this variable include:
- Experimentation to find the right balance for your specific scene lighting conditions.
- Consider the gameplay implications of eye adaptation speed and smoothness.
- Use in conjunction with other eye adaptation settings for a comprehensive approach to auto-exposure.
Regarding the associated variable CVarEyeAdaptationExponentialTransitionDistance:
- Its purpose is identical to r.EyeAdaptation.ExponentialTransitionDistance.
- It’s used in the same Renderer module, specifically in the eye adaptation post-processing.
- Its value is set when the console variable is initialized.
- It directly interacts with r.EyeAdaptation.ExponentialTransitionDistance, sharing the same value.
- Developers should treat it as they would r.EyeAdaptation.ExponentialTransitionDistance.
- Best practices are the same as for r.EyeAdaptation.ExponentialTransitionDistance.
The variable is used in the GetEyeAdaptationParameters function to calculate the start distance and times for the exponential transition in the eye adaptation process.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:43
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarEyeAdaptationExponentialTransitionDistance(
TEXT("r.EyeAdaptation.ExponentialTransitionDistance"),
1.5,
TEXT("The auto exposure moves linearly, but when it gets ExponentialTransitionDistance F-stops away from the\n")
TEXT("target exposure it switches to as slower exponential function.\n"),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int> CVarEyeAdaptationVisualizeDebugType(
#Associated Variable and Callsites
This variable is associated with another variable named CVarEyeAdaptationExponentialTransitionDistance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:42
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarEyeAdaptationExponentialTransitionDistance(
TEXT("r.EyeAdaptation.ExponentialTransitionDistance"),
1.5,
TEXT("The auto exposure moves linearly, but when it gets ExponentialTransitionDistance F-stops away from the\n")
TEXT("target exposure it switches to as slower exponential function.\n"),
ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:486
Scope (from outer to inner):
file
function FEyeAdaptationParameters GetEyeAdaptationParameters
Source code excerpt:
// The distance at which we switch from linear to exponential. I.e. at StartDistance=1.5, when linear is 1.5 f-stops away from hitting the
// target, we switch to exponential.
const float StartDistance = CVarEyeAdaptationExponentialTransitionDistance.GetValueOnRenderThread();
const float StartTimeUp = StartDistance / FMath::Max(Settings.AutoExposureSpeedUp, 0.001f);
const float StartTimeDown = StartDistance / FMath::Max(Settings.AutoExposureSpeedDown, 0.001f);
// We want to ensure that at time=StartT, that the derivative of the exponential curve is the same as the derivative of the linear curve.
// For the linear curve, the step will be AdaptationSpeed * FrameTime.
// For the exponential curve, the step will be at t=StartT, M is slope modifier: