r.LumenScene.SurfaceCache.LogUpdates
r.LumenScene.SurfaceCache.LogUpdates
#Overview
name: r.LumenScene.SurfaceCache.LogUpdates
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to log Lumen surface cache updates.\n2 - will log mesh names.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.LogUpdates is to control the logging of Lumen surface cache updates in Unreal Engine 5’s rendering system. This setting variable is specifically related to the Lumen global illumination system, which is a part of UE5’s advanced rendering features.
This setting variable is primarily used in the Renderer module, specifically within the Lumen scene rendering subsystem. It’s referenced in the file LumenSceneRendering.cpp, which suggests it’s closely tied to the Lumen scene rendering process.
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.
This variable interacts directly with its associated variable GLumenSceneSurfaceCacheLogUpdates. They share the same value, with the console variable acting as an interface to set and retrieve the value, while the associated variable is used in the actual code logic.
Developers should be aware that this variable has multiple logging levels:
- When set to 1, it will log basic information about surface cache updates.
- When set to 2, it will additionally log mesh names, providing more detailed information.
Best practices when using this variable include:
- Use it primarily for debugging and performance analysis purposes.
- Be cautious about enabling it in production builds, as logging can impact performance.
- When investigating Lumen-related issues or optimizing Lumen performance, consider enabling this logging to gain insights into the surface cache update process.
Regarding the associated variable GLumenSceneSurfaceCacheLogUpdates:
- It’s an integer variable that stores the actual logging level.
- It’s used in conditional statements to determine whether and what to log.
- When working with Lumen scene rendering code, developers should check this variable’s value to add new logging statements or modify existing ones.
- Changes to the console variable r.LumenScene.SurfaceCache.LogUpdates will directly affect the value of GLumenSceneSurfaceCacheLogUpdates.
Remember that excessive logging can impact performance, so it’s important to use this feature judiciously, especially in performance-critical scenarios.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:177
Scope: file
Source code excerpt:
int32 GLumenSceneSurfaceCacheLogUpdates = 0;
FAutoConsoleVariableRef CVarLumenSceneSurfaceCacheLogUpdates(
TEXT("r.LumenScene.SurfaceCache.LogUpdates"),
GLumenSceneSurfaceCacheLogUpdates,
TEXT("Whether to log Lumen surface cache updates.\n")
TEXT("2 - will log mesh names."),
ECVF_RenderThreadSafe
);
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSceneSurfaceCacheLogUpdates
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:175
Scope: file
Source code excerpt:
);
int32 GLumenSceneSurfaceCacheLogUpdates = 0;
FAutoConsoleVariableRef CVarLumenSceneSurfaceCacheLogUpdates(
TEXT("r.LumenScene.SurfaceCache.LogUpdates"),
GLumenSceneSurfaceCacheLogUpdates,
TEXT("Whether to log Lumen surface cache updates.\n")
TEXT("2 - will log mesh names."),
ECVF_RenderThreadSafe
);
int32 GLumenSceneSurfaceCacheResampleLighting = 1;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:1593
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::BeginUpdateLumenSceneTasks
lambda-function
Source code excerpt:
#if (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT) && STATS
if (GLumenSceneSurfaceCacheLogUpdates != 0)
{
UE_LOG(LogRenderer, Log, TEXT("Surface Cache Updates: %d"), CardPagesToRender.Num());
if (GLumenSceneSurfaceCacheLogUpdates > 1)
{
for (const FCardPageRenderData& CardPageRenderData : CardPagesToRender)
{
const FLumenPrimitiveGroup& LumenPrimitiveGroup = LumenSceneData.PrimitiveGroups[CardPageRenderData.PrimitiveGroupIndex];
UE_LOG(LogRenderer, Log, TEXT("%s Instance:%d NumPrimsInGroup: %d"),