r.Lumen.TranslucencyReflections.ClipmapFadeSize
r.Lumen.TranslucencyReflections.ClipmapFadeSize
#Overview
name: r.Lumen.TranslucencyReflections.ClipmapFadeSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Size in Radiance Cache probes of the dithered transition region between clipmaps
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.TranslucencyReflections.ClipmapFadeSize is to control the size of the dithered transition region between clipmaps in the Lumen Translucency Reflections system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically focusing on the handling of translucent materials in reflections.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine 5’s rendering module. It’s specifically utilized in the Translucency Reflections component of Lumen, which is responsible for rendering realistic reflections on translucent surfaces.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 4.0f and can be modified at runtime using the console command “r.Lumen.TranslucencyReflections.ClipmapFadeSize”.
The associated variable GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize directly interacts with this console variable. They share the same value, with GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize being the actual float variable used in the C++ code.
Developers should be aware that this variable affects the visual quality and performance of translucent reflections in Lumen. A larger value will create a smoother transition between clipmaps but may impact performance, while a smaller value might improve performance at the cost of potential visual artifacts.
Best practices when using this variable include:
- Experimenting with different values to find the right balance between visual quality and performance for your specific scene.
- Being cautious when modifying this value, as extreme values (very small or very large) might lead to undesired visual results or performance issues.
- Consider the complexity of your scene and the importance of translucent reflections when adjusting this value.
Regarding the associated variable GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize:
The purpose of GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize is to store and provide access to the clipmap fade size value within the C++ code of the Lumen system.
This variable is used in the Lumen Translucency Reflections system, specifically in the radiance cache calculations for translucent volumes.
The value of this variable is set by the console variable r.Lumen.TranslucencyReflections.ClipmapFadeSize.
It interacts directly with the console variable and is used in calculations for the radiance cache interpolation parameters.
Developers should be aware that this variable is used in performance-critical rendering code and its value is clamped between 0.001 and 16.0 when used in calculations to prevent potential division by zero or other numerical issues.
Best practices for this variable include:
- Avoid directly modifying this variable in code; instead, use the console variable to change its value.
- Be aware of its impact on radiance cache calculations when profiling or optimizing Lumen Translucency Reflections.
- Consider its relationship with other Lumen settings when fine-tuning the rendering pipeline.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyRadianceCache.cpp:40
Scope: file
Source code excerpt:
float GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize = 4.0f;
FAutoConsoleVariableRef CVarLumenTranslucencyVolumeRadianceCacheClipmapFadeSize(
TEXT("r.Lumen.TranslucencyReflections.ClipmapFadeSize"),
GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize,
TEXT("Size in Radiance Cache probes of the dithered transition region between clipmaps"),
ECVF_RenderThreadSafe
);
namespace Lumen
#Associated Variable and Callsites
This variable is associated with another variable named GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:2143
Scope (from outer to inner):
file
function FSSDSignalTextures FDeferredShadingSceneRenderer::RenderLumenScreenProbeGather
Source code excerpt:
extern float GLumenTranslucencyReflectionsRadianceCacheReprojectionRadiusScale;
extern float GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize;
View.GetOwnLumenTranslucencyGIVolume().RadianceCacheInterpolationParameters.RadianceCacheInputs.ReprojectionRadiusScale = GLumenTranslucencyReflectionsRadianceCacheReprojectionRadiusScale;
View.GetOwnLumenTranslucencyGIVolume().RadianceCacheInterpolationParameters.RadianceCacheInputs.InvClipmapFadeSize = 1.0f / FMath::Clamp(GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize, .001f, 16.0f);
}
}
else
{
RadianceCacheParameters = View.GetLumenTranslucencyGIVolume().RadianceCacheInterpolationParameters;
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyRadianceCache.cpp:38
Scope: file
Source code excerpt:
);
float GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize = 4.0f;
FAutoConsoleVariableRef CVarLumenTranslucencyVolumeRadianceCacheClipmapFadeSize(
TEXT("r.Lumen.TranslucencyReflections.ClipmapFadeSize"),
GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize,
TEXT("Size in Radiance Cache probes of the dithered transition region between clipmaps"),
ECVF_RenderThreadSafe
);
namespace Lumen
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyRadianceCache.cpp:362
Scope: file
Source code excerpt:
SetupSceneTextureUniformParameters(GraphBuilder, &SceneTextures, View.FeatureLevel, ESceneTextureSetupMode::All, MarkPassParameters.SceneTextures);
MarkPassParameters.RadianceCacheMarkParameters = RadianceCacheMarkParameters;
MarkPassParameters.RadianceCacheMarkParameters.InvClipmapFadeSizeForMark = 1.0f / FMath::Clamp(GLumenTranslucencyVolumeRadianceCacheClipmapFadeSize, .001f, 16.0f);
MarkPassParameters.FurthestHZBTexture = View.HZB;
MarkPassParameters.ViewportUVToHZBBufferUV = FVector2f(
float(View.ViewRect.Width()) / float(2 * View.HZBMipmap0Size.X),
float(View.ViewRect.Height()) / float(2 * View.HZBMipmap0Size.Y));
MarkPassParameters.HZBMipLevel = FMath::Max<float>((int32)FMath::FloorLog2((float)GLumenTranslucencyReflectionsMarkDownsampleFactor) - 1, 0.0f);