r.Lumen.Visualize.CardGenerationClusterScale
r.Lumen.Visualize.CardGenerationClusterScale
#Overview
name: r.Lumen.Visualize.CardGenerationClusterScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Visualize.CardGenerationClusterScale is to control the visualization scale of Lumen card generation clusters in Unreal Engine 5’s rendering system, specifically for debugging and development purposes.
This setting variable is primarily used within the Lumen subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s evident that this variable is utilized in the LumenVisualize.cpp file, which is part of the Lumen visualization system.
The value of this variable is set through the FAutoConsoleVariableRef mechanism, which allows it to be modified at runtime via console commands. It’s initialized with a default value of 1.0f.
The r.Lumen.Visualize.CardGenerationClusterScale variable interacts directly with the GVisualizeLumenCardGenerationClusterScale global variable. They share the same value, with the console variable acting as an interface to modify the global variable.
Developers must be aware that this variable is specifically for visualization purposes and should not be used to affect actual rendering behavior in production builds. It’s a tool for debugging and development, helping to visualize the card generation clusters used in Lumen’s global illumination system.
Best practices when using this variable include:
- Use it only during development and debugging phases.
- Adjust the scale to clearly visualize the card generation clusters without obscuring other important visual elements.
- Remember to reset it to the default value (1.0f) when not actively debugging to avoid any unintended visual artifacts.
Regarding the associated variable GVisualizeLumenCardGenerationClusterScale:
The purpose of GVisualizeLumenCardGenerationClusterScale is to store the actual scale value used for visualizing Lumen card generation clusters. It’s the internal representation of the console variable r.Lumen.Visualize.CardGenerationClusterScale.
This variable is used directly in the rendering code, specifically in the DrawSurfels function within LumenVisualize.cpp. It scales the wire box drawn to represent the card generation cluster.
The value of this variable is set by the console variable system when r.Lumen.Visualize.CardGenerationClusterScale is modified.
Developers should be aware that modifying this variable directly in code will not persist changes made through the console, as it will be overwritten by the console variable system.
Best practices for this variable include:
- Treat it as read-only in most code contexts, relying on the console variable for modifications.
- Use it consistently throughout the visualization code to ensure uniform scaling of all related debug visualizations.
- Consider clamping or validating its value if used in calculations to prevent potential issues with extreme scale values.
#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:155
Scope: file
Source code excerpt:
float GVisualizeLumenCardGenerationClusterScale = 1.0f;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardGenerationClusterScale(
TEXT("r.Lumen.Visualize.CardGenerationClusterScale"),
GVisualizeLumenCardGenerationClusterScale,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GVisualizeLumenCardGenerationCluster = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GVisualizeLumenCardGenerationClusterScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:153
Scope: file
Source code excerpt:
);
float GVisualizeLumenCardGenerationClusterScale = 1.0f;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardGenerationClusterScale(
TEXT("r.Lumen.Visualize.CardGenerationClusterScale"),
GVisualizeLumenCardGenerationClusterScale,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GVisualizeLumenCardGenerationCluster = 0;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardGenerationCluster(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:1094
Scope (from outer to inner):
file
function void DrawSurfels
Source code excerpt:
LocalBounds = LocalBounds.ExpandBy(1.0f);
DrawWireBox(&ViewPDI, PrimitiveToWorld, LocalBounds, SurfelColor, DepthPriority, GVisualizeLumenCardGenerationClusterScale);
const FVector Start = PrimitiveToWorld.TransformPosition(LocalBounds.GetCenter());
const FVector End = PrimitiveToWorld.TransformPosition(LocalBounds.GetCenter() + (FVector)NormalSum.GetSafeNormal() * 100.0f);
ViewPDI.DrawLine(Start, End, FLinearColor::Red, 0, 0.2f, 0.0f, false);
}
}