r.Lumen.TranslucencyVolume.GridDistributionLogZScale
r.Lumen.TranslucencyVolume.GridDistributionLogZScale
#Overview
name: r.Lumen.TranslucencyVolume.GridDistributionLogZScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.TranslucencyVolume.GridDistributionLogZScale is to control the logarithmic scale of the Z-axis distribution in the translucency volume grid used by Lumen, Unreal Engine 5’s global illumination system.
This setting variable is primarily used in the Lumen subsystem, specifically in the translucency volume lighting module. It’s part of the rendering system, focusing on how light interacts with translucent objects in the scene.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 0.01f and can be modified at runtime.
The variable interacts closely with GTranslucencyGridDistributionLogZScale, which is the C++ variable that directly holds the value set by the console variable. It’s also used in conjunction with GTranslucencyGridDistributionLogZOffset and GTranslucencyGridDistributionZScale to calculate the Z parameters of the translucency grid.
Developers must be aware that this variable affects the distribution of the translucency volume grid along the Z-axis. A smaller value will result in a more uniform distribution, while a larger value will concentrate more grid cells near the camera.
Best practices when using this variable include:
- Adjusting it in small increments, as it uses a logarithmic scale.
- Testing its impact on performance and visual quality across different scenes.
- Considering its interaction with other translucency volume settings.
Regarding the associated variable GTranslucencyGridDistributionLogZScale:
This is the C++ variable that directly holds the value set by r.Lumen.TranslucencyVolume.GridDistributionLogZScale. It’s used in the GetTranslucencyGridZParams function to calculate the Z parameters of the translucency grid.
The value of GTranslucencyGridDistributionLogZScale is set through the console variable system and can be accessed and modified from C++ code.
Developers should be aware that modifying GTranslucencyGridDistributionLogZScale directly in C++ code might lead to inconsistencies with the console variable. It’s generally better to modify the console variable instead.
Best practices for GTranslucencyGridDistributionLogZScale include:
- Accessing it through the console variable system when possible.
- Being cautious about modifying it directly in C++ code.
- Considering its impact on the entire translucency lighting system when making 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:44
Scope: file
Source code excerpt:
float GTranslucencyGridDistributionLogZScale = .01f;
FAutoConsoleVariableRef CVarTranslucencyGridDistributionLogZScale(
TEXT("r.Lumen.TranslucencyVolume.GridDistributionLogZScale"),
GTranslucencyGridDistributionLogZScale,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GTranslucencyGridDistributionLogZOffset = 1.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GTranslucencyGridDistributionLogZScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:42
Scope: file
Source code excerpt:
);
float GTranslucencyGridDistributionLogZScale = .01f;
FAutoConsoleVariableRef CVarTranslucencyGridDistributionLogZScale(
TEXT("r.Lumen.TranslucencyVolume.GridDistributionLogZScale"),
GTranslucencyGridDistributionLogZScale,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GTranslucencyGridDistributionLogZOffset = 1.0f;
FAutoConsoleVariableRef CVarTranslucencyGridDistributionLogZOffset(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:392
Scope (from outer to inner):
file
function void GetTranslucencyGridZParams
Source code excerpt:
void GetTranslucencyGridZParams(float NearPlane, float FarPlane, FVector& OutZParams, int32& OutGridSizeZ)
{
OutGridSizeZ = FMath::TruncToInt(FMath::Log2((FarPlane - NearPlane) * GTranslucencyGridDistributionLogZScale) * GTranslucencyGridDistributionZScale) + 1;
OutZParams = FVector(GTranslucencyGridDistributionLogZScale, GTranslucencyGridDistributionLogZOffset, GTranslucencyGridDistributionZScale);
}
FVector TranslucencyVolumeTemporalRandom(uint32 FrameNumber)
{
// Center of the voxel
FVector RandomOffsetValue(.5f, .5f, .5f);