r.LumenScene.Radiosity.SpatialFilterProbes.PlaneWeightingDepthScale
r.LumenScene.Radiosity.SpatialFilterProbes.PlaneWeightingDepthScale
#Overview
name: r.LumenScene.Radiosity.SpatialFilterProbes.PlaneWeightingDepthScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Controls the distance at which probes can be interpolated from. Higher values introduce leaking.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.Radiosity.SpatialFilterProbes.PlaneWeightingDepthScale is to control the distance at which probes can be interpolated from in the Lumen radiosity 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 radiosity subsystem, which is part of the Renderer module in Unreal Engine 5. It affects the spatial filtering of radiosity probes, which are used to calculate global illumination.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of -100.0f and can be modified at runtime.
The associated variable GRadiosityProbePlaneWeightingDepthScale directly interacts with this console variable. They share the same value, and GRadiosityProbePlaneWeightingDepthScale is used in the actual rendering code to apply the setting.
Developers must be aware that this variable affects the quality and performance of the Lumen radiosity system. Higher values can introduce light leaking, which may result in unrealistic lighting in some scenarios. On the other hand, lower values might reduce light bleeding but could also limit the interpolation distance, potentially affecting the smoothness of the global illumination.
Best practices when using this variable include:
- Carefully adjusting the value to find a balance between lighting quality and performance.
- Testing the changes in various lighting scenarios to ensure desired results across different environments.
- Being mindful of the potential impact on performance, especially on lower-end hardware.
- Considering the interaction with other Lumen settings for optimal results.
Regarding the associated variable GRadiosityProbePlaneWeightingDepthScale:
The purpose of GRadiosityProbePlaneWeightingDepthScale is to directly apply the console variable setting in the rendering code. It’s used in the Lumen radiosity calculations to determine how far probes can be interpolated.
This variable is used in the Renderer module, specifically in the Lumen radiosity subsystem. It’s referenced in functions related to spatial filtering of probe radiance and radiosity integration.
The value of GRadiosityProbePlaneWeightingDepthScale is set by the console variable system, mirroring the value of r.LumenScene.Radiosity.SpatialFilterProbes.PlaneWeightingDepthScale.
It interacts closely with other radiosity-related variables and is used in shader permutations, affecting how the radiosity calculations are performed.
Developers should be aware that changes to this variable will directly impact the Lumen radiosity calculations. It’s used in performance-critical code, so modifications should be made carefully and with performance considerations in mind.
Best practices include profiling the impact of changes to this variable on both visual quality and performance, and considering its effects in conjunction with other Lumen radiosity settings for optimal results.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:81
Scope: file
Source code excerpt:
float GRadiosityProbePlaneWeightingDepthScale = -100.0f;
FAutoConsoleVariableRef CVarRadiosityProbePlaneWeightingDepthScale(
TEXT("r.LumenScene.Radiosity.SpatialFilterProbes.PlaneWeightingDepthScale"),
GRadiosityProbePlaneWeightingDepthScale,
TEXT("Controls the distance at which probes can be interpolated from. Higher values introduce leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenRadiosityMaxRayIntensity = 40.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GRadiosityProbePlaneWeightingDepthScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:79
Scope: file
Source code excerpt:
);
float GRadiosityProbePlaneWeightingDepthScale = -100.0f;
FAutoConsoleVariableRef CVarRadiosityProbePlaneWeightingDepthScale(
TEXT("r.LumenScene.Radiosity.SpatialFilterProbes.PlaneWeightingDepthScale"),
GRadiosityProbePlaneWeightingDepthScale,
TEXT("Controls the distance at which probes can be interpolated from. Higher values introduce leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenRadiosityMaxRayIntensity = 40.0f;
FAutoConsoleVariableRef CVarLumenRadiosityMaxRayIntensity(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:890
Scope: file
Source code excerpt:
PassParameters->RadiosityTexelTraceParameters = RadiosityTexelTraceParameters;
PassParameters->RadiosityTexelTraceParameters.ViewIndex = ViewIndex;
PassParameters->ProbePlaneWeightingDepthScale = GRadiosityProbePlaneWeightingDepthScale;
FLumenRadiositySpatialFilterProbeRadiance::FPermutationDomain PermutationVector;
PermutationVector.Set<FLumenRadiositySpatialFilterProbeRadiance::FPlaneWeighting>(GRadiosityFilteringProbePlaneWeighting != 0);
PermutationVector.Set<FLumenRadiositySpatialFilterProbeRadiance::FProbeOcclusion>(RadiosityFrameTemporaries.bUseProbeOcclusion);
PermutationVector.Set<FLumenRadiositySpatialFilterProbeRadiance::FKernelSize>(FMath::Clamp<int32>(GLumenRadiositySpatialFilterProbesKernelSize, 0, 2));
auto ComputeShader = GlobalShaderMap->GetShader<FLumenRadiositySpatialFilterProbeRadiance>(PermutationVector);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:960
Scope: file
Source code excerpt:
PassParameters->RadiosityProbeSHGreenAtlas = RadiosityFrameTemporaries.ProbeSHGreenAtlas;
PassParameters->RadiosityProbeSHBlueAtlas = RadiosityFrameTemporaries.ProbeSHBlueAtlas;
PassParameters->ProbePlaneWeightingDepthScale = GRadiosityProbePlaneWeightingDepthScale;
PassParameters->Substrate = Substrate::BindSubstrateGlobalUniformParameters(View);
FLumenRadiosityIntegrateCS::FPermutationDomain PermutationVector;
PermutationVector.Set<FLumenRadiosityIntegrateCS::FPlaneWeighting>(GRadiosityFilteringProbePlaneWeighting != 0);
PermutationVector.Set<FLumenRadiosityIntegrateCS::FProbeOcclusion>(RadiosityFrameTemporaries.bUseProbeOcclusion);
PermutationVector.Set<FLumenRadiosityIntegrateCS::FTemporalAccumulation>(LumenRadiosity::UseTemporalAccumulation());