r.Lumen.ScreenProbeGather.VisualizeTraces

r.Lumen.ScreenProbeGather.VisualizeTraces

#Overview

name: r.Lumen.ScreenProbeGather.VisualizeTraces

This variable is created as a Console Variable (cvar).

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Lumen.ScreenProbeGather.VisualizeTraces is to enable visualization of traces for the center screen probe, which is useful for debugging the Lumen Screen Probe Gather system in Unreal Engine 5.

This setting variable is primarily used in the Lumen Screen Probe Gather subsystem, which is part of the Lumen global illumination system in Unreal Engine 5’s rendering pipeline. It’s specifically used in the screen probe tracing and visualization processes.

The value of this variable is set through the Unreal Engine console or configuration files using the command “r.Lumen.ScreenProbeGather.VisualizeTraces”. It’s defined as an integer (int32) and initialized to 0, meaning the visualization is disabled by default.

This variable interacts with other parts of the Screen Probe Gather system:

  1. It’s used to automatically set a fixed jitter index when visualization is enabled.
  2. It triggers the setup of trace visualization when enabled.

Developers should be aware that:

  1. Enabling this variable will impact performance, as it adds additional visualization passes.
  2. It’s intended for debugging purposes and should generally be disabled in production builds.

Best practices for using this variable include:

  1. Only enable it when debugging specific Screen Probe Gather issues.
  2. Disable it when not actively debugging to avoid performance overhead.
  3. Use in conjunction with other Lumen debugging tools for comprehensive analysis.

The associated variable GLumenScreenProbeGatherVisualizeTraces is the C++ implementation of this console variable. It directly controls the behavior in the code and shares the same value as the console variable. When using this variable in C++ code, developers should treat it the same way as the console variable, being mindful of its performance implications and debugging nature.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:81

Scope: file

Source code excerpt:

int32 GLumenScreenProbeGatherVisualizeTraces = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherVisualizeTraces(
	TEXT("r.Lumen.ScreenProbeGather.VisualizeTraces"),
	GLumenScreenProbeGatherVisualizeTraces,
	TEXT("Whether to visualize traces for the center screen probe, useful for debugging"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeGatherVisualizeTracesFreeze = 0;

#Associated Variable and Callsites

This variable is associated with another variable named GLumenScreenProbeGatherVisualizeTraces. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1891

Scope (from outer to inner):

file
function     FSSDSignalTextures FDeferredShadingSceneRenderer::RenderLumenScreenProbeGather

Source code excerpt:

	}

	extern int32 GLumenScreenProbeGatherVisualizeTraces;
	// Automatically set a fixed jitter if we are visualizing, but don't override existing fixed jitter
	if (GLumenScreenProbeGatherVisualizeTraces != 0 && ScreenProbeParameters.FixedJitterIndex < 0)
	{
		ScreenProbeParameters.FixedJitterIndex = 6;
	}

	uint32 StateFrameIndex = View.ViewState ? View.ViewState->GetFrameIndex() : 0;
	if (ScreenProbeParameters.FixedJitterIndex >= 0)

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:79

Scope: file

Source code excerpt:

);

int32 GLumenScreenProbeGatherVisualizeTraces = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherVisualizeTraces(
	TEXT("r.Lumen.ScreenProbeGather.VisualizeTraces"),
	GLumenScreenProbeGatherVisualizeTraces,
	TEXT("Whether to visualize traces for the center screen probe, useful for debugging"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeGatherVisualizeTracesFreeze = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherVisualizeTracesFreeze(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:503

Scope (from outer to inner):

file
function     void GetScreenProbeVisualizeTracesBuffer

Source code excerpt:

void GetScreenProbeVisualizeTracesBuffer(TRefCountPtr<FRDGPooledBuffer>& VisualizeTracesData)
{
	if (GLumenScreenProbeGatherVisualizeTraces && GVisualizeTracesData.IsValid())
	{
		VisualizeTracesData = GVisualizeTracesData;
	}
}

enum class ECompactedTracingIndirectArgs

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:908

Scope (from outer to inner):

file
function     void TraceScreenProbes

Source code excerpt:

	TraceVoxels(false);

	if (GLumenScreenProbeGatherVisualizeTraces)
	{
		SetupVisualizeTraces(GraphBuilder, SceneTextures, Scene, View, ScreenProbeParameters, ComputePassFlags);
	}
}