r.Lumen.ScreenProbeGather.GatherOctahedronResolutionScale
r.Lumen.ScreenProbeGather.GatherOctahedronResolutionScale
#Overview
name: r.Lumen.ScreenProbeGather.GatherOctahedronResolutionScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Resolution that probe filtering and integration will happen at, as a scale of TracingOctahedronResolution
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.GatherOctahedronResolutionScale is to control the resolution at which probe filtering and integration occur in the Lumen global illumination system. This setting variable is part of the rendering system, specifically the Lumen real-time global illumination feature in Unreal Engine 5.
This setting variable is primarily used in the Lumen Screen Probe Gather subsystem, which is part of the Renderer module. It directly affects the resolution of octahedral probes used in the global illumination calculations.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as a float with a default value of 1.0f, and it can be modified at runtime.
The associated variable GLumenScreenProbeGatherOctahedronResolutionScale interacts directly with this console variable. They share the same value, with GLumenScreenProbeGatherOctahedronResolutionScale being the C++ variable that’s actually used in the rendering code.
Developers must be aware that this variable affects the trade-off between quality and performance. Higher values will increase the resolution of the probes, potentially improving image quality but at the cost of performance. Lower values will decrease resolution, improving performance but potentially reducing quality.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project and target hardware.
- Testing different values to find the optimal balance between quality and performance.
- Consider exposing it as a scalability setting for end-users with different hardware capabilities.
Regarding the associated variable GLumenScreenProbeGatherOctahedronResolutionScale:
This C++ variable is used directly in the rendering code to determine the resolution of the octahedral probes. It’s used in the GetGatherOctahedronResolution function to calculate the final resolution. If the value is greater than or equal to 1.0, it’s used as a multiplier for the base resolution. If it’s less than 1.0, it’s used to calculate a divisor for the base resolution.
Developers should be aware that this variable directly impacts the rendering pipeline, and changes to it will affect both the visual quality and performance of the Lumen global illumination system. It’s important to profile and test thoroughly when adjusting this value to ensure it meets both quality and performance requirements for your specific use case.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:68
Scope: file
Source code excerpt:
float GLumenScreenProbeGatherOctahedronResolutionScale = 1.0f;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherOctahedronResolutionScale(
TEXT("r.Lumen.ScreenProbeGather.GatherOctahedronResolutionScale"),
GLumenScreenProbeGatherOctahedronResolutionScale,
TEXT("Resolution that probe filtering and integration will happen at, as a scale of TracingOctahedronResolution"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeDownsampleFactor = 16;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeGatherOctahedronResolutionScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:66
Scope: file
Source code excerpt:
);
float GLumenScreenProbeGatherOctahedronResolutionScale = 1.0f;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherOctahedronResolutionScale(
TEXT("r.Lumen.ScreenProbeGather.GatherOctahedronResolutionScale"),
GLumenScreenProbeGatherOctahedronResolutionScale,
TEXT("Resolution that probe filtering and integration will happen at, as a scale of TracingOctahedronResolution"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeDownsampleFactor = 16;
FAutoConsoleVariableRef GVarLumenScreenProbeDownsampleFactor(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:345
Scope (from outer to inner):
file
namespace LumenScreenProbeGather
function int32 GetGatherOctahedronResolution
Source code excerpt:
}
if (GLumenScreenProbeGatherOctahedronResolutionScale >= 1.0f)
{
const int32 Multiplier = FMath::RoundToInt(GLumenScreenProbeGatherOctahedronResolutionScale);
return TracingOctahedronResolution * Multiplier;
}
else
{
const int32 Divisor = FMath::RoundToInt(1.0f / FMath::Max(GLumenScreenProbeGatherOctahedronResolutionScale, .1f));
return TracingOctahedronResolution / Divisor;
}
}
int32 GetScreenDownsampleFactor(const FViewInfo& View)
{