r.LumenScene.DumpStats
r.LumenScene.DumpStats
#Overview
name: r.LumenScene.DumpStats
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to log Lumen scene stats on the next frame. 2 - dump mesh DF. 3 - dump LumenScene objects.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.DumpStats is to control the logging of Lumen scene statistics in the Unreal Engine 5 rendering system. It is specifically used for debugging and performance analysis of the Lumen global illumination system.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s clear that this variable is utilized within the Lumen visualization and scene data components.
The value of this variable is set through the Unreal Engine console or configuration files. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands.
The associated variable GLumenSceneDumpStats interacts directly with r.LumenScene.DumpStats. They share the same value, with GLumenSceneDumpStats being the actual integer variable used in the C++ code to control the behavior.
Developers should be aware that:
- This variable is meant for debugging purposes and should not be left enabled in production builds.
- Different values trigger different levels of stat dumping:
- 1: Logs general Lumen scene stats
- 2: Dumps mesh distance field information
- 3: Dumps LumenScene objects
Best practices when using this variable include:
- Use it sparingly and only when needed for debugging or performance analysis.
- Reset the value to 0 after gathering the required information to avoid unnecessary performance overhead.
- Be cautious when using it in large scenes, as dumping extensive stats could potentially cause performance issues.
Regarding the associated variable GLumenSceneDumpStats:
- Its purpose is to serve as the actual integer value that controls the stat dumping behavior in the C++ code.
- It’s used directly in the RenderLumenMiscVisualizations function to determine what type of stats to dump.
- The value is automatically reset to 0 after dumping the stats, ensuring it’s a one-time operation per setting.
- Developers should not modify this variable directly, but instead use the r.LumenScene.DumpStats console command to control its value.
#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:242
Scope: file
Source code excerpt:
int32 GLumenSceneDumpStats = 0;
FAutoConsoleVariableRef CVarLumenSceneDumpStats(
TEXT("r.LumenScene.DumpStats"),
GLumenSceneDumpStats,
TEXT("Whether to log Lumen scene stats on the next frame. 2 - dump mesh DF. 3 - dump LumenScene objects."),
ECVF_RenderThreadSafe
);
float GVisualizeLumenSceneCardInterpolateInfluenceRadius = 10.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSceneDumpStats
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:240
Scope: file
Source code excerpt:
);
int32 GLumenSceneDumpStats = 0;
FAutoConsoleVariableRef CVarLumenSceneDumpStats(
TEXT("r.LumenScene.DumpStats"),
GLumenSceneDumpStats,
TEXT("Whether to log Lumen scene stats on the next frame. 2 - dump mesh DF. 3 - dump LumenScene objects."),
ECVF_RenderThreadSafe
);
float GVisualizeLumenSceneCardInterpolateInfluenceRadius = 10.0f;
FAutoConsoleVariableRef CVarCardInterpolateInfluenceRadius(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:702
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderLumenMiscVisualizations
Source code excerpt:
RenderLumenRadiosityProbeVisualization(GraphBuilder, SceneTextures, FrameTemporaries);
if (GLumenSceneDumpStats)
{
FLumenSceneData& LumenSceneData = *Scene->GetLumenSceneData(Views[0]);
const FDistanceFieldSceneData& DistanceFieldSceneData = Scene->DistanceFieldSceneData;
LumenSceneData.DumpStats(
DistanceFieldSceneData,
/*bDumpMeshDistanceFields*/ GLumenSceneDumpStats == 2,
/*bDumpPrimitiveGroups*/ GLumenSceneDumpStats == 3);
GLumenSceneDumpStats = 0;
}
}
LumenRadianceCache::FRadianceCacheInputs GetFinalGatherRadianceCacheInputsForVisualize(const FViewInfo& View)
{
if (GLumenIrradianceFieldGather)