r.Lumen.ScreenProbeGather.RadianceCache.ClipmapDistributionBase
r.Lumen.ScreenProbeGather.RadianceCache.ClipmapDistributionBase
#Overview
name: r.Lumen.ScreenProbeGather.RadianceCache.ClipmapDistributionBase
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Base of the Pow() that controls the size of each successive clipmap relative to the first.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.RadianceCache.ClipmapDistributionBase is to control the size distribution of successive clipmaps in the Lumen Radiance Cache system. It serves as the base value for a power function that determines how the size of each clipmap relates to the first one.
This setting variable is primarily used in the Lumen rendering system, specifically in the Screen Probe Gather and Radiance Cache components. It’s part of Unreal Engine’s advanced lighting and global illumination features.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 2.0f and can be modified at runtime.
The associated variable GLumenRadianceCacheClipmapDistributionBase directly interacts with this console variable. They share the same value, with the console variable acting as an interface for runtime modification.
Developers should be aware that this variable affects the distribution of clipmap sizes in the Radiance Cache. A higher value will result in a more aggressive scaling of clipmap sizes, potentially improving performance at the cost of precision in distant areas.
Best practices when using this variable include:
- Carefully adjusting the value to balance performance and visual quality.
- Testing the impact of different values in various scenes to find the optimal setting for your specific use case.
- Considering the relationship between this variable and other Lumen settings, as they may interact to affect overall rendering quality and performance.
Regarding the associated variable GLumenRadianceCacheClipmapDistributionBase:
- It’s a float variable used internally in the rendering code to store the current clipmap distribution base value.
- It’s directly set by the console variable and used in the SetupRadianceCacheInputs function to configure the Radiance Cache parameters.
- When modifying this variable programmatically, developers should ensure thread safety, as it’s accessed in render thread contexts.
- Changes to this variable will immediately affect the Lumen Radiance Cache system’s behavior, potentially impacting rendering performance and quality.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:439
Scope: file
Source code excerpt:
float GLumenRadianceCacheClipmapDistributionBase = 2.0f;
FAutoConsoleVariableRef CVarLumenRadianceCacheClipmapDistributionBase(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.ClipmapDistributionBase"),
GLumenRadianceCacheClipmapDistributionBase,
TEXT("Base of the Pow() that controls the size of each successive clipmap relative to the first."),
ECVF_RenderThreadSafe
);
int32 GRadianceCacheNumProbesToTraceBudget = 300;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenRadianceCacheClipmapDistributionBase
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:437
Scope: file
Source code excerpt:
);
float GLumenRadianceCacheClipmapDistributionBase = 2.0f;
FAutoConsoleVariableRef CVarLumenRadianceCacheClipmapDistributionBase(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.ClipmapDistributionBase"),
GLumenRadianceCacheClipmapDistributionBase,
TEXT("Base of the Pow() that controls the size of each successive clipmap relative to the first."),
ECVF_RenderThreadSafe
);
int32 GRadianceCacheNumProbesToTraceBudget = 300;
FAutoConsoleVariableRef CVarRadianceCacheNumProbesToTraceBudget(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:549
Scope (from outer to inner):
file
namespace LumenScreenProbeGatherRadianceCache
function LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs
Source code excerpt:
Parameters.ReprojectionRadiusScale = GRadianceCacheReprojectionRadiusScale;
Parameters.ClipmapWorldExtent = GLumenRadianceCacheClipmapWorldExtent;
Parameters.ClipmapDistributionBase = GLumenRadianceCacheClipmapDistributionBase;
Parameters.RadianceProbeClipmapResolution = GetClipmapGridResolution();
Parameters.ProbeAtlasResolutionInProbes = FIntPoint(GRadianceCacheProbeAtlasResolutionInProbes, GRadianceCacheProbeAtlasResolutionInProbes);
Parameters.NumRadianceProbeClipmaps = GetNumClipmaps();
Parameters.RadianceProbeResolution = FMath::Max(GetProbeResolution(), LumenRadianceCache::MinRadianceProbeResolution);
Parameters.FinalProbeResolution = GetFinalProbeResolution();
Parameters.FinalRadianceAtlasMaxMip = GRadianceCacheNumMipmaps - 1;