r.Lumen.Visualize.UseShaderPrintForTraces
r.Lumen.Visualize.UseShaderPrintForTraces
#Overview
name: r.Lumen.Visualize.UseShaderPrintForTraces
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to use ShaderPrint or custom line renderer for trace visualization.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Visualize.UseShaderPrintForTraces is to control the visualization method for trace visualization in the Lumen lighting system. It determines whether to use ShaderPrint or a custom line renderer for visualizing traces.
This setting variable is primarily used by the Lumen subsystem within Unreal Engine’s rendering module. Based on the callsites, it is specifically utilized in the LumenVisualize.cpp file, which is part of the Lumen visualization functionality.
The value of this variable is set through a console variable (CVarVisualizeUseShaderPrintForTraces) with a default value of 1. It can be modified at runtime through console commands or programmatically.
The associated variable CVarVisualizeUseShaderPrintForTraces directly interacts with r.Lumen.Visualize.UseShaderPrintForTraces. They share the same value and purpose.
Developers must be aware that this variable affects the visualization method for Lumen traces. When set to 1 (default), it uses ShaderPrint for visualization. When set to 0, it uses a custom line renderer.
Best practices when using this variable include:
- Use it for debugging and visualization purposes only, not in production builds.
- Be aware of potential performance differences between ShaderPrint and custom line renderer methods.
- Consider the target platform when choosing between these visualization methods, as ShaderPrint might not be available or perform differently on all platforms.
Regarding the associated variable CVarVisualizeUseShaderPrintForTraces:
- It is an auto console variable of type int.
- It is defined with the same default value (1) and description as r.Lumen.Visualize.UseShaderPrintForTraces.
- It has the flags ECVF_Scalability and ECVF_RenderThreadSafe, indicating it’s safe to modify on the render thread and can be adjusted for different scalability settings.
- It is used directly in the RenderVisualizeTraces function to determine which visualization method to use.
When working with this variable, developers should use the CVarVisualizeUseShaderPrintForTraces.GetValueOnRenderThread() method to safely retrieve its value on the render thread.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:257
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int> CVarVisualizeUseShaderPrintForTraces(
TEXT("r.Lumen.Visualize.UseShaderPrintForTraces"),
1,
TEXT("Whether to use ShaderPrint or custom line renderer for trace visualization."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
bool Lumen::ShouldVisualizeScene(const FEngineShowFlags& ShowFlags)
#Associated Variable and Callsites
This variable is associated with another variable named CVarVisualizeUseShaderPrintForTraces
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:256
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int> CVarVisualizeUseShaderPrintForTraces(
TEXT("r.Lumen.Visualize.UseShaderPrintForTraces"),
1,
TEXT("Whether to use ShaderPrint or custom line renderer for trace visualization."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:491
Scope (from outer to inner):
file
function void RenderVisualizeTraces
Source code excerpt:
FRDGBufferRef EyeAdaptationBuffer)
{
if (CVarVisualizeUseShaderPrintForTraces.GetValueOnRenderThread() == 0)
{
return;
}
extern void GetReflectionsVisualizeTracesBuffer(TRefCountPtr<FRDGPooledBuffer>&VisualizeTracesData);
extern void GetScreenProbeVisualizeTracesBuffer(TRefCountPtr<FRDGPooledBuffer>&VisualizeTracesData);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:536
Scope (from outer to inner):
file
function void RenderVisualizeTraces
Source code excerpt:
const FMinimalSceneTextures& SceneTextures)
{
if (CVarVisualizeUseShaderPrintForTraces.GetValueOnRenderThread() != 0)
{
return;
}
extern void GetReflectionsVisualizeTracesBuffer(TRefCountPtr<FRDGPooledBuffer>& VisualizeTracesData);
extern void GetScreenProbeVisualizeTracesBuffer(TRefCountPtr<FRDGPooledBuffer>& VisualizeTracesData);