r.SSR.TiledComposite.Visualize
r.SSR.TiledComposite.Visualize
#Overview
name: r.SSR.TiledComposite.Visualize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
1: Visualize the tiling region.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSR.TiledComposite.Visualize is to enable visualization of the tiling region in Screen Space Reflections (SSR) for debugging and development purposes. This setting variable is part of the rendering system, specifically the Screen Space Reflection subsystem.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the Screen Space Reflection and Ray Tracing components. This is evident from the file locations where the variable is referenced: ScreenSpaceReflectionTiles.cpp and ScreenSpaceRayTracing.cpp.
The value of this variable is set as a console variable with a default value of 0 (disabled). It can be changed at runtime through the console or programmatically.
This variable interacts with an associated variable named CVarSSRTiledCompositeVisualize. They share the same value and are used interchangeably in the code.
Developers must be aware that enabling this visualization is intended for debugging purposes and may impact performance. It should not be enabled in release builds or during normal gameplay.
Best practices when using this variable include:
- Only enable it when debugging SSR issues or optimizing SSR performance.
- Disable it before final builds or performance testing.
- Use it in conjunction with other SSR debugging tools for a comprehensive understanding of the SSR system.
Regarding the associated variable CVarSSRTiledCompositeVisualize:
The purpose of CVarSSRTiledCompositeVisualize is to provide a programmatic way to access and modify the r.SSR.TiledComposite.Visualize setting. It is used within the C++ code to check the current state of the visualization setting and apply it to the rendering pipeline.
This variable is used in the ScreenSpaceRayTracing namespace, specifically in the RenderScreenSpaceReflections function. It determines whether the tiled screen space reflection should be visualized.
The value of CVarSSRTiledCompositeVisualize is set by querying the console variable system for the r.SSR.TiledComposite.Visualize value.
CVarSSRTiledCompositeVisualize interacts directly with r.SSR.TiledComposite.Visualize, serving as its in-code representation.
Developers should be aware that this variable is used to control the visualization at runtime and can be accessed from different parts of the rendering code.
Best practices for using CVarSSRTiledCompositeVisualize include:
- Use it consistently throughout the codebase when checking for SSR tile visualization.
- Consider caching its value if used frequently to avoid repeated console variable lookups.
- Be mindful of its thread-safety implications, as it’s marked with ECVF_RenderThreadSafe.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:26
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarSSRTiledCompositeVisualize(
TEXT("r.SSR.TiledComposite.Visualize"), 0,
TEXT("1: Visualize the tiling region."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static float GetScreenSpaceReflectionMaxRoughnessScale(const FViewInfo& View)
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:1182
Scope (from outer to inner):
file
namespace ScreenSpaceRayTracing
function void RenderScreenSpaceReflections
Source code excerpt:
RDG_GPU_STAT_SCOPE(GraphBuilder, ScreenSpaceReflections);
static const auto CVarSSRTiledCompositeVisualize = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("r.SSR.TiledComposite.Visualize"));
const bool bVisualizeTiledScreenSpaceReflection = CVarSSRTiledCompositeVisualize ? CVarSSRTiledCompositeVisualize->GetValueOnRenderThread() : false;
if (TiledScreenSpaceReflection == nullptr)
{
ClearUnusedGraphResources(PixelShader, PassParameters);
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSRTiledCompositeVisualize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:1182
Scope (from outer to inner):
file
namespace ScreenSpaceRayTracing
function void RenderScreenSpaceReflections
Source code excerpt:
RDG_GPU_STAT_SCOPE(GraphBuilder, ScreenSpaceReflections);
static const auto CVarSSRTiledCompositeVisualize = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("r.SSR.TiledComposite.Visualize"));
const bool bVisualizeTiledScreenSpaceReflection = CVarSSRTiledCompositeVisualize ? CVarSSRTiledCompositeVisualize->GetValueOnRenderThread() : false;
if (TiledScreenSpaceReflection == nullptr)
{
ClearUnusedGraphResources(PixelShader, PassParameters);
GraphBuilder.AddPass(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:25
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<bool> CVarSSRTiledCompositeVisualize(
TEXT("r.SSR.TiledComposite.Visualize"), 0,
TEXT("1: Visualize the tiling region."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static float GetScreenSpaceReflectionMaxRoughnessScale(const FViewInfo& View)
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:52
Scope (from outer to inner):
file
function bool ShouldVisualizeTiledScreenSpaceReflection
Source code excerpt:
bool ShouldVisualizeTiledScreenSpaceReflection()
{
return CVarSSRTiledCompositeVisualize.GetValueOnRenderThread() != 0;
}
class FSSRTileCategorisationMarkCS : public FGlobalShader
{
DECLARE_GLOBAL_SHADER(FSSRTileCategorisationMarkCS);