r.SSR.Temporal
r.SSR.Temporal
#Overview
name: r.SSR.Temporal
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Defines if we use the temporal smoothing for the screen space reflection\n 0 is off (for debugging), 1 is on (default)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSR.Temporal is to control the temporal smoothing for screen space reflections (SSR) in the rendering system. This setting variable is used to define whether temporal smoothing should be applied to screen space reflections, which can help reduce noise and improve the overall quality of reflections.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the screen space ray tracing subsystem. It is referenced in the ScreenSpaceRayTracing.cpp file, which is part of the core rendering pipeline.
The value of this variable is set through a console variable (CVarSSRTemporal) with a default value of 0. It can be changed at runtime using console commands or through engine configuration files.
The associated variable CVarSSRTemporal interacts directly with r.SSR.Temporal. They share the same value and purpose. The CVarSSRTemporal is used in the C++ code to check the current state of the temporal smoothing setting.
Developers should be aware that:
- Setting this variable to 0 disables temporal smoothing for SSR, which can be useful for debugging purposes.
- Setting it to 1 enables temporal smoothing, which is the default and recommended setting for most scenarios.
- This setting may interact with other anti-aliasing methods, as seen in the IsSSRTemporalPassRequired function.
Best practices when using this variable include:
- Keep it enabled (set to 1) for production builds to ensure the best visual quality of reflections.
- Disable it (set to 0) temporarily when debugging SSR-related issues to isolate temporal smoothing effects.
- Consider the performance impact of enabling temporal smoothing, especially on lower-end hardware.
- Test the visual impact of this setting in various lighting conditions and with different materials to ensure optimal results.
Regarding the associated variable CVarSSRTemporal: The purpose of CVarSSRTemporal is to provide a programmatic way to access and modify the r.SSR.Temporal setting within the C++ code of the engine. It is defined as a TAutoConsoleVariable, which allows it to be easily accessed and modified at runtime.
CVarSSRTemporal is used in the Renderer module, specifically in the screen space ray tracing subsystem. It is used to determine whether the temporal pass for SSR should be performed.
The value of CVarSSRTemporal is set when the console variable is initialized, but it can be changed at runtime through console commands or engine configuration files.
CVarSSRTemporal interacts directly with the r.SSR.Temporal setting, as they represent the same configuration option.
Developers should be aware that:
- Changes to CVarSSRTemporal will immediately affect the SSR temporal smoothing behavior.
- The value can be accessed on the render thread using GetValueOnRenderThread().
Best practices when using CVarSSRTemporal include:
- Use it to dynamically toggle SSR temporal smoothing for performance profiling or quality comparisons.
- When accessing its value, always use the appropriate thread-safe methods (e.g., GetValueOnRenderThread()) to avoid race conditions.
- Consider exposing this setting in your game’s graphics options menu to allow users to fine-tune their visual experience.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:33
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarSSRTemporal(
TEXT("r.SSR.Temporal"),
0,
TEXT("Defines if we use the temporal smoothing for the screen space reflection\n")
TEXT(" 0 is off (for debugging), 1 is on (default)"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarSSRStencil(
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSRTemporal
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:32
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarSSRTemporal(
TEXT("r.SSR.Temporal"),
0,
TEXT("Defines if we use the temporal smoothing for the screen space reflection\n")
TEXT(" 0 is off (for debugging), 1 is on (default)"),
ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:176
Scope (from outer to inner):
file
namespace ScreenSpaceRayTracing
function bool IsSSRTemporalPassRequired
Source code excerpt:
return false;
}
return !IsTemporalAccumulationBasedMethod(View.AntiAliasingMethod) || CVarSSRTemporal.GetValueOnRenderThread() != 0;
}
FRDGTextureUAV* CreateScreenSpaceRayTracingDebugUAV(FRDGBuilder& GraphBuilder, const FRDGTextureDesc& Desc, const TCHAR* Name, bool bClear = false)
#if (!UE_BUILD_SHIPPING && !UE_BUILD_TEST)
{