r.Lumen.TranslucencyVolume.TraceStepFactor
r.Lumen.TranslucencyVolume.TraceStepFactor
#Overview
name: r.Lumen.TranslucencyVolume.TraceStepFactor
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.TraceStepFactor is to control the step size factor used in ray tracing for the Lumen 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 of Unreal Engine’s rendering module. It’s referenced in the LumenTranslucencyVolumeLighting.cpp file, which suggests it’s specifically related to the translucency volume lighting calculations within Lumen.
The value of this variable is set through a console variable system. It’s initialized with a default value of 2 and can be modified at runtime using the console command “r.Lumen.TranslucencyVolume.TraceStepFactor”.
This variable interacts directly with its associated variable GTranslucencyVolumeTraceStepFactor. They share the same value, with the console variable acting as an interface for developers to modify the internal GTranslucencyVolumeTraceStepFactor variable.
Developers should be aware that this variable affects the performance and quality trade-off in translucency lighting calculations. A higher value will result in larger step sizes, potentially improving performance at the cost of accuracy, while a lower value will increase accuracy but may impact performance.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your scene and target hardware.
- Testing different values to find the optimal balance between performance and visual quality.
- Being cautious of setting extremely low values, as they may significantly impact performance.
- Considering the interaction with other Lumen settings for overall lighting quality and performance.
Regarding the associated variable GTranslucencyVolumeTraceStepFactor:
The purpose of GTranslucencyVolumeTraceStepFactor is to store the actual value used in the rendering calculations for the translucency volume trace step factor. It’s an internal variable that directly affects the ray tracing process in the Lumen translucency volume lighting system.
This variable is used within the Lumen rendering subsystem, specifically in the ComputeLumenTranslucencyGIVolume function of the FDeferredShadingSceneRenderer class.
The value of GTranslucencyVolumeTraceStepFactor is set by the console variable r.Lumen.TranslucencyVolume.TraceStepFactor, allowing for runtime adjustments.
When using this variable, developers should note that it’s clamped between 0.1 and 10.0 in the actual rendering calculations, providing a safety range for the step factor.
Best practices for GTranslucencyVolumeTraceStepFactor include:
- Avoiding direct manipulation of this variable in code, instead using the console variable for adjustments.
- Understanding that changes to this variable will directly impact the ray tracing process and, consequently, the visual results and performance of translucency lighting.
- Considering the clamping range when setting values through the console variable to ensure intended effects are achieved.
#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:116
Scope: file
Source code excerpt:
float GTranslucencyVolumeTraceStepFactor = 2;
FAutoConsoleVariableRef CVarTranslucencyVolumeTraceStepFactor(
TEXT("r.Lumen.TranslucencyVolume.TraceStepFactor"),
GTranslucencyVolumeTraceStepFactor,
TEXT("."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GTranslucencyVolumeTracingOctahedronResolution = 3;
#Associated Variable and Callsites
This variable is associated with another variable named GTranslucencyVolumeTraceStepFactor
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:114
Scope: file
Source code excerpt:
);
float GTranslucencyVolumeTraceStepFactor = 2;
FAutoConsoleVariableRef CVarTranslucencyVolumeTraceStepFactor(
TEXT("r.Lumen.TranslucencyVolume.TraceStepFactor"),
GTranslucencyVolumeTraceStepFactor,
TEXT("."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GTranslucencyVolumeTracingOctahedronResolution = 3;
FAutoConsoleVariableRef CVarTranslucencyVolumeTracingOctahedronResolution(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:770
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::ComputeLumenTranslucencyGIVolume
Source code excerpt:
FLumenTranslucencyLightingVolumeTraceSetupParameters TraceSetupParameters;
{
TraceSetupParameters.StepFactor = FMath::Clamp(GTranslucencyVolumeTraceStepFactor, .1f, 10.0f);
TraceSetupParameters.MaxTraceDistance = Lumen::GetMaxTraceDistance(View);
TraceSetupParameters.VoxelTraceStartDistanceScale = GTranslucencyVolumeVoxelTraceStartDistanceScale;
TraceSetupParameters.MaxRayIntensity = GTranslucencyVolumeMaxRayIntensity;
}
const FIntVector OctahedralAtlasSize(