r.Lumen.RadianceCache.VisualizeClipmapIndex
r.Lumen.RadianceCache.VisualizeClipmapIndex
#Overview
name: r.Lumen.RadianceCache.VisualizeClipmapIndex
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Selects which radiance cache clipmap should be visualized. -1 visualizes all clipmaps at once.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.RadianceCache.VisualizeClipmapIndex is to control the visualization of radiance cache clipmaps in Unreal Engine 5’s Lumen global illumination system. It allows developers to select which specific clipmap should be visualized or to visualize all clipmaps at once.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It’s specifically related to the radiance cache visualization feature of Lumen.
The value of this variable is set through the Unreal Engine console or configuration files. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands.
The variable interacts directly with GLumenRadianceCacheVisualizeClipmapIndex, which is the actual integer variable that stores the clipmap index to be visualized. When r.Lumen.RadianceCache.VisualizeClipmapIndex is set, it updates GLumenRadianceCacheVisualizeClipmapIndex.
Developers should be aware that:
- The valid range for this variable is from -1 to the number of clipmaps minus one.
- Setting it to -1 visualizes all clipmaps at once.
- This variable is marked as ECVF_RenderThreadSafe, meaning it’s safe to modify from any thread.
Best practices when using this variable include:
- Use it primarily for debugging and visualization purposes.
- Be cautious when using it in shipping builds, as visualization might impact performance.
- Remember to reset it to -1 (visualize all clipmaps) when done with specific clipmap debugging.
Regarding the associated variable GLumenRadianceCacheVisualizeClipmapIndex:
The purpose of GLumenRadianceCacheVisualizeClipmapIndex is to store the actual value of the clipmap index to be visualized. It’s the internal representation of the r.Lumen.RadianceCache.VisualizeClipmapIndex console variable.
This variable is used directly in the Lumen radiance cache visualization code within the Renderer module. It’s accessed in the RenderLumenRadianceCacheVisualization function to determine which clipmaps should be rendered for visualization.
The value of this variable is set automatically when r.Lumen.RadianceCache.VisualizeClipmapIndex is modified through the console or configuration files.
GLumenRadianceCacheVisualizeClipmapIndex interacts with the Lumen radiance cache visualization system, particularly in determining which clipmaps to render.
Developers should be aware that:
- This variable is initialized to -1, which means all clipmaps are visualized by default.
- It’s used in a FMath::Clamp function to ensure the value is within the valid range.
Best practices when working with this variable include:
- Avoid modifying it directly; instead, use the r.Lumen.RadianceCache.VisualizeClipmapIndex console variable.
- When debugging specific clipmap issues, remember that this variable controls which clipmaps are being visualized.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeRadianceCache.cpp:37
Scope: file
Source code excerpt:
int32 GLumenRadianceCacheVisualizeClipmapIndex = -1;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualizeClipmapIndex(
TEXT("r.Lumen.RadianceCache.VisualizeClipmapIndex"),
GLumenRadianceCacheVisualizeClipmapIndex,
TEXT("Selects which radiance cache clipmap should be visualized. -1 visualizes all clipmaps at once."),
ECVF_RenderThreadSafe
);
int32 GLumenRadianceCacheVisualizeProbeRadius = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenRadianceCacheVisualizeClipmapIndex
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeRadianceCache.cpp:35
Scope: file
Source code excerpt:
);
int32 GLumenRadianceCacheVisualizeClipmapIndex = -1;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualizeClipmapIndex(
TEXT("r.Lumen.RadianceCache.VisualizeClipmapIndex"),
GLumenRadianceCacheVisualizeClipmapIndex,
TEXT("Selects which radiance cache clipmap should be visualized. -1 visualizes all clipmaps at once."),
ECVF_RenderThreadSafe
);
int32 GLumenRadianceCacheVisualizeProbeRadius = 0;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualizeProbeRadius(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeRadianceCache.cpp:150
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderLumenRadianceCacheVisualization
Source code excerpt:
const LumenRadianceCache::FRadianceCacheInputs RadianceCacheInputs = GetFinalGatherRadianceCacheInputs(View);
const int32 VisualizationClipmapIndex = FMath::Clamp(GLumenRadianceCacheVisualizeClipmapIndex, -1, RadianceCacheState.Clipmaps.Num() - 1);
for (int32 ClipmapIndex = 0; ClipmapIndex < RadianceCacheState.Clipmaps.Num(); ++ClipmapIndex)
{
if (VisualizationClipmapIndex != -1 && VisualizationClipmapIndex != ClipmapIndex)
{
continue;
}