r.Lumen.Reflections.VisualizeTraces
r.Lumen.Reflections.VisualizeTraces
#Overview
name: r.Lumen.Reflections.VisualizeTraces
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to visualize reflection traces from cursor position, useful for debugging
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.VisualizeTraces is to enable the visualization of reflection traces from the cursor position, which is useful for debugging the Lumen reflection system in Unreal Engine 5.
This setting variable is primarily used in the Lumen reflection subsystem within the Unreal Engine 5 rendering module. It is specifically utilized in the reflection tracing process, which is a part of the Lumen global illumination system.
The value of this variable is set through the console variable system in Unreal Engine. It is initialized with a default value of 0, meaning the visualization is disabled by default.
The associated C++ variable CVarLumenReflectionsVisualizeTraces directly interacts with this setting. When the value of r.Lumen.Reflections.VisualizeTraces is changed, CVarLumenReflectionsVisualizeTraces reflects that change.
Developers should be aware that enabling this variable will impact performance, as it adds additional visualization calculations to the rendering pipeline. It should only be used for debugging purposes and not in production builds.
Best practices for using this variable include:
- Only enable it when actively debugging reflection issues.
- Disable it when not needed to avoid unnecessary performance overhead.
- Use it in conjunction with other Lumen debugging tools for comprehensive analysis.
Regarding the associated variable CVarLumenReflectionsVisualizeTraces:
The purpose of CVarLumenReflectionsVisualizeTraces is to provide a C++ interface for the r.Lumen.Reflections.VisualizeTraces console variable within the engine’s code.
This variable is used in the Lumen reflection tracing system, specifically in the TraceReflections function of the LumenReflectionTracing.cpp file.
The value of CVarLumenReflectionsVisualizeTraces is set by the console variable system when r.Lumen.Reflections.VisualizeTraces is modified.
It directly controls whether the visualization of reflection traces is enabled in the rendering pipeline.
Developers should be aware that checking the value of this variable has a small performance cost, so it should only be done when necessary.
Best practices for using CVarLumenReflectionsVisualizeTraces include:
- Use it as a condition for enabling debug visualization code paths.
- Ensure that any code depending on this variable is properly optimized out in shipping builds.
- Consider caching the value if it’s checked frequently in performance-critical code sections.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflectionTracing.cpp:140
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarLumenReflectionsVisualizeTraces(
TEXT("r.Lumen.Reflections.VisualizeTraces"),
0,
TEXT("Whether to visualize reflection traces from cursor position, useful for debugging"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenReflectionsHardwareRayTracingTranslucentMaxRefractionBounces(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenReflectionsVisualizeTraces
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflectionTracing.cpp:139
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarLumenReflectionsVisualizeTraces(
TEXT("r.Lumen.Reflections.VisualizeTraces"),
0,
TEXT("Whether to visualize reflection traces from cursor position, useful for debugging"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflectionTracing.cpp:1094
Scope (from outer to inner):
file
function void TraceReflections
Source code excerpt:
}
if (CVarLumenReflectionsVisualizeTraces.GetValueOnRenderThread())
{
ShaderPrint::SetEnabled(true);
FVisualizeReflectionTracesCS::FParameters* PassParameters = GraphBuilder.AllocParameters<FVisualizeReflectionTracesCS::FParameters>();
PassParameters->View = View.ViewUniformBuffer;
PassParameters->ReflectionTracingParameters = ReflectionTracingParameters;