r.PathTracing.TemporalDenoiser.DeltaE.HighFrequency

r.PathTracing.TemporalDenoiser.DeltaE.HighFrequency

#Overview

name: r.PathTracing.TemporalDenoiser.DeltaE.HighFrequency

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.PathTracing.TemporalDenoiser.DeltaE.HighFrequency is to control the cut-off threshold for the history weight in the path tracing temporal denoiser. It is specifically used for high-frequency per-pixel differences in the rendering system.

This setting variable is part of Unreal Engine’s rendering subsystem, particularly the path tracing and denoising modules. It’s used in the implementation of spatial-temporal denoising for path-traced images.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 2.1f, but can be changed at runtime through console commands or programmatically.

The associated variable CVarPathTracingTemporalDenoiserDeltaEHighFrequency directly interacts with r.PathTracing.TemporalDenoiser.DeltaE.HighFrequency. They share the same value and purpose.

Developers must be aware that this variable should only be enabled when the source image is smooth or already denoised. Changing this value affects the quality and performance of the temporal denoising process in path tracing.

Best practices when using this variable include:

  1. Only adjust it when fine-tuning the denoising process for path-traced renders.
  2. Be cautious when increasing the value, as it may lead to more aggressive cut-offs and potentially visible artifacts.
  3. Test thoroughly after changes, especially in scenes with high-frequency details or motion.

Regarding the associated variable CVarPathTracingTemporalDenoiserDeltaEHighFrequency:

This is the actual console variable that controls the setting. It’s used in the GetHighFrequencyCutoffDeltaE() function, which retrieves the current value for use in the denoising algorithm. The function ensures that the returned value is at least 1.0f, providing a safeguard against potentially invalid negative values.

Developers should note that this variable is marked as ECVF_RenderThreadSafe, meaning it’s safe to modify from the render thread. However, changes should still be made with caution, as they can impact rendering performance and quality in real-time.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:151

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


	TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserDeltaEHighFrequency(
		TEXT("r.PathTracing.TemporalDenoiser.DeltaE.HighFrequency"),
		2.1f,
		TEXT("Cut off the history weight to zero when using high frequency per pixel difference.\n")
		TEXT("It should only be enabled when the source image is smooth or denoised."),
		ECVF_RenderThreadSafe
	);

#Associated Variable and Callsites

This variable is associated with another variable named CVarPathTracingTemporalDenoiserDeltaEHighFrequency. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:150

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

	);

	TAutoConsoleVariable<float> CVarPathTracingTemporalDenoiserDeltaEHighFrequency(
		TEXT("r.PathTracing.TemporalDenoiser.DeltaE.HighFrequency"),
		2.1f,
		TEXT("Cut off the history weight to zero when using high frequency per pixel difference.\n")
		TEXT("It should only be enabled when the source image is smooth or denoised."),
		ECVF_RenderThreadSafe
	);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracingSpatialTemporalDenoising.cpp:420

Scope (from outer to inner):

file
function     static float GetHighFrequencyCutoffDeltaE

Source code excerpt:

static float GetHighFrequencyCutoffDeltaE()
{
	return FMath::Max(1.0f, CVarPathTracingTemporalDenoiserDeltaEHighFrequency.GetValueOnRenderThread());
}

static bool ShouldRemoveSelfSubpixelOffset(int MipLevel)
{
	bool bRemoveSelfSubpixelOffset = CVarPathTracingTemporalDenoiserMotionOperation.GetValueOnRenderThread() == 1 
		&& MipLevel <= CVarPathTracingTemporalDenoiserSubPixelOffsetStartMip.GetValueOnRenderThread()