r.Lumen.TranslucencyVolume.RadianceCache.GridResolution
r.Lumen.TranslucencyVolume.RadianceCache.GridResolution
#Overview
name: r.Lumen.TranslucencyVolume.RadianceCache.GridResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Resolution of the probe placement grid within each clipmap
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.TranslucencyVolume.RadianceCache.GridResolution is to control the resolution of the probe placement grid within each clipmap in Lumen’s translucency volume lighting system. This setting variable is part of Unreal Engine 5’s rendering system, specifically the Lumen global illumination feature.
This setting variable is primarily used in the Lumen subsystem, particularly in the translucency volume lighting module. Based on the callsites, it’s clear that this variable is referenced in the LumenTranslucencyVolumeLighting.cpp file, which is part of the Renderer module.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 24 and can be changed at runtime using the console command system.
This variable interacts directly with GTranslucencyVolumeRadianceCacheGridResolution, which is the associated C++ variable that stores the actual value. They share the same value, and changes to one will affect the other.
Developers must be aware that this variable affects the resolution of the probe placement grid, which can impact both performance and visual quality. A higher resolution will provide more accurate lighting but at the cost of increased memory usage and potentially lower performance.
Best practices when using this variable include:
- Balancing between quality and performance based on the specific needs of the project.
- Testing different values to find the optimal setting for your specific scene.
- Being mindful of the performance impact when increasing the resolution, especially on lower-end hardware.
Regarding the associated variable GTranslucencyVolumeRadianceCacheGridResolution:
The purpose of GTranslucencyVolumeRadianceCacheGridResolution is to store the actual value of the grid resolution for the translucency volume radiance cache. It’s the C++ representation of the console variable.
This variable is used directly in the Lumen translucency volume lighting system, specifically in the GetClipmapGridResolution() function within the LumenTranslucencyVolumeRadianceCache namespace.
The value of this variable is set when the console variable r.Lumen.TranslucencyVolume.RadianceCache.GridResolution is modified.
It interacts with the console variable system and is used in calculations to determine the final grid resolution.
Developers should be aware that this variable is clamped between 1 and 256 when used in the GetClipmapGridResolution() function, ensuring that the value stays within a reasonable range.
Best practices for using this variable include:
- Avoiding direct modification of this variable in code, instead using the console variable system to change its value.
- Being aware of the clamping when retrieving the value through GetClipmapGridResolution().
- Considering the impact on performance and memory usage when adjusting this value.
#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:188
Scope: file
Source code excerpt:
int32 GTranslucencyVolumeRadianceCacheGridResolution = 24;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheResolution(
TEXT("r.Lumen.TranslucencyVolume.RadianceCache.GridResolution"),
GTranslucencyVolumeRadianceCacheGridResolution,
TEXT("Resolution of the probe placement grid within each clipmap"),
ECVF_RenderThreadSafe
);
int32 GTranslucencyVolumeRadianceCacheProbeResolution = 8;
#Associated Variable and Callsites
This variable is associated with another variable named GTranslucencyVolumeRadianceCacheGridResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:186
Scope: file
Source code excerpt:
);
int32 GTranslucencyVolumeRadianceCacheGridResolution = 24;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheResolution(
TEXT("r.Lumen.TranslucencyVolume.RadianceCache.GridResolution"),
GTranslucencyVolumeRadianceCacheGridResolution,
TEXT("Resolution of the probe placement grid within each clipmap"),
ECVF_RenderThreadSafe
);
int32 GTranslucencyVolumeRadianceCacheProbeResolution = 8;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheProbeResolution(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:282
Scope (from outer to inner):
file
namespace LumenTranslucencyVolumeRadianceCache
function int32 GetClipmapGridResolution
Source code excerpt:
int32 GetClipmapGridResolution()
{
const int32 GridResolution = GTranslucencyVolumeRadianceCacheGridResolution;
return FMath::Clamp(GridResolution, 1, 256);
}
int32 GetProbeResolution()
{
return GTranslucencyVolumeRadianceCacheProbeResolution;