r.Lumen.Visualize.CardPlacementLOD

r.Lumen.Visualize.CardPlacementLOD

#Overview

name: r.Lumen.Visualize.CardPlacementLOD

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Lumen.Visualize.CardPlacementLOD is to control the visualization of Lumen card placement for different levels of detail (LOD) in the rendering system. This setting variable is specifically used for debugging and visualizing the Lumen global illumination system in Unreal Engine 5.

This setting variable is primarily used in the Renderer module, specifically within the Lumen subsystem. Based on the callsites, it’s clear that this variable is utilized in the LumenVisualize.cpp file, which is responsible for visualizing various aspects of the Lumen system.

The value of this variable is set through the console variable system in Unreal Engine. It can be changed at runtime using console commands or through configuration files.

The associated variable GVisualizeLumenCardPlacementLOD interacts directly with r.Lumen.Visualize.CardPlacementLOD. They share the same value, with GVisualizeLumenCardPlacementLOD being the actual integer variable used in the code to control the visualization behavior.

Developers must be aware that this variable affects the visualization of Lumen card placement, which is crucial for understanding and debugging the global illumination system. The variable allows for filtering the visualization based on different levels of detail: 0 - Visualize all card placements 1 - Visualize only primitives 2 - Visualize only merged instances 3 - Visualize only merged components 4 - Visualize only far field

Best practices when using this variable include:

  1. Use it primarily for debugging and visualization purposes, not for production builds.
  2. Experiment with different values to understand how Lumen card placement works at various levels of detail.
  3. Combine this visualization with other Lumen debugging tools for a comprehensive understanding of the global illumination system.
  4. Remember to reset the value to 0 or disable the visualization when not actively debugging to avoid performance overhead.

Regarding the associated variable GVisualizeLumenCardPlacementLOD:

#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:195

Scope: file

Source code excerpt:

int32 GVisualizeLumenCardPlacementLOD = 0;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardPlacementLOD(
	TEXT("r.Lumen.Visualize.CardPlacementLOD"),
	GVisualizeLumenCardPlacementLOD,
	TEXT("0 - all\n")
	TEXT("1 - only primitives\n")
	TEXT("2 - only merged instances\n")
	TEXT("3 - only merged components\n")
	TEXT("4 - only far field\n"),

#Associated Variable and Callsites

This variable is associated with another variable named GVisualizeLumenCardPlacementLOD. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:193

Scope: file

Source code excerpt:

);

int32 GVisualizeLumenCardPlacementLOD = 0;
FAutoConsoleVariableRef CVarVisualizeLumenSceneCardPlacementLOD(
	TEXT("r.Lumen.Visualize.CardPlacementLOD"),
	GVisualizeLumenCardPlacementLOD,
	TEXT("0 - all\n")
	TEXT("1 - only primitives\n")
	TEXT("2 - only merged instances\n")
	TEXT("3 - only merged components\n")
	TEXT("4 - only far field\n"),
	ECVF_RenderThreadSafe

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualize.cpp:1147

Scope (from outer to inner):

file
function     void VisualizeCardPlacement

Source code excerpt:

		bool bVisible = PrimitiveGroup.MeshCardsIndex >= 0;

		switch (GVisualizeLumenCardPlacementLOD)
		{
		case 1:
			bVisible = bVisible && !PrimitiveGroup.HasMergedInstances();
			break;

		case 2: