r.Lumen.ScreenProbeGather.VisualizeTracesFreeze

r.Lumen.ScreenProbeGather.VisualizeTracesFreeze

#Overview

name: r.Lumen.ScreenProbeGather.VisualizeTracesFreeze

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Lumen.ScreenProbeGather.VisualizeTracesFreeze is to control whether the visualization of trace data in Lumen’s Screen Probe Gathering system should be frozen or not. This setting is part of Unreal Engine 5’s rendering system, specifically the Lumen global illumination system.

This setting variable is primarily used in the Lumen module of Unreal Engine’s rendering system. It’s referenced in the LumenScreenProbeTracing.cpp file, which is part of the Renderer module.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.

The associated variable GLumenScreenProbeGatherVisualizeTracesFreeze directly interacts with r.Lumen.ScreenProbeGather.VisualizeTracesFreeze. They share the same value and are used interchangeably in the code.

Developers must be aware that when this variable is set to 1 (true), it will freeze the updating of visualize trace data. This means that any changes to console variables or shaders will not propagate until the visualization is unfrozen.

Best practices when using this variable include:

  1. Use it primarily for debugging or performance analysis purposes.
  2. Remember to unfreeze the visualization (set to 0) when you’re done analyzing to ensure the renderer continues to update properly.
  3. Be cautious when using this in production builds, as it can affect the visual quality and performance of the Lumen system.

Regarding the associated variable GLumenScreenProbeGatherVisualizeTracesFreeze:

This is an internal C++ variable that directly corresponds to the console variable r.Lumen.ScreenProbeGather.VisualizeTracesFreeze. It’s used within the C++ code to check the current state of the visualization freeze.

The purpose of GLumenScreenProbeGatherVisualizeTracesFreeze is to provide a quick, in-code way to check if the visualization is frozen. It’s used in the SetupVisualizeTraces function to determine whether the visualization buffer should be updated.

Developers should be aware that modifying this variable directly in code will have the same effect as changing the console variable. It’s generally better to use the console variable for runtime changes and leave this internal variable alone unless you’re modifying the engine code itself.

Best practices for GLumenScreenProbeGatherVisualizeTracesFreeze include:

  1. Treat it as read-only in most cases, using the console variable for changes instead.
  2. If you need to reference the freeze state in C++ code, use this variable rather than trying to query the console variable directly for better performance.

#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:89

Scope: file

Source code excerpt:

int32 GLumenScreenProbeGatherVisualizeTracesFreeze = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherVisualizeTracesFreeze(
	TEXT("r.Lumen.ScreenProbeGather.VisualizeTracesFreeze"),
	GLumenScreenProbeGatherVisualizeTracesFreeze,
	TEXT("Whether to freeze updating the visualize trace data.  Note that no changes to cvars or shaders will propagate until unfrozen."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeGatherHairStrands_VoxelTrace = 1;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GLumenScreenProbeGatherVisualizeTracesFreeze = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherVisualizeTracesFreeze(
	TEXT("r.Lumen.ScreenProbeGather.VisualizeTracesFreeze"),
	GLumenScreenProbeGatherVisualizeTracesFreeze,
	TEXT("Whether to freeze updating the visualize trace data.  Note that no changes to cvars or shaders will propagate until unfrozen."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeGatherHairStrands_VoxelTrace = 1;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherHairStrands_VoxelTrace(

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

Scope (from outer to inner):

file
function     void SetupVisualizeTraces

Source code excerpt:

	
	const int32 VisualizeBufferNumElements = ScreenProbeParameters.ScreenProbeTracingOctahedronResolution * ScreenProbeParameters.ScreenProbeTracingOctahedronResolution * 3;
	bool bShouldUpdate = !GLumenScreenProbeGatherVisualizeTracesFreeze;

	if (!VisualizeTracesData || VisualizeTracesData->Desc.NumElements != VisualizeBufferNumElements)
	{
		VisualizeTracesData = GraphBuilder.CreateBuffer(FRDGBufferDesc::CreateBufferDesc(sizeof(FVector4f), VisualizeBufferNumElements), TEXT("VisualizeTracesData"));
		bShouldUpdate = true;
	}