r.PathTracing.DecalGrid.Visualize
r.PathTracing.DecalGrid.Visualize
#Overview
name: r.PathTracing.DecalGrid.Visualize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables a visualization mode of the decal grid density where red indicates the maximum decal count has been reached (default = 0)\n0: off (default)\n1: decal count heatmap (red - close to overflow, increase r.RayTracing.DecalGrid.MaxCount)\n2: unique decal lists (colors are a function of which decals occupy each cell)\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PathTracing.DecalGrid.Visualize is to enable a visualization mode for the decal grid density in path tracing rendering. This setting is part of Unreal Engine’s rendering system, specifically related to path tracing and decal rendering.
This setting variable is primarily used in the Renderer module of Unreal Engine, as evidenced by its location in the PathTracing.cpp file within the Runtime/Renderer directory.
The value of this variable is set through a console variable (CVarPathTracingDecalGridVisualize) with default value 0. It can be changed at runtime using console commands or through engine configuration files.
The variable interacts with the PathTracingData structure, specifically setting the VisualizeDecalGrid member of this structure based on its value.
Developers should be aware that this variable has three possible states: 0: Visualization is off (default) 1: Displays a decal count heatmap, where red indicates areas close to overflow 2: Shows unique decal lists, where colors represent which decals occupy each cell
Best practices when using this variable include:
- Use it for debugging and optimizing decal rendering in path tracing scenarios.
- If the heatmap shows many red areas, consider increasing the r.RayTracing.DecalGrid.MaxCount setting.
- Use in conjunction with other path tracing and decal-related settings for comprehensive debugging.
Regarding the associated variable CVarPathTracingDecalGridVisualize:
This is the actual console variable that controls the r.PathTracing.DecalGrid.Visualize setting. It’s an integer variable that directly corresponds to the setting described above.
The purpose of CVarPathTracingDecalGridVisualize is to provide a runtime-modifiable way to control the decal grid visualization in path tracing.
It’s used in the Renderer module, specifically in the path tracing system.
The value is set when the variable is initialized, but can be changed at runtime through console commands.
It interacts with the PathTracingData structure, specifically setting the VisualizeDecalGrid member.
Developers should be aware that changes to this variable will immediately affect the rendering output when path tracing is active.
Best practices include:
- Use this variable for real-time debugging and visualization of decal grid issues.
- Remember to reset it to 0 when finished debugging to avoid performance impact in production builds.
- Consider exposing this setting in debug UIs for easier access during development.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:284
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarPathTracingDecalGridVisualize(
TEXT("r.PathTracing.DecalGrid.Visualize"),
0,
TEXT("Enables a visualization mode of the decal grid density where red indicates the maximum decal count has been reached (default = 0)\n")
TEXT("0: off (default)\n")
TEXT("1: decal count heatmap (red - close to overflow, increase r.RayTracing.DecalGrid.MaxCount)\n")
TEXT("2: unique decal lists (colors are a function of which decals occupy each cell)\n"),
ECVF_RenderThreadSafe
#Associated Variable and Callsites
This variable is associated with another variable named CVarPathTracingDecalGridVisualize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:283
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<int32> CVarPathTracingDecalGridVisualize(
TEXT("r.PathTracing.DecalGrid.Visualize"),
0,
TEXT("Enables a visualization mode of the decal grid density where red indicates the maximum decal count has been reached (default = 0)\n")
TEXT("0: off (default)\n")
TEXT("1: decal count heatmap (red - close to overflow, increase r.RayTracing.DecalGrid.MaxCount)\n")
TEXT("2: unique decal lists (colors are a function of which decals occupy each cell)\n"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:638
Scope (from outer to inner):
file
function static void PreparePathTracingData
Source code excerpt:
PathTracingData.SamplerType = CVarPathTracingSamplerType.GetValueOnRenderThread();
PathTracingData.VisualizeLightGrid = CVarPathTracingLightGridVisualize.GetValueOnRenderThread();
PathTracingData.VisualizeDecalGrid = CVarPathTracingDecalGridVisualize.GetValueOnRenderThread();
PathTracingData.FilterWidth = CVarPathTracingFilterWidth.GetValueOnRenderThread();
PathTracingData.CameraFocusDistance = 0;
PathTracingData.CameraLensRadius = FVector2f::ZeroVector;
if (ShowFlags.DepthOfField &&
PPV.PathTracingEnableReferenceDOF &&
PPV.DepthOfFieldFocalDistance > 0 &&