r.Lumen.Visualize.GridPixelSize

r.Lumen.Visualize.GridPixelSize

#Overview

name: r.Lumen.Visualize.GridPixelSize

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.GridPixelSize is to control the visualization grid size for Lumen, Unreal Engine 5’s global illumination system. It is specifically used for debugging and visualizing the Lumen scene.

This setting variable is primarily used in the Renderer module, specifically within the Lumen visualization system. It’s part of Unreal Engine’s rendering subsystem and is closely tied to the Lumen global illumination feature.

The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 32 and can be changed at runtime using console commands or through engine configuration files.

The associated variable GVisualizeLumenSceneGridPixelSize directly interacts with r.Lumen.Visualize.GridPixelSize. They share the same value, with GVisualizeLumenSceneGridPixelSize being the actual integer variable used in the C++ code.

Developers must be aware that this variable is used for visualization purposes only and does not affect the actual Lumen rendering. It’s primarily a debugging tool and should not be relied upon for gameplay or final rendering quality.

Best practices when using this variable include:

  1. Use it only for debugging and visualization purposes.
  2. Be aware of performance implications when setting very small grid sizes, as this could potentially impact frame rates during visualization.
  3. Experiment with different values to get the most useful visualization for your specific debugging needs.

Regarding the associated variable GVisualizeLumenSceneGridPixelSize:

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

Scope: file

Source code excerpt:

int32 GVisualizeLumenSceneGridPixelSize = 32;
FAutoConsoleVariableRef CVarVisualizeLumenSceneGridPixelSize(
	TEXT("r.Lumen.Visualize.GridPixelSize"),
	GVisualizeLumenSceneGridPixelSize,
	TEXT(""),
	ECVF_RenderThreadSafe
);

int32 GLumenVisualizeIndirectDiffuse = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GVisualizeLumenSceneGridPixelSize = 32;
FAutoConsoleVariableRef CVarVisualizeLumenSceneGridPixelSize(
	TEXT("r.Lumen.Visualize.GridPixelSize"),
	GVisualizeLumenSceneGridPixelSize,
	TEXT(""),
	ECVF_RenderThreadSafe
);

int32 GLumenVisualizeIndirectDiffuse = 0;
FAutoConsoleVariableRef CVarLumenVisualizeIndirectDiffuse(

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

Scope (from outer to inner):

file
function     void VisualizeLumenScene

Source code excerpt:

	else
	{
		const uint32 CullGridPixelSize = FMath::Clamp(GVisualizeLumenSceneGridPixelSize, 8, 1024);
		const FIntPoint CullGridSizeXY = FIntPoint::DivideAndRoundUp(View.ViewRect.Size(), CullGridPixelSize);
		const FIntVector CullGridSize = FIntVector(CullGridSizeXY.X, CullGridSizeXY.Y, 1);

		FLumenMeshSDFGridParameters MeshSDFGridParameters;
		MeshSDFGridParameters.CardGridPixelSizeShift = FMath::FloorLog2(CullGridPixelSize);
		MeshSDFGridParameters.CullGridSize = CullGridSize;