r.Lumen.ScreenProbeGather.FixedJitterIndex
r.Lumen.ScreenProbeGather.FixedJitterIndex
#Overview
name: r.Lumen.ScreenProbeGather.FixedJitterIndex
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If zero or greater, overrides the temporal jitter index with a fixed index. Useful for debugging and inspecting sampling patterns.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.FixedJitterIndex is to override the temporal jitter index with a fixed index for Lumen’s screen probe gathering process. This setting is primarily used for debugging and inspecting sampling patterns in the Lumen global illumination system.
This setting variable is part of Unreal Engine’s Lumen global illumination system, which is a component of the rendering subsystem. Specifically, it’s used in the screen probe gathering process of Lumen.
The value of this variable is set through the console variable system (CVarLumenScreenProbeUseJitter). It’s associated with the C++ variable GLumenScreenProbeFixedJitterIndex, which is initialized to -1 by default.
The variable interacts directly with the ScreenProbeParameters struct in the RenderLumenScreenProbeGather function. When set to a value of 0 or greater, it overrides the temporal jitter index used in the screen probe gathering process.
Developers must be aware that this variable is primarily intended for debugging purposes. Using a fixed jitter index in production builds could potentially reduce the quality of the global illumination by eliminating the benefits of temporal jittering.
Best practices for using this variable include:
- Use it only for debugging and inspecting sampling patterns.
- Reset it to -1 (or remove it altogether) for production builds to ensure optimal global illumination quality.
- When using it for debugging, try different fixed indices to understand how they affect the sampling pattern and resulting illumination.
Regarding the associated variable GLumenScreenProbeFixedJitterIndex:
The purpose of GLumenScreenProbeFixedJitterIndex is to store the value set by r.Lumen.ScreenProbeGather.FixedJitterIndex in the engine’s C++ code.
This variable is used within the Lumen screen probe gather system, which is part of Unreal Engine’s rendering subsystem.
The value of this variable is set by the console variable system when r.Lumen.ScreenProbeGather.FixedJitterIndex is modified.
It directly interacts with the ScreenProbeParameters struct in the RenderLumenScreenProbeGather function, where it’s assigned to ScreenProbeParameters.FixedJitterIndex.
Developers should be aware that modifying this variable directly in C++ code is not recommended, as it’s intended to be controlled via the console variable system.
Best practices for this variable include:
- Avoid modifying it directly in C++ code.
- Use the console variable r.Lumen.ScreenProbeGather.FixedJitterIndex to control its value.
- Remember that non-negative values will override the temporal jittering, which should typically only be done for debugging purposes.
#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:272
Scope: file
Source code excerpt:
int32 GLumenScreenProbeFixedJitterIndex = -1;
FAutoConsoleVariableRef CVarLumenScreenProbeUseJitter(
TEXT("r.Lumen.ScreenProbeGather.FixedJitterIndex"),
GLumenScreenProbeFixedJitterIndex,
TEXT("If zero or greater, overrides the temporal jitter index with a fixed index. Useful for debugging and inspecting sampling patterns."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenRadianceCache = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeFixedJitterIndex
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:270
Scope: file
Source code excerpt:
);
int32 GLumenScreenProbeFixedJitterIndex = -1;
FAutoConsoleVariableRef CVarLumenScreenProbeUseJitter(
TEXT("r.Lumen.ScreenProbeGather.FixedJitterIndex"),
GLumenScreenProbeFixedJitterIndex,
TEXT("If zero or greater, overrides the temporal jitter index with a fixed index. Useful for debugging and inspecting sampling patterns."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenRadianceCache = 1;
FAutoConsoleVariableRef CVarRadianceCache(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1882
Scope (from outer to inner):
file
function FSSDSignalTextures FDeferredShadingSceneRenderer::RenderLumenScreenProbeGather
Source code excerpt:
ScreenProbeParameters.MaxNumAdaptiveProbes = FMath::TruncToInt(ScreenProbeParameters.NumUniformScreenProbes * GLumenScreenProbeGatherAdaptiveProbeAllocationFraction);
ScreenProbeParameters.FixedJitterIndex = GLumenScreenProbeFixedJitterIndex;
{
FVector2f InvAtlasWithBorderBufferSize = FVector2f(1.0f) / (FVector2f(ScreenProbeParameters.ScreenProbeGatherOctahedronResolutionWithBorder) * FVector2f(ScreenProbeParameters.ScreenProbeAtlasBufferSize));
ScreenProbeParameters.SampleRadianceProbeUVMul = FVector2f(ScreenProbeParameters.ScreenProbeGatherOctahedronResolution) * InvAtlasWithBorderBufferSize;
ScreenProbeParameters.SampleRadianceProbeUVAdd = FMath::Exp2(ScreenProbeParameters.ScreenProbeGatherMaxMip) * InvAtlasWithBorderBufferSize;
ScreenProbeParameters.SampleRadianceAtlasUVMul = FVector2f(ScreenProbeParameters.ScreenProbeGatherOctahedronResolutionWithBorder) * InvAtlasWithBorderBufferSize;