r.Lumen.Visualize.ConeStepFactor

r.Lumen.Visualize.ConeStepFactor

#Overview

name: r.Lumen.Visualize.ConeStepFactor

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.ConeStepFactor is to control the cone step scale on sphere radius step size in the Lumen visualization system. This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically for its visualization and debugging features.

The Lumen visualization subsystem within the Renderer module relies on this setting variable. It’s used in the LumenVisualize.cpp file, which is responsible for rendering debug visualizations of the Lumen system.

The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 2.0f and can be modified at runtime using console commands.

This variable interacts directly with GVisualizeLumenSceneConeStepFactor, which is the associated C++ global variable that stores the actual value. They share the same value, with the console variable acting as an interface for runtime modification.

Developers must be aware that this variable affects the visualization of the Lumen system, not its actual rendering performance. It’s primarily used for debugging and fine-tuning purposes. The value is clamped between 0.1f and 10.0f when used in calculations, so setting values outside this range will be automatically limited.

Best practices when using this variable include:

  1. Use it in conjunction with other Lumen visualization tools for comprehensive debugging.
  2. Adjust the value incrementally to observe changes in the visualization.
  3. Remember that extreme values may make the visualization less useful or harder to interpret.
  4. Reset to the default value (2.0f) when not actively debugging to ensure standard visualization behavior.

Regarding the associated variable GVisualizeLumenSceneConeStepFactor:

The purpose of GVisualizeLumenSceneConeStepFactor is to store the actual value of the cone step factor used in Lumen visualization calculations. It’s the C++ representation of the console variable r.Lumen.Visualize.ConeStepFactor.

This variable is used directly in the Lumen visualization code within the Renderer module. It’s accessed when setting up visualization parameters for the Lumen scene.

The value of GVisualizeLumenSceneConeStepFactor is set by the console variable system when r.Lumen.Visualize.ConeStepFactor is modified. It’s initialized with a default value of 2.0f.

It interacts primarily with r.Lumen.Visualize.ConeStepFactor, as they share the same value. It’s also used in calculations alongside other visualization parameters.

Developers should be aware that modifying GVisualizeLumenSceneConeStepFactor directly in C++ code is not recommended. Instead, they should use the console variable r.Lumen.Visualize.ConeStepFactor to ensure proper synchronization and thread safety.

Best practices for using GVisualizeLumenSceneConeStepFactor include:

  1. Avoid modifying it directly in C++ code; use the console variable instead.
  2. When reading its value in C++ code, be aware that it may change at runtime due to console commands.
  3. Consider using FMath::Clamp when applying the value to ensure it stays within the intended range, as demonstrated in the provided code snippet.

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

Scope: file

Source code excerpt:

float GVisualizeLumenSceneConeStepFactor = 2.0f;
FAutoConsoleVariableRef CVarVisualizeLumenSceneConeStepFactor(
	TEXT("r.Lumen.Visualize.ConeStepFactor"),
	GVisualizeLumenSceneConeStepFactor,
	TEXT("Cone step scale on sphere radius step size."),
	ECVF_RenderThreadSafe
	);

float GVisualizeLumenSceneMinTraceDistance = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	);

float GVisualizeLumenSceneConeStepFactor = 2.0f;
FAutoConsoleVariableRef CVarVisualizeLumenSceneConeStepFactor(
	TEXT("r.Lumen.Visualize.ConeStepFactor"),
	GVisualizeLumenSceneConeStepFactor,
	TEXT("Cone step scale on sphere radius step size."),
	ECVF_RenderThreadSafe
	);

float GVisualizeLumenSceneMinTraceDistance = 0;
FAutoConsoleVariableRef CVarVisualizeLumenSceneMinTraceDistance(

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

Scope (from outer to inner):

file
function     void SetupVisualizeParameters

Source code excerpt:

		}

		VisualizeParameters.VisualizeStepFactor = FMath::Clamp(GVisualizeLumenSceneConeStepFactor, .1f, 10.0f);
		VisualizeParameters.MinTraceDistance = FMath::Clamp(GVisualizeLumenSceneMinTraceDistance, .01f, 1000.0f);
		VisualizeParameters.MaxTraceDistance = FMath::Clamp(MaxTraceDistance, .01f, Lumen::MaxTraceDistance);
		VisualizeParameters.CardInterpolateInfluenceRadius = GVisualizeLumenSceneCardInterpolateInfluenceRadius;
		VisualizeParameters.MaxMeshSDFTraceDistanceForVoxelTracing = FMath::Clamp(MaxMeshSDFTraceDistance, VisualizeParameters.MinTraceDistance, VisualizeParameters.MaxTraceDistance);
		VisualizeParameters.MaxMeshSDFTraceDistance = FMath::Clamp(MaxMeshSDFTraceDistance, VisualizeParameters.MinTraceDistance, VisualizeParameters.MaxTraceDistance);
		VisualizeParameters.HeightfieldMaxTracingSteps = Lumen::GetHeightfieldMaxTracingSteps();