r.Reflections.Denoiser.PreConvolution
r.Reflections.Denoiser.PreConvolution
#Overview
name: r.Reflections.Denoiser.PreConvolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of pre-convolution passes (default = 1).
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:
- Keeping the default value (1) unless there’s a specific need for higher quality reflections.
- Testing different values to find the optimal balance between visual quality and performance for your specific project.
- Considering the target hardware when adjusting this value, as higher values may impact performance on less powerful devices.
Regarding the associated variable CVarReflectionPreConvolutionCount:
- Its purpose is identical to r.Reflections.Denoiser.PreConvolution, controlling the number of pre-convolution passes in reflection denoising.
- It’s used in the same subsystem (screen space denoising) within the rendering module.
- The value is set when the engine initializes the console variable system.
- It directly interacts with r.Reflections.Denoiser.PreConvolution, effectively serving as its programmatic representation.
- Developers should be aware that modifying this variable through code will have the same effect as changing r.Reflections.Denoiser.PreConvolution through console commands.
- Best practices include using this variable for programmatic control of the pre-convolution passes, such as adjusting it based on runtime conditions or user settings.
#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;