r.Lumen.Visualize.GridPixelSize
r.Lumen.Visualize.GridPixelSize
#Overview
name: r.Lumen.Visualize.GridPixelSize
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.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:
- Use it only for debugging and visualization purposes.
- Be aware of performance implications when setting very small grid sizes, as this could potentially impact frame rates during visualization.
- Experiment with different values to get the most useful visualization for your specific debugging needs.
Regarding the associated variable GVisualizeLumenSceneGridPixelSize:
- It’s the actual integer variable used in the C++ code to store the grid pixel size.
- It’s clamped between 8 and 1024 when used in the VisualizeLumenScene function, ensuring it stays within a reasonable range.
- It’s used to calculate the CullGridSize, which is likely used for culling operations in the Lumen visualization process.
- Developers should be aware that changes to r.Lumen.Visualize.GridPixelSize will directly affect this variable, and vice versa.
#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;