r.PathTracing.TemporalDenoiser.eta
r.PathTracing.TemporalDenoiser.eta
#Overview
name: r.PathTracing.TemporalDenoiser.eta
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Eta param. Error distance below this will have max history weight. Use DeltaE to derive Eta if -1\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PathTracing.TemporalDenoiser.eta is to control the error distance threshold in the temporal denoiser for path tracing. It is used in the rendering system, specifically for the path tracing feature’s temporal denoising process.
This setting variable is primarily used in the Renderer module of Unreal Engine, as evidenced by its location in the ‘PathTracingSpatialTemporalDenoising.cpp’ file within the Renderer’s private directory.
The value of this variable is set through the console variable system, with a default value of 1.0f. It can be modified at runtime using console commands or through engine configuration files.
The variable interacts closely with other temporal denoising parameters, particularly CVarPathTracingTemporalDenoiserDeltaE and CVarPathTracingTemporalDenoiserKappa. These variables work together to control the blending factor in the temporal denoising process.
Developers must be aware that:
- Setting this value to -1 will cause the system to derive Eta based on the DeltaE value.
- The Eta value determines the maximum history weight for error distances below this threshold.
Best practices when using this variable include:
- Carefully adjusting it in conjunction with other temporal denoising parameters for optimal results.
- Testing different values to find the best balance between noise reduction and preservation of detail.
- Consider using the automatic derivation (by setting to -1) if unsure about the appropriate value.
Regarding the associated variable CVarPathTracingTemporalDenoiserEta:
This is the actual console variable object that stores and manages the r.PathTracing.TemporalDenoiser.eta setting. It’s defined using the TAutoConsoleVariable template, which is part of Unreal Engine’s console variable system.
The purpose of CVarPathTracingTemporalDenoiserEta is to provide a programmatic interface for accessing and modifying the Eta parameter within the engine’s C++ code. It’s used to retrieve the current value of the setting in the GetBlendingFactor function, which is likely a key part of the temporal denoising algorithm.
Developers should be aware that:
- Changes to this variable will be thread-safe and affect the render thread, as indicated by the ECVF_RenderThreadSafe flag.
- The value can be accessed using the GetValueOnRenderThread() method, which ensures thread-safe access in render thread contexts.
Best practices for using CVarPathTracingTemporalDenoiserEta include:
- Always access its value using the provided methods (e.g., GetValueOnRenderThread()) to ensure thread safety.
- If modifying the value programmatically, ensure it’s done in an appropriate context and consider the potential impact on rendering performance and quality.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:133
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserEta(
TEXT("r.PathTracing.TemporalDenoiser.eta"),
1.0f,
TEXT("Eta param. Error distance below this will have max history weight. Use DeltaE to derive Eta if -1\n"),
ECVF_RenderThreadSafe
);
TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserDeltaE(
#Associated Variable and Callsites
This variable is associated with another variable named CVarPathTracingTemporalDenoiserEta
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:132
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
);
TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserEta(
TEXT("r.PathTracing.TemporalDenoiser.eta"),
1.0f,
TEXT("Eta param. Error distance below this will have max history weight. Use DeltaE to derive Eta if -1\n"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:442
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);