r.PathTracing.TemporalDenoiser.DeltaE
r.PathTracing.TemporalDenoiser.DeltaE
#Overview
name: r.PathTracing.TemporalDenoiser.DeltaE
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Cut off the history weight to zero at CIE DeltaE for low frequency.\n1.0 :the just noticeable difference (JND),\n2.0 :perceptible for close look\n10.0:Perceptible at a glance This works as an alternative control instead of kappa. 2 as default.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PathTracing.TemporalDenoiser.DeltaE is to control the cut-off point for the history weight in the temporal denoiser used in path tracing. It is specifically related to the rendering system, particularly the path tracing and denoising subsystems of Unreal Engine 5.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the path tracing and temporal denoising functionality. Based on the callsite, it’s part of the anonymous namespace in the PathTracingSpatialTemporalDenoising.cpp file, which suggests it’s a core part of the path tracing denoising system.
The value of this variable is set as a console variable, allowing it to be adjusted at runtime. It’s initialized with a default value of 5.0f, but can be changed through the console or configuration files.
The variable interacts closely with its associated variable CVarPathTracingTemporalDenoiserDeltaE, which is the actual TAutoConsoleVariable instance. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable uses the CIE DeltaE metric, which is a measure of perceived color difference. The comments in the code provide guidance on what different values mean:
- 1.0: Just Noticeable Difference (JND)
- 2.0: Perceptible for close look
- 10.0: Perceptible at a glance
When using this variable, developers should consider the following best practices:
- Understand the impact on visual quality and performance. Higher values may improve performance but could reduce the effectiveness of the denoiser.
- Test different values to find the right balance between image quality and performance for your specific use case.
- Consider exposing this setting to end-users for fine-tuning, especially in applications where image quality is crucial.
- Be aware that very low values (close to 1.0) may lead to overly aggressive denoising, while very high values may result in insufficient noise reduction.
Regarding the associated variable CVarPathTracingTemporalDenoiserDeltaE: This is the actual console variable instance that stores and manages the DeltaE value. It’s used in the GetBlendingFactor function to calculate the falloff for the history weight in the temporal denoiser. The value is retrieved using the GetValueOnRenderThread() method, ensuring thread-safe access in the rendering pipeline.
Best practices for using CVarPathTracingTemporalDenoiserDeltaE include:
- Access the value using GetValueOnRenderThread() when used in render thread operations.
- Consider caching the value if used frequently to avoid repeated calls to GetValueOnRenderThread().
- Be cautious when modifying this value at runtime, as it can have immediate effects on the rendering output.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:140
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserDeltaE(
TEXT("r.PathTracing.TemporalDenoiser.DeltaE"),
5.0f,
TEXT("Cut off the history weight to zero at CIE DeltaE for low frequency.\n")
TEXT("1.0 :the just noticeable difference (JND),\n")
TEXT("2.0 :perceptible for close look\n")
TEXT("10.0:Perceptible at a glance ")
TEXT("This works as an alternative control instead of kappa. 2 as default."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarPathTracingTemporalDenoiserDeltaE
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:139
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
);
TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserDeltaE(
TEXT("r.PathTracing.TemporalDenoiser.DeltaE"),
5.0f,
TEXT("Cut off the history weight to zero at CIE DeltaE for low frequency.\n")
TEXT("1.0 :the just noticeable difference (JND),\n")
TEXT("2.0 :perceptible for close look\n")
TEXT("10.0:Perceptible at a glance ")
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:456
Scope (from outer to inner):
file
function static void GetBlendingFactor
Source code excerpt:
// the history weight falls off to zero when we reaches DeltaE.
float DeltaE =CVarPathTracingTemporalDenoiserDeltaE.GetValueOnRenderThread();
DeltaE = FMath::Max(DeltaE, 1.0f + 1e-6f);
float FallOffToZeroErrorDistance = GetErrorDistanceBasedOnDeltaE(DeltaE);
Kappa = 1 / (FallOffToZeroErrorDistance - Eta);
}
}