r.AmbientOcclusion.Denoiser.PreConvolution

r.AmbientOcclusion.Denoiser.PreConvolution

#Overview

name: r.AmbientOcclusion.Denoiser.PreConvolution

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.AmbientOcclusion.Denoiser.PreConvolution is to control the number of pre-convolution passes in the Ambient Occlusion denoising process. This setting variable is part of the rendering system, specifically for improving the quality of Ambient Occlusion effects.

This setting variable is utilized by the Screen Space Denoiser subsystem within Unreal Engine’s rendering module. It’s primarily used in the ScreenSpaceDenoise.cpp file, which handles various denoising techniques for different rendering effects.

The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with a default value of 2, meaning by default, there are two pre-convolution passes.

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

Developers should be aware that this variable affects the quality and performance of Ambient Occlusion denoising. Increasing the number of pre-convolution passes can potentially improve the quality of the denoised result but at the cost of increased computational overhead.

Best practices when using this variable include:

  1. Balancing quality and performance by adjusting the value based on the specific needs of the project.
  2. Testing different values to find the optimal setting for your specific scene and target hardware.
  3. Considering the interaction with other Ambient Occlusion settings, such as the kernel spread factor (r.AmbientOcclusion.Denoiser.KernelSpreadFactor).

Regarding the associated variable CVarAOPreConvolutionCount:

The purpose of CVarAOPreConvolutionCount is the same as r.AmbientOcclusion.Denoiser.PreConvolution - to control the number of pre-convolution passes in the Ambient Occlusion denoising process.

It’s used in the same subsystem (Screen Space Denoiser) and module (rendering) as r.AmbientOcclusion.Denoiser.PreConvolution.

The value is set through the console variable system and is accessed in the code using GetValueOnRenderThread() method.

This variable directly interacts with r.AmbientOcclusion.Denoiser.PreConvolution, as they represent the same setting.

Developers should be aware that changes to this variable will affect the Ambient Occlusion denoising process, potentially impacting both visual quality and performance.

Best practices for using CVarAOPreConvolutionCount are the same as those for r.AmbientOcclusion.Denoiser.PreConvolution, as they are essentially the same setting represented in different ways within the engine code.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


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

static TAutoConsoleVariable<float> CVarAOKernelSpreadFactor(
	TEXT("r.AmbientOcclusion.Denoiser.KernelSpreadFactor"), 4,
	TEXT("Spread factor of the preconvolution passes."),

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

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

static TAutoConsoleVariable<float> CVarAOKernelSpreadFactor(
	TEXT("r.AmbientOcclusion.Denoiser.KernelSpreadFactor"), 4,

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

Scope (from outer to inner):

file
class        class FDefaultScreenSpaceDenoiser : public IScreenSpaceDenoiser
function     FAmbientOcclusionOutputs DenoiseAmbientOcclusion

Source code excerpt:

		Settings.InputResolutionFraction = RayTracingConfig.ResolutionFraction;
		Settings.ReconstructionSamples = FMath::Clamp(CVarAOReconstructionSampleCount.GetValueOnRenderThread(), 1, kStackowiakMaxSampleCountPerSet);
		Settings.PreConvolutionCount = CVarAOPreConvolutionCount.GetValueOnRenderThread();
		Settings.KernelSpreadFactor = CVarAOKernelSpreadFactor.GetValueOnRenderThread();
		Settings.bUseTemporalAccumulation = CVarAOTemporalAccumulation.GetValueOnRenderThread() != 0;
		Settings.HistoryConvolutionSampleCount = CVarAOHistoryConvolutionSampleCount.GetValueOnRenderThread();
		Settings.HistoryConvolutionKernelSpreadFactor = CVarAOHistoryConvolutionKernelSpreadFactor.GetValueOnRenderThread();
		Settings.MaxInputSPP = RayTracingConfig.RayCountPerPixel;