r.LumenScene.Radiosity.ProbePlaneWeighting
r.LumenScene.Radiosity.ProbePlaneWeighting
#Overview
name: r.LumenScene.Radiosity.ProbePlaneWeighting
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to weight Radiosity probes by plane distance, useful to prevent leaking.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.Radiosity.ProbePlaneWeighting is to control whether Radiosity probes are weighted by plane distance in the Lumen global illumination system. This setting is specifically used in the Radiosity component of Lumen, which is part of Unreal Engine’s rendering system.
This setting variable is primarily used in the Lumen Radiosity subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s evident that this variable affects the behavior of spatial filtering and integration of probe radiance in the Lumen Radiosity system.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 1 (enabled) and can be changed at runtime using console commands or through project settings.
The associated variable GRadiosityFilteringProbePlaneWeighting directly interacts with r.LumenScene.Radiosity.ProbePlaneWeighting. They share the same value, with GRadiosityFilteringProbePlaneWeighting being the internal representation used in the C++ code.
Developers should be aware that this variable affects the quality and performance of the Lumen Radiosity system. When enabled (set to 1), it helps prevent light leaking by considering the distance to planes when weighting Radiosity probes. This can lead to more accurate global illumination results, especially in scenes with complex geometry.
Best practices when using this variable include:
- Keep it enabled (default value of 1) for most scenarios to prevent light leaking.
- If performance is a concern and light leaking is not noticeable in your specific scene, you may consider disabling it.
- Test your scenes with this setting both enabled and disabled to find the best balance between visual quality and performance.
- Be aware that changing this setting may require adjustments to other Lumen Radiosity parameters to maintain the desired visual result.
Regarding the associated variable GRadiosityFilteringProbePlaneWeighting:
The purpose of GRadiosityFilteringProbePlaneWeighting is to serve as the internal C++ representation of the r.LumenScene.Radiosity.ProbePlaneWeighting console variable. It directly controls the behavior of the probe plane weighting in the Lumen Radiosity system.
This variable is used in the Lumen Radiosity subsystem of the rendering module. It’s specifically used in the spatial filtering and integration stages of the Radiosity computation.
The value of GRadiosityFilteringProbePlaneWeighting is set by the console variable system when r.LumenScene.Radiosity.ProbePlaneWeighting is modified.
GRadiosityFilteringProbePlaneWeighting interacts directly with shader permutations in the Lumen Radiosity system. It’s used to determine whether to enable plane weighting in the spatial filtering and integration compute shaders.
Developers should be aware that modifying GRadiosityFilteringProbePlaneWeighting directly in C++ code is not recommended. Instead, they should use the r.LumenScene.Radiosity.ProbePlaneWeighting console variable to control this behavior.
Best practices for using GRadiosityFilteringProbePlaneWeighting include:
- Avoid modifying it directly in C++ code.
- Use it as a condition for shader permutations as demonstrated in the provided code snippets.
- When debugging or profiling Lumen Radiosity, be aware of its impact on shader compilation and runtime performance.
#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:57
Scope: file
Source code excerpt:
int32 GRadiosityFilteringProbePlaneWeighting = 1;
FAutoConsoleVariableRef CVarRadiosityFilteringProbePlaneWeighting(
TEXT("r.LumenScene.Radiosity.ProbePlaneWeighting"),
GRadiosityFilteringProbePlaneWeighting,
TEXT("Whether to weight Radiosity probes by plane distance, useful to prevent leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GRadiosityFilteringProbeOcclusion = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GRadiosityFilteringProbePlaneWeighting
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:55
Scope: file
Source code excerpt:
);
int32 GRadiosityFilteringProbePlaneWeighting = 1;
FAutoConsoleVariableRef CVarRadiosityFilteringProbePlaneWeighting(
TEXT("r.LumenScene.Radiosity.ProbePlaneWeighting"),
GRadiosityFilteringProbePlaneWeighting,
TEXT("Whether to weight Radiosity probes by plane distance, useful to prevent leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GRadiosityFilteringProbeOcclusion = 1;
FAutoConsoleVariableRef CVarRadiosityFilteringProbeOcclusion(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:893
Scope: file
Source code excerpt:
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);
FComputeShaderUtils::AddPass(
GraphBuilder,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:964
Scope: file
Source code excerpt:
FLumenRadiosityIntegrateCS::FPermutationDomain PermutationVector;
PermutationVector.Set<FLumenRadiosityIntegrateCS::FPlaneWeighting>(GRadiosityFilteringProbePlaneWeighting != 0);
PermutationVector.Set<FLumenRadiosityIntegrateCS::FProbeOcclusion>(RadiosityFrameTemporaries.bUseProbeOcclusion);
PermutationVector.Set<FLumenRadiosityIntegrateCS::FTemporalAccumulation>(LumenRadiosity::UseTemporalAccumulation());
auto ComputeShader = GlobalShaderMap->GetShader<FLumenRadiosityIntegrateCS>(PermutationVector);
FComputeShaderUtils::AddPass(
GraphBuilder,