r.Reflections.Denoiser.PreConvolution

r.Reflections.Denoiser.PreConvolution

#Overview

name: r.Reflections.Denoiser.PreConvolution

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Reflections.Denoiser.PreConvolution is to control the number of pre-convolution passes in the reflection denoising process within Unreal Engine 5’s rendering system.

This setting variable is primarily used in the screen space denoising subsystem of Unreal Engine’s rendering module. It specifically affects the reflection denoising process, which is part of the ray tracing pipeline.

The value of this variable is set through a console variable (CVarReflectionPreConvolutionCount) with a default value of 1. It can be modified at runtime using console commands or through engine configuration files.

The associated variable CVarReflectionPreConvolutionCount directly interacts with r.Reflections.Denoiser.PreConvolution. They share the same value and purpose.

Developers must be aware that this variable affects the quality and performance of reflection denoising. Increasing the number of pre-convolution passes may improve the quality of reflections but at the cost of increased computational overhead.

Best practices when using this variable include:

  1. Keeping the default value (1) unless there’s a specific need for higher quality reflections.
  2. Testing different values to find the optimal balance between visual quality and performance for your specific project.
  3. Considering the target hardware when adjusting this value, as higher values may impact performance on less powerful devices.

Regarding the associated variable CVarReflectionPreConvolutionCount:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceDenoise.cpp:57

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarReflectionPreConvolutionCount(
	TEXT("r.Reflections.Denoiser.PreConvolution"), 1,
	TEXT("Number of pre-convolution passes (default = 1)."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarReflectionTemporalAccumulation(
	TEXT("r.Reflections.Denoiser.TemporalAccumulation"), 1,
	TEXT("Accumulates the samples over multiple frames."),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceDenoise.cpp:56

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarReflectionPreConvolutionCount(
	TEXT("r.Reflections.Denoiser.PreConvolution"), 1,
	TEXT("Number of pre-convolution passes (default = 1)."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarReflectionTemporalAccumulation(
	TEXT("r.Reflections.Denoiser.TemporalAccumulation"), 1,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceDenoise.cpp:2560

Scope (from outer to inner):

file
class        class FDefaultScreenSpaceDenoiser : public IScreenSpaceDenoiser
function     FReflectionsOutputs DenoiseReflections

Source code excerpt:

		Settings.InputResolutionFraction = RayTracingConfig.ResolutionFraction;
		Settings.ReconstructionSamples = CVarReflectionReconstructionSampleCount.GetValueOnRenderThread();
		Settings.PreConvolutionCount = CVarReflectionPreConvolutionCount.GetValueOnRenderThread();
		Settings.bUseTemporalAccumulation = CVarReflectionTemporalAccumulation.GetValueOnRenderThread() != 0;
		Settings.MaxInputSPP = RayTracingConfig.RayCountPerPixel;

		TStaticArray<FScreenSpaceDenoiserHistory*, IScreenSpaceDenoiser::kMaxBatchSize> PrevHistories;
		TStaticArray<FScreenSpaceDenoiserHistory*, IScreenSpaceDenoiser::kMaxBatchSize> NewHistories;
		PrevHistories[0] = &PreviousViewInfos->ReflectionsHistory;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceDenoise.cpp:2609

Scope (from outer to inner):

file
class        class FDefaultScreenSpaceDenoiser : public IScreenSpaceDenoiser
function     FReflectionsOutputs DenoiseWaterReflections

Source code excerpt:

		Settings.InputResolutionFraction = RayTracingConfig.ResolutionFraction;
		Settings.ReconstructionSamples = CVarReflectionReconstructionSampleCount.GetValueOnRenderThread();
		Settings.PreConvolutionCount = CVarReflectionPreConvolutionCount.GetValueOnRenderThread();
		Settings.bUseTemporalAccumulation = CVarReflectionTemporalAccumulation.GetValueOnRenderThread() != 0;
		Settings.MaxInputSPP = RayTracingConfig.RayCountPerPixel;

		TStaticArray<FScreenSpaceDenoiserHistory*, IScreenSpaceDenoiser::kMaxBatchSize> PrevHistories;
		TStaticArray<FScreenSpaceDenoiserHistory*, IScreenSpaceDenoiser::kMaxBatchSize> NewHistories;
		PrevHistories[0] = &PreviousViewInfos->WaterReflectionsHistory;