r.PathTracing.TemporalDenoiser.alpha
r.PathTracing.TemporalDenoiser.alpha
#Overview
name: r.PathTracing.TemporalDenoiser.alpha
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The weight of history in the exponential mean average\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PathTracing.TemporalDenoiser.alpha is to control the weight of history in the exponential mean average for the path tracing temporal denoiser. This setting variable is part of Unreal Engine’s rendering system, specifically the path tracing and denoising subsystem.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the path tracing and denoising components. This can be inferred from the file location (PathTracingSpatialTemporalDenoising.cpp) and the variable’s name.
The value of this variable is set through the console variable system. It is initialized with a default value of 1.0f, but can be changed at runtime using console commands or through configuration files.
This variable interacts with other temporal denoising parameters, specifically CVarPathTracingTemporalDenoiserKappa and CVarPathTracingTemporalDenoiserEta. These variables are used together in the GetBlendingFactor function to determine the blending factors for the temporal denoiser.
Developers must be aware that this variable directly affects the balance between temporal stability and responsiveness to changes in the path traced image. A higher value will result in stronger temporal smoothing but may introduce more ghosting artifacts when there are rapid changes in the scene.
Best practices when using this variable include:
- Adjusting it in conjunction with other temporal denoising parameters for optimal results.
- Testing different values to find the right balance between noise reduction and temporal artifacts for your specific scene and rendering requirements.
- Considering the target frame rate and scene dynamics when setting this value.
Regarding the associated variable CVarPathTracingTemporalDenoiserAlpha:
This is the actual console variable object that stores and manages the r.PathTracing.TemporalDenoiser.alpha setting. It is declared as a TAutoConsoleVariable
The purpose of CVarPathTracingTemporalDenoiserAlpha is to provide a programmatic interface to access and modify the r.PathTracing.TemporalDenoiser.alpha setting within the C++ code.
This variable is used in the GetBlendingFactor function to retrieve the current alpha value for temporal blending calculations. It’s important for developers to use this variable to read the current value of the setting, rather than assuming a fixed value, as it can be changed dynamically during runtime.
When working with CVarPathTracingTemporalDenoiserAlpha, developers should:
- Use GetValueOnRenderThread() to retrieve the current value safely in render thread code.
- Be aware that the value can change between frames, so it should be fetched each time it’s needed rather than cached.
- Consider exposing this setting in user interfaces for real-time adjustment during development or even in final builds for advanced users.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:159
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserAlpha(
TEXT("r.PathTracing.TemporalDenoiser.alpha"),
1.0f,
TEXT("The weight of history in the exponential mean average\n"),
ECVF_RenderThreadSafe
);
TAutoConsoleVariable<int32> CVarPathTracingTemporalDenoiserMode(
#Associated Variable and Callsites
This variable is associated with another variable named CVarPathTracingTemporalDenoiserAlpha
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:158
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
);
TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserAlpha(
TEXT("r.PathTracing.TemporalDenoiser.alpha"),
1.0f,
TEXT("The weight of history in the exponential mean average\n"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:443
Scope (from outer to inner):
file
function static void GetBlendingFactor
Source code excerpt:
Kappa = CVarPathTracingTemporalDenoiserKappa.GetValueOnRenderThread();
Eta = CVarPathTracingTemporalDenoiserEta.GetValueOnRenderThread();
Alpha = CVarPathTracingTemporalDenoiserAlpha.GetValueOnRenderThread();
if (Eta == -1)
{
// Eta is set to 1 JND (just noticeable difference).
Eta = GetErrorDistanceBasedOnDeltaE(1.0f);
}