r.Lumen.RadianceCache.Visualize
r.Lumen.RadianceCache.Visualize
#Overview
name: r.Lumen.RadianceCache.Visualize
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.RadianceCache.Visualize is to control the visualization of the Lumen Radiance Cache in Unreal Engine 5’s rendering system. This setting is part of the Lumen global illumination system, specifically for debugging and development purposes.
-
This setting variable is primarily used by the Lumen subsystem within Unreal Engine’s rendering module. It’s referenced in the file “LumenVisualizeRadianceCache.cpp”, which suggests it’s specifically for visualizing the Radiance Cache component of Lumen.
-
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.
-
This variable interacts directly with GLumenRadianceCacheVisualize, an integer variable that shares the same value. It’s also used in conjunction with GLumenVisualizeTranslucencyVolumeRadianceCache and GLumenTranslucencyVolume for determining when to render the Lumen Radiance Cache visualization.
-
Developers should be aware that this is primarily a visualization tool for debugging purposes. It should typically be set to 0 (disabled) in production builds to avoid unnecessary rendering overhead.
-
Best practices for using this variable include:
- Use it during development and debugging of lighting issues related to Lumen’s Radiance Cache.
- Combine it with other Lumen visualization tools for a comprehensive understanding of the global illumination system.
- Remember to disable it in production builds or when profiling performance unrelated to the Radiance Cache.
Regarding the associated variable GLumenRadianceCacheVisualize:
- Its purpose is to store the actual value of the r.Lumen.RadianceCache.Visualize setting.
- It’s used directly in the rendering code to determine whether to visualize the Radiance Cache.
- The value is set by the console variable system when r.Lumen.RadianceCache.Visualize is modified.
- It interacts with other variables like GLumenVisualizeTranslucencyVolumeRadianceCache and GLumenTranslucencyVolume in the visualization logic.
- Developers should not modify this variable directly, but instead use the console command to change r.Lumen.RadianceCache.Visualize.
- Best practice is to treat this as a read-only variable in code and rely on the console variable system for modifications.
#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:13
Scope: file
Source code excerpt:
int32 GLumenRadianceCacheVisualize = 0;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualize(
TEXT("r.Lumen.RadianceCache.Visualize"),
GLumenRadianceCacheVisualize,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GLumenVisualizeTranslucencyVolumeRadianceCache = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenRadianceCacheVisualize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeRadianceCache.cpp:11
Scope: file
Source code excerpt:
#include "LumenTranslucencyVolumeLighting.h"
int32 GLumenRadianceCacheVisualize = 0;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualize(
TEXT("r.Lumen.RadianceCache.Visualize"),
GLumenRadianceCacheVisualize,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GLumenVisualizeTranslucencyVolumeRadianceCache = 0;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualizeTranslucencyVolume(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeRadianceCache.cpp:139
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderLumenRadianceCacheVisualization
Source code excerpt:
&& bAnyLumenActive
&& (LumenScreenProbeGather::UseRadianceCache(Views[0]) || (GLumenVisualizeTranslucencyVolumeRadianceCache && GLumenTranslucencyVolume))
&& GLumenRadianceCacheVisualize != 0)
{
RDG_EVENT_SCOPE(GraphBuilder, "VisualizeLumenRadianceCache");
const FRadianceCacheState& RadianceCacheState = GLumenVisualizeTranslucencyVolumeRadianceCache != 0 ? Views[0].ViewState->Lumen.TranslucencyVolumeRadianceCacheState : Views[0].ViewState->Lumen.RadianceCacheState;
FRDGTextureRef SceneColor = SceneTextures.Color.Resolve;