r.Lumen.Visualize.CardPlacementDistance
r.Lumen.Visualize.CardPlacementDistance
#Overview
name: r.Lumen.Visualize.CardPlacementDistance
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Visualize.CardPlacementDistance is to control the visualization distance for Lumen card placement in Unreal Engine 5’s rendering system. It is used specifically for debugging and visualizing the Lumen global illumination system.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It’s referenced in the LumenVisualize.cpp file, which suggests it’s part of the visualization tools for Lumen.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 5000.0f and can be changed at runtime using console commands.
The associated variable GVisualizeLumenCardPlacementDistance directly interacts with r.Lumen.Visualize.CardPlacementDistance. They share the same value, with GVisualizeLumenCardPlacementDistance being the actual variable used in the C++ code.
Developers should be aware that this variable affects the visualization distance for Lumen card placement. It’s used in distance checks to determine whether certain Lumen-related elements should be visualized. The variable is squared in these checks, so changes to its value will have a quadratic effect on the visualization area.
Best practices when using this variable include:
- Use it primarily for debugging and visualization purposes.
- Adjust the value based on the scale of your scene to ensure proper visualization.
- Be aware that larger values may impact performance if many elements are being visualized.
Regarding the associated variable GVisualizeLumenCardPlacementDistance:
The purpose of GVisualizeLumenCardPlacementDistance is to store the actual value used in the C++ code for the Lumen card placement visualization distance.
It’s used in the same Lumen subsystem of the rendering module as r.Lumen.Visualize.CardPlacementDistance.
The value is set through the console variable system, initialized to 5000.0f.
It directly interacts with r.Lumen.Visualize.CardPlacementDistance, sharing the same value.
Developers should be aware that this is the actual variable used in distance calculations for Lumen visualization. Any changes to r.Lumen.Visualize.CardPlacementDistance will be reflected in this variable.
Best practices include using this variable for read-only purposes in C++ code, and modifying its value through the r.Lumen.Visualize.CardPlacementDistance console variable when needed.
#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:187
Scope: file
Source code excerpt:
float GVisualizeLumenCardPlacementDistance = 5000.0f;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardPlacementDistance(
TEXT("r.Lumen.Visualize.CardPlacementDistance"),
GVisualizeLumenCardPlacementDistance,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GVisualizeLumenCardPlacementLOD = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GVisualizeLumenCardPlacementDistance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:185
Scope: file
Source code excerpt:
);
float GVisualizeLumenCardPlacementDistance = 5000.0f;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardPlacementDistance(
TEXT("r.Lumen.Visualize.CardPlacementDistance"),
GVisualizeLumenCardPlacementDistance,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GVisualizeLumenCardPlacementLOD = 0;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardPlacementLOD(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:1116
Scope (from outer to inner):
file
function void VisualizeRayTracingGroups
Source code excerpt:
if ((GVisualizeLumenRayTracingGroups != 2 || !PrimitiveGroup.HasMergedInstances())
&& PrimitiveGroup.HasMergedPrimitives()
&& PrimitiveGroup.WorldSpaceBoundingBox.ComputeSquaredDistanceToPoint((FVector3f)View.ViewMatrices.GetViewOrigin()) < GVisualizeLumenCardPlacementDistance * GVisualizeLumenCardPlacementDistance
&& ViewFrustum.IntersectBox((FVector)PrimitiveGroup.WorldSpaceBoundingBox.GetCenter(), (FVector)PrimitiveGroup.WorldSpaceBoundingBox.GetExtent()))
{
const uint32 GroupIdHash = GetTypeHash(PrimitiveGroup.RayTracingGroupMapElementId.GetIndex());
const uint8 DepthPriority = SDPG_World;
const uint8 Hue = GroupIdHash & 0xFF;
const uint8 Saturation = 0xFF;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:1167
Scope (from outer to inner):
file
function void VisualizeCardPlacement
Source code excerpt:
if (bVisible
&& PrimitiveGroup.WorldSpaceBoundingBox.ComputeSquaredDistanceToPoint((FVector3f)View.ViewMatrices.GetViewOrigin()) < GVisualizeLumenCardPlacementDistance * GVisualizeLumenCardPlacementDistance
&& ViewFrustum.IntersectBox((FVector)PrimitiveGroup.WorldSpaceBoundingBox.GetCenter(), (FVector)PrimitiveGroup.WorldSpaceBoundingBox.GetExtent()))
{
const FLumenMeshCards& MeshCardsEntry = LumenSceneData.MeshCards[PrimitiveGroup.MeshCardsIndex];
for (uint32 CardIndex = MeshCardsEntry.FirstCardIndex; CardIndex < MeshCardsEntry.FirstCardIndex + MeshCardsEntry.NumCards; ++CardIndex)
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:1254
Scope (from outer to inner):
file
function void VisualizeCardGeneration
Source code excerpt:
for (const FLumenPrimitiveGroup& PrimitiveGroup : LumenSceneData.PrimitiveGroups)
{
if (PrimitiveGroup.WorldSpaceBoundingBox.ComputeSquaredDistanceToPoint((FVector3f)View.ViewMatrices.GetViewOrigin()) < GVisualizeLumenCardPlacementDistance * GVisualizeLumenCardPlacementDistance
&& ViewFrustum.IntersectBox((FVector)PrimitiveGroup.WorldSpaceBoundingBox.GetCenter(), (FVector)PrimitiveGroup.WorldSpaceBoundingBox.GetExtent()))
{
for (const FPrimitiveSceneInfo* PrimitiveSceneInfo : PrimitiveGroup.Primitives)
{
if (PrimitiveSceneInfo && PrimitiveSceneInfo->Proxy)
{