r.TranslucencyLightingVolumeDim
r.TranslucencyLightingVolumeDim
#Overview
name: r.TranslucencyLightingVolumeDim
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Dimensions of the volume textures used for translucency lighting. Larger textures result in higher resolution but lower performance.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TranslucencyLightingVolumeDim is to control the dimensions of the volume textures used for translucency lighting in Unreal Engine 5’s rendering system. This setting variable is crucial for balancing the quality of translucent lighting effects with performance.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically within the translucent lighting subsystem. The code references are found in the TranslucentLighting.cpp file, which is part of the rendering pipeline.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 64 and can be changed at runtime or through configuration files. The associated C++ variable GTranslucencyLightingVolumeDim directly reflects the value of this setting.
The r.TranslucencyLightingVolumeDim interacts closely with its associated variable GTranslucencyLightingVolumeDim. They share the same value, with GTranslucencyLightingVolumeDim being the actual integer used in the engine’s code.
Developers must be aware that increasing this value will result in higher resolution lighting for translucent objects but at the cost of performance. Conversely, decreasing it will improve performance but reduce the quality of translucent lighting.
Best practices when using this variable include:
- Balancing quality and performance based on the target hardware.
- Testing different values to find the optimal setting for your specific game or application.
- Considering scaling this value based on different quality settings in your game.
- Being cautious when setting extremely high values, as it may significantly impact performance.
Regarding the associated variable GTranslucencyLightingVolumeDim:
The purpose of GTranslucencyLightingVolumeDim is to store and provide access to the translucency lighting volume dimensions within the C++ code of the engine.
This variable is used directly in the Renderer module, specifically in the TranslucentLighting.cpp file. It’s used to determine the size of the volume textures for translucent lighting calculations.
The value of GTranslucencyLightingVolumeDim is set by the console variable system, mirroring the value of r.TranslucencyLightingVolumeDim.
GTranslucencyLightingVolumeDim interacts with the GetTranslucencyLightingVolumeDim() function, which clamps its value between 4 and 2048 to ensure it stays within a reasonable range.
Developers should be aware that this variable is used directly in performance-critical rendering code. Changes to this value will have immediate effects on the rendering pipeline.
Best practices for using GTranslucencyLightingVolumeDim include:
- Avoiding direct modification of this variable in game code. Instead, use the console variable r.TranslucencyLightingVolumeDim to change its value.
- Being mindful of its impact on memory usage and performance when adjusting its value.
- Considering its effects on different hardware configurations when optimizing your game’s graphics settings.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:613, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
24
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:640, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
32
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:667, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
48
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:694, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
64
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:722, section: [EffectsQuality@Cine]
- INI Section:
EffectsQuality@Cine
- Raw value:
64
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/TranslucentLighting.cpp:96
Scope: file
Source code excerpt:
int32 GTranslucencyLightingVolumeDim = 64;
FAutoConsoleVariableRef CVarTranslucencyLightingVolumeDim(
TEXT("r.TranslucencyLightingVolumeDim"),
GTranslucencyLightingVolumeDim,
TEXT("Dimensions of the volume textures used for translucency lighting. Larger textures result in higher resolution but lower performance."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarTranslucencyLightingVolumeInnerDistance(
#Associated Variable and Callsites
This variable is associated with another variable named GTranslucencyLightingVolumeDim
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/TranslucentLighting.cpp:94
Scope: file
Source code excerpt:
);
int32 GTranslucencyLightingVolumeDim = 64;
FAutoConsoleVariableRef CVarTranslucencyLightingVolumeDim(
TEXT("r.TranslucencyLightingVolumeDim"),
GTranslucencyLightingVolumeDim,
TEXT("Dimensions of the volume textures used for translucency lighting. Larger textures result in higher resolution but lower performance."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarTranslucencyLightingVolumeInnerDistance(
TEXT("r.TranslucencyLightingVolumeInnerDistance"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/TranslucentLighting.cpp:117
Scope (from outer to inner):
file
function int32 GetTranslucencyLightingVolumeDim
Source code excerpt:
int32 GetTranslucencyLightingVolumeDim()
{
extern int32 GTranslucencyLightingVolumeDim;
return FMath::Clamp(GTranslucencyLightingVolumeDim, 4, 2048);
}
void FViewInfo::CalcTranslucencyLightingVolumeBounds(FBox* InOutCascadeBoundsArray, int32 NumCascades) const
{
for (int32 CascadeIndex = 0; CascadeIndex < NumCascades; CascadeIndex++)
{