r.Lumen.TranslucencyVolume.RadianceCache.ProbeAtlasResolutionInProbes
r.Lumen.TranslucencyVolume.RadianceCache.ProbeAtlasResolutionInProbes
#Overview
name: r.Lumen.TranslucencyVolume.RadianceCache.ProbeAtlasResolutionInProbes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of probes along one dimension of the probe atlas cache texture. This controls the memory usage of the cache. Overflow currently results in incorrect rendering.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.TranslucencyVolume.RadianceCache.ProbeAtlasResolutionInProbes is to control the resolution of the probe atlas cache texture used in Lumen’s Translucency Volume Radiance Cache system. It specifically defines the number of probes along one dimension of the atlas texture, which directly impacts the memory usage of the cache.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine 5’s rendering module. It’s particularly relevant to the Translucency Volume Lighting feature, which is part of the Lumen global illumination system.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 128 and can be modified at runtime using console commands.
The variable interacts closely with its associated C++ variable GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes. They share the same value, with the console variable providing an interface for runtime modification.
Developers must be aware that this variable directly affects memory usage. Increasing the value will result in higher memory consumption but potentially better quality rendering. However, the code comment warns that overflow (likely when the value is set too high) can result in incorrect rendering.
Best practices when using this variable include:
- Balancing between quality and memory usage based on target hardware capabilities.
- Monitoring performance and visual quality when adjusting this value.
- Being cautious of potential overflow issues when increasing the value.
- Consider the interaction with other Lumen settings for optimal results.
Regarding the associated variable GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes:
The purpose of this variable is to store the actual value used by the engine for the probe atlas resolution. It’s the C++ counterpart to the console variable.
This variable is used directly in the Lumen Translucency Volume Lighting system, specifically in the SetupRadianceCacheInputs function.
Its value is set by the console variable system and can be modified at runtime.
It interacts directly with the console variable r.Lumen.TranslucencyVolume.RadianceCache.ProbeAtlasResolutionInProbes, always reflecting its current value.
Developers should be aware that this variable is used to set up the RadianceCache parameters, directly affecting the probe atlas resolution in both X and Y dimensions.
Best practices include:
- Avoiding direct modification of this variable in code, instead use the console variable for changes.
- Considering the performance implications when reading or using this value in performance-critical code paths.
- Ensuring that any code depending on this value can handle potential runtime changes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:204
Scope: file
Source code excerpt:
int32 GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes = 128;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes(
TEXT("r.Lumen.TranslucencyVolume.RadianceCache.ProbeAtlasResolutionInProbes"),
GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes,
TEXT("Number of probes along one dimension of the probe atlas cache texture. This controls the memory usage of the cache. Overflow currently results in incorrect rendering."),
ECVF_RenderThreadSafe
);
float GTranslucencyVolumeRadianceCacheReprojectionRadiusScale = 10.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:202
Scope: file
Source code excerpt:
);
int32 GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes = 128;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes(
TEXT("r.Lumen.TranslucencyVolume.RadianceCache.ProbeAtlasResolutionInProbes"),
GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes,
TEXT("Number of probes along one dimension of the probe atlas cache texture. This controls the memory usage of the cache. Overflow currently results in incorrect rendering."),
ECVF_RenderThreadSafe
);
float GTranslucencyVolumeRadianceCacheReprojectionRadiusScale = 10.0f;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheProbeReprojectionRadiusScale(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:308
Scope (from outer to inner):
file
namespace LumenTranslucencyVolumeRadianceCache
function LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs
Source code excerpt:
Parameters.ClipmapDistributionBase = GLumenTranslucencyVolumeRadianceCacheClipmapDistributionBase;
Parameters.RadianceProbeClipmapResolution = GetClipmapGridResolution();
Parameters.ProbeAtlasResolutionInProbes = FIntPoint(GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes, GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes);
Parameters.NumRadianceProbeClipmaps = GetNumClipmaps(LumenTranslucencyVolume::GetEndDistanceFromCamera(View));
Parameters.RadianceProbeResolution = FMath::Max(GetProbeResolution(), LumenRadianceCache::MinRadianceProbeResolution);
Parameters.FinalProbeResolution = GetFinalProbeResolution();
Parameters.FinalRadianceAtlasMaxMip = GetNumMipmaps() - 1;
const float TraceBudgetScale = View.Family->bCurrentlyBeingEdited ? 10.0f : 1.0f;
Parameters.NumProbesToTraceBudget = GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget * TraceBudgetScale;