r.LumenScene.Radiosity.ProbeOcclusionStrength
r.LumenScene.Radiosity.ProbeOcclusionStrength
#Overview
name: r.LumenScene.Radiosity.ProbeOcclusionStrength
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Strength of probe occlusion. 0 = No probe occlusion, 1 = Attempt to stop all leaking, but has self-occlusion artifacts, .5 (default) = tradeoff between the extremes.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.Radiosity.ProbeOcclusionStrength is to control the strength of probe occlusion in Lumen’s radiosity calculations within Unreal Engine 5’s rendering system. This setting variable is part of the Lumen global illumination system, specifically focusing on the radiosity component.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the Lumen radiosity system. This can be seen from the file path where the variable is defined and used: “Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp”.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands. It’s initialized with a default value of 0.5f.
The associated variable that interacts with it is GRadiosityFilteringProbeOcclusionStrength. This is the actual float variable that stores the value, while r.LumenScene.Radiosity.ProbeOcclusionStrength is the console variable name used to modify it.
Developers must be aware of the following when using this variable:
- The value range is from 0 to 1, where 0 means no probe occlusion and 1 attempts to stop all leaking but may introduce self-occlusion artifacts.
- The default value of 0.5 is a trade-off between the two extremes.
- It’s marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating it can be used for scalability settings and is safe to modify from the render thread.
Best practices when using this variable include:
- Adjust the value based on the specific needs of your scene. If you’re experiencing light leaking, you might want to increase the value, but be cautious of potential self-occlusion artifacts.
- Use in conjunction with other Lumen settings for optimal global illumination results.
- Test different values to find the best balance between light leaking prevention and artifact reduction for your specific use case.
Regarding the associated variable GRadiosityFilteringProbeOcclusionStrength:
- Its purpose is to store the actual float value used in the radiosity calculations.
- It’s used directly in the rendering code to determine if probe occlusion should be applied and to what extent.
- The value is clamped between 0.0f and 1.0f when used in calculations to ensure it stays within the valid range.
- It’s used in conjunction with other conditions, such as GRadiosityFilteringProbeOcclusion and hardware ray tracing availability, to determine if probe occlusion should be applied.
When working with this variable, developers should be aware that changes to r.LumenScene.Radiosity.ProbeOcclusionStrength will directly affect GRadiosityFilteringProbeOcclusionStrength, and thus the radiosity calculations in the Lumen system.
#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:73
Scope: file
Source code excerpt:
float GRadiosityFilteringProbeOcclusionStrength = .5f;
FAutoConsoleVariableRef CVarRadiosityFilteringProbeOcclusionStrength(
TEXT("r.LumenScene.Radiosity.ProbeOcclusionStrength"),
GRadiosityFilteringProbeOcclusionStrength,
TEXT("Strength of probe occlusion. 0 = No probe occlusion, 1 = Attempt to stop all leaking, but has self-occlusion artifacts, .5 (default) = tradeoff between the extremes."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GRadiosityProbePlaneWeightingDepthScale = -100.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GRadiosityFilteringProbeOcclusionStrength
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:71
Scope: file
Source code excerpt:
);
float GRadiosityFilteringProbeOcclusionStrength = .5f;
FAutoConsoleVariableRef CVarRadiosityFilteringProbeOcclusionStrength(
TEXT("r.LumenScene.Radiosity.ProbeOcclusionStrength"),
GRadiosityFilteringProbeOcclusionStrength,
TEXT("Strength of probe occlusion. 0 = No probe occlusion, 1 = Attempt to stop all leaking, but has self-occlusion artifacts, .5 (default) = tradeoff between the extremes."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GRadiosityProbePlaneWeightingDepthScale = -100.0f;
FAutoConsoleVariableRef CVarRadiosityProbePlaneWeightingDepthScale(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:601
Scope: file
Source code excerpt:
RadiosityFrameTemporaries.bUseProbeOcclusion = GRadiosityFilteringProbeOcclusion != 0
&& GRadiosityFilteringProbeOcclusionStrength > 0.0f
// Self intersection from grazing angle traces causes noise that breaks probe occlusion
&& Lumen::UseHardwareRayTracedRadiosity(*FirstView.Family);
if (RadiosityFrameTemporaries.bUseProbeOcclusion)
{
RadiosityFrameTemporaries.TraceHitDistanceAtlas = RegisterOrCreateRadiosityAtlas(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:678
Scope: file
Source code excerpt:
RadiosityTexelTraceParameters.HemisphereProbeResolution = RadiosityFrameTemporaries.HemisphereProbeResolution;
RadiosityTexelTraceParameters.NumTracesPerProbe = RadiosityFrameTemporaries.HemisphereProbeResolution * RadiosityFrameTemporaries.HemisphereProbeResolution;
RadiosityTexelTraceParameters.ProbeOcclusionStrength = RadiosityFrameTemporaries.bUseProbeOcclusion ? FMath::Clamp<float>(GRadiosityFilteringProbeOcclusionStrength, 0.0f, 1.0f) : 0;
RadiosityTexelTraceParameters.FixedJitterIndex = GLumenRadiosityFixedJitterIndex;
RadiosityTexelTraceParameters.MaxFramesAccumulated = LumenRadiosity::UseTemporalAccumulation() ? GLumenRadiosityTemporalMaxFramesAccumulated : 1;
RadiosityTexelTraceParameters.NumViews = Views.Num();
// Needs to be set to valid value inside view loop
RadiosityTexelTraceParameters.ViewIndex = Views.Num();
RadiosityTexelTraceParameters.MaxCardTiles = MaxCardTiles;