r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard
r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard
#Overview
name: r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Spawn only a specified card on mesh. Useful for debugging.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard is to facilitate debugging of the Lumen mesh card system by allowing developers to spawn only a specified card on a mesh.
This setting variable is primarily used in the Lumen rendering system, specifically in the mesh cards component of Lumen’s surface cache. It is part of Unreal Engine’s rendering module.
The value of this variable is set through the console variable system, as indicated by the FAutoConsoleVariableRef declaration. It can be changed at runtime using console commands.
The associated variable GLumenMeshCardsDebugSingleCard directly interacts with r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard. They share the same value, with GLumenMeshCardsDebugSingleCard being the actual integer variable used in the code.
Developers must be aware that:
- This variable is intended for debugging purposes only and should not be used in production builds.
- When set to a non-negative value, it will cause only the specified card to be spawned, which can significantly alter the rendering output.
- Changing this value triggers a recreation of render states for global components, which can impact performance.
Best practices when using this variable include:
- Use it only during development and debugging phases.
- Reset it to -1 (default value) after debugging to restore normal mesh card behavior.
- Be prepared for potential performance impacts when changing this value, due to the render state recreation.
Regarding the associated variable GLumenMeshCardsDebugSingleCard:
- Its purpose is to store the actual integer value used for debugging single mesh cards.
- It is used directly in the rendering code to determine which card to spawn or cull.
- The variable is initialized to -1, which means no specific card is being debugged.
- In debug or development builds, it’s used in the MeshCardCullTest function to override normal culling behavior.
- Developers should be cautious when modifying this variable directly, as it’s intended to be controlled through the console variable system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenMeshCards.cpp:105
Scope: file
Source code excerpt:
int32 GLumenMeshCardsDebugSingleCard = -1;
FAutoConsoleVariableRef CVarLumenMeshCardsDebugSingleCard(
TEXT("r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard"),
GLumenMeshCardsDebugSingleCard,
TEXT("Spawn only a specified card on mesh. Useful for debugging."),
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* InVariable)
{
FGlobalComponentRecreateRenderStateContext Context;
}),
#Associated Variable and Callsites
This variable is associated with another variable named GLumenMeshCardsDebugSingleCard
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenMeshCards.cpp:103
Scope: file
Source code excerpt:
);
int32 GLumenMeshCardsDebugSingleCard = -1;
FAutoConsoleVariableRef CVarLumenMeshCardsDebugSingleCard(
TEXT("r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard"),
GLumenMeshCardsDebugSingleCard,
TEXT("Spawn only a specified card on mesh. Useful for debugging."),
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* InVariable)
{
FGlobalComponentRecreateRenderStateContext Context;
}),
ECVF_RenderThreadSafe
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenMeshCards.cpp:840
Scope (from outer to inner):
file
function bool MeshCardCullTest
Source code excerpt:
{
#if UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT
if (GLumenMeshCardsDebugSingleCard >= 0)
{
return GLumenMeshCardsDebugSingleCard == CardIndex;
}
#endif
const FVector3f ScaledBoundsSize = 2.0f * CardBuildData.OBB.Extent * LocalToWorldScale;
const float SurfaceArea = ScaledBoundsSize.X * ScaledBoundsSize.Y;
const bool bCardPassedCulling = (!GLumenMeshCardsCullFaces || SurfaceArea > MinFaceSurfaceArea);