r.SSR.ExperimentalDenoiser
r.SSR.ExperimentalDenoiser
#Overview
name: r.SSR.ExperimentalDenoiser
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Replace SSR\'s TAA pass with denoiser.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSR.ExperimentalDenoiser is to control the use of an experimental denoiser for Screen Space Reflections (SSR) in Unreal Engine’s rendering system. This setting variable allows developers to replace the default Temporal Anti-Aliasing (TAA) pass used for SSR with a denoising algorithm.
This setting variable is primarily used by the Renderer module of Unreal Engine, specifically in the indirect light rendering subsystem. The main file referencing this variable is IndirectLightRendering.cpp, which handles various aspects of indirect lighting, including screen space reflections.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as an integer with a default value of 0, meaning the experimental denoiser is disabled by default.
The associated variable CVarDenoiseSSR interacts directly with r.SSR.ExperimentalDenoiser. They share the same value and purpose, with CVarDenoiseSSR being the actual console variable object used in the C++ code.
Developers should be aware of the following when using this variable:
- It’s an experimental feature, which means it may not be fully optimized or stable.
- Enabling this feature (by setting it to a non-zero value) will replace the standard TAA pass for SSR with the denoiser.
- The performance and visual impact of enabling this feature may vary depending on the scene and hardware.
Best practices when using this variable include:
- Test thoroughly in various scenarios to ensure it doesn’t negatively impact performance or visual quality.
- Use it in conjunction with other SSR-related settings to achieve the desired balance between quality and performance.
- Be prepared to revert to the standard TAA pass if issues arise, as this is an experimental feature.
Regarding the associated variable CVarDenoiseSSR:
The purpose of CVarDenoiseSSR is to provide a programmatic way to access and modify the r.SSR.ExperimentalDenoiser setting within the C++ code. It is defined as a TAutoConsoleVariable
CVarDenoiseSSR is used in the Renderer module, specifically in the indirect light rendering system. It’s primarily referenced in the RenderDeferredReflectionsAndSkyLighting function, where it determines whether to use the experimental denoiser for SSR.
The value of CVarDenoiseSSR is set when r.SSR.ExperimentalDenoiser is modified, as they share the same underlying value.
Developers should be aware that:
- Changes to CVarDenoiseSSR will directly affect the SSR rendering pipeline.
- The variable is checked on the render thread, so changes may not take effect immediately.
Best practices for using CVarDenoiseSSR include:
- Use GetValueOnRenderThread() when accessing its value in render thread code.
- Consider caching the value if it’s accessed frequently to avoid potential performance overhead from repeated console variable lookups.
- Be cautious when modifying this variable during runtime, as it can affect 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/IndirectLightRendering.cpp:68
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDenoiseSSR(
TEXT("r.SSR.ExperimentalDenoiser"), 0,
TEXT("Replace SSR's TAA pass with denoiser."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarSkySpecularOcclusionStrength(
TEXT("r.SkySpecularOcclusionStrength"),
1,
#Associated Variable and Callsites
This variable is associated with another variable named CVarDenoiseSSR
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IndirectLightRendering.cpp:67
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarDenoiseSSR(
TEXT("r.SSR.ExperimentalDenoiser"), 0,
TEXT("Replace SSR's TAA pass with denoiser."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarSkySpecularOcclusionStrength(
TEXT("r.SkySpecularOcclusionStrength"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IndirectLightRendering.cpp:2012
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderDeferredReflectionsAndSkyLighting
Source code excerpt:
IScreenSpaceDenoiser::FReflectionsInputs DenoiserInputs;
IScreenSpaceDenoiser::FReflectionsRayTracingConfig DenoiserConfig;
bool bDenoise = DenoiserMode != 0 && CVarDenoiseSSR.GetValueOnRenderThread();
bool bTemporalFilter = !bDenoise && View.ViewState && ScreenSpaceRayTracing::IsSSRTemporalPassRequired(View);
{
ESSRQuality SSRQuality;
ScreenSpaceRayTracing::GetSSRQualityForView(View, &SSRQuality, &DenoiserConfig);