r.Lumen.RadianceCache.VisualizeRadiusScale
r.Lumen.RadianceCache.VisualizeRadiusScale
#Overview
name: r.Lumen.RadianceCache.VisualizeRadiusScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Scales the size of the spheres used to visualize radiance cache samples.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.RadianceCache.VisualizeRadiusScale is to control the size of the spheres used to visualize radiance cache samples in Unreal Engine 5’s Lumen global illumination system. This setting variable is part of the rendering system, specifically the Lumen subsystem responsible for real-time global illumination.
The Unreal Engine subsystem that relies on this setting variable is the Lumen module within the rendering system. It is used in the visualization of the radiance cache, which is a key component of Lumen’s global illumination solution.
The value of this variable is set through the Unreal Engine console variable system. It is defined as an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands or configuration files.
This variable interacts directly with GLumenRadianceCacheVisualizeRadiusScale, which is the actual float variable that stores the scale value. The console variable r.Lumen.RadianceCache.VisualizeRadiusScale is linked to GLumenRadianceCacheVisualizeRadiusScale, allowing the engine to modify the value through the console system.
Developers must be aware that this variable is specifically for visualization purposes and does not affect the actual rendering or global illumination calculations. It’s a debug tool to help visualize the radiance cache samples in the scene.
Best practices when using this variable include:
- Use it only for debugging and visualization purposes.
- Adjust the value incrementally to find the best visualization scale for your specific scene.
- Remember to disable or reset the visualization when not needed, as it may impact performance.
Regarding the associated variable GLumenRadianceCacheVisualizeRadiusScale:
The purpose of GLumenRadianceCacheVisualizeRadiusScale is to store the actual float value used to scale the size of the spheres representing radiance cache samples in the Lumen visualization.
This variable is used directly in the Lumen rendering code, specifically in the FDeferredShadingSceneRenderer::RenderLumenRadianceCacheVisualization function. It’s part of the Lumen module in the rendering system.
The value of GLumenRadianceCacheVisualizeRadiusScale is set through the r.Lumen.RadianceCache.VisualizeRadiusScale console variable. Its default value is 0.05f.
GLumenRadianceCacheVisualizeRadiusScale interacts with the VisualizeProbeRadiusScale member of the FVisualizeRadianceCacheCommonParameters struct, which is used in the radiance cache visualization process.
Developers should be aware that modifying this variable directly in code is not recommended. Instead, they should use the console variable r.Lumen.RadianceCache.VisualizeRadiusScale to change its value.
Best practices for using GLumenRadianceCacheVisualizeRadiusScale include:
- Avoid modifying it directly in code; use the console variable instead.
- Consider the scale of your scene when adjusting this value to ensure the visualization is appropriately sized.
- Use it in conjunction with other Lumen visualization tools for a comprehensive understanding of the radiance cache behavior.
#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:29
Scope: file
Source code excerpt:
float GLumenRadianceCacheVisualizeRadiusScale = .05f;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualizeRadiusScale(
TEXT("r.Lumen.RadianceCache.VisualizeRadiusScale"),
GLumenRadianceCacheVisualizeRadiusScale,
TEXT("Scales the size of the spheres used to visualize radiance cache samples."),
ECVF_RenderThreadSafe
);
int32 GLumenRadianceCacheVisualizeClipmapIndex = -1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenRadianceCacheVisualizeRadiusScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeRadianceCache.cpp:27
Scope: file
Source code excerpt:
);
float GLumenRadianceCacheVisualizeRadiusScale = .05f;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualizeRadiusScale(
TEXT("r.Lumen.RadianceCache.VisualizeRadiusScale"),
GLumenRadianceCacheVisualizeRadiusScale,
TEXT("Scales the size of the spheres used to visualize radiance cache samples."),
ECVF_RenderThreadSafe
);
int32 GLumenRadianceCacheVisualizeClipmapIndex = -1;
FAutoConsoleVariableRef CVarLumenRadianceCacheVisualizeClipmapIndex(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeRadianceCache.cpp:162
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderLumenRadianceCacheVisualization
Source code excerpt:
FVisualizeRadianceCacheCommonParameters VisualizeCommonParameters;
LumenRadianceCache::GetInterpolationParameters(View, GraphBuilder, RadianceCacheState, RadianceCacheInputs, VisualizeCommonParameters.RadianceCacheParameters);
VisualizeCommonParameters.VisualizeProbeRadiusScale = GLumenRadianceCacheVisualizeRadiusScale;
VisualizeCommonParameters.ProbeClipmapIndex = ClipmapIndex;
VisualizeCommonParameters.ProbeCoordToWorldCenterBias = (FVector3f)Clipmap.ProbeCoordToWorldCenterBias;
VisualizeCommonParameters.ProbeCoordToWorldCenterScale = Clipmap.ProbeCoordToWorldCenterScale;
FVisualizeRadianceCacheParameters* PassParameters = GraphBuilder.AllocParameters<FVisualizeRadianceCacheParameters>();
PassParameters->VS.VisualizeCommonParameters = VisualizeCommonParameters;