r.Lumen.ReSTIRGather.Upsample.KernelSize
r.Lumen.ReSTIRGather.Upsample.KernelSize
#Overview
name: r.Lumen.ReSTIRGather.Upsample.KernelSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Upsample kernel size, in reservoir texels
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ReSTIRGather.Upsample.KernelSize is to control the upsample kernel size for the Lumen ReSTIR (Reservoir Spatio-Temporal Importance Resampling) gather process in Unreal Engine 5’s rendering system. This setting is specifically used in the Lumen global illumination system, which is part of UE5’s advanced rendering capabilities.
This setting variable is primarily used in the Renderer module, specifically within the Lumen subsystem. It’s part of the ReSTIR implementation, which is an advanced technique for improving the quality and performance of global illumination.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 3.0f and can be modified at runtime using console commands or through project settings.
The associated variable GLumenReSTIRUpsampleKernelSize directly interacts with r.Lumen.ReSTIRGather.Upsample.KernelSize. They share the same value, with GLumenReSTIRUpsampleKernelSize being the C++ variable that’s used in the actual rendering code.
Developers should be aware that this variable affects the quality and performance of the Lumen global illumination system. A larger kernel size may provide better quality upsampling but at the cost of increased computational overhead.
Best practices when using this variable include:
- Balancing quality and performance by adjusting the kernel size.
- Testing different values to find the optimal setting for your specific scene and target hardware.
- Considering the interaction with other Lumen settings, as they may influence the optimal value for this parameter.
Regarding the associated variable GLumenReSTIRUpsampleKernelSize:
- Its purpose is to store the actual value used in the rendering code for the upsample kernel size.
- It’s used directly in the Lumen ReSTIR gather process, specifically in the upsample and integrate compute shader.
- The value is set by the console variable system and can be modified at runtime.
- It interacts closely with GLumenReSTIRUpsampleNumSamples, another variable used in the same process.
- Developers should be aware that modifying this variable directly in code is not recommended; instead, they should use the console variable system to ensure proper synchronization.
- Best practices include using this variable for read-only purposes in rendering code and relying on the console variable system for modifications.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:157
Scope: file
Source code excerpt:
float GLumenReSTIRUpsampleKernelSize = 3.0f;
FAutoConsoleVariableRef CVarLumenReSTIRUpsampleKernelSize(
TEXT("r.Lumen.ReSTIRGather.Upsample.KernelSize"),
GLumenReSTIRUpsampleKernelSize,
TEXT("Upsample kernel size, in reservoir texels"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReSTIRUpsampleNumSamples = 16;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReSTIRUpsampleKernelSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:155
Scope: file
Source code excerpt:
);
float GLumenReSTIRUpsampleKernelSize = 3.0f;
FAutoConsoleVariableRef CVarLumenReSTIRUpsampleKernelSize(
TEXT("r.Lumen.ReSTIRGather.Upsample.KernelSize"),
GLumenReSTIRUpsampleKernelSize,
TEXT("Upsample kernel size, in reservoir texels"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReSTIRUpsampleNumSamples = 16;
FAutoConsoleVariableRef CVarLumenReSTIRNumSamples(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:1223
Scope (from outer to inner):
file
function FSSDSignalTextures FDeferredShadingSceneRenderer::RenderLumenReSTIRGather
Source code excerpt:
PassParameters->Substrate = Substrate::BindSubstrateGlobalUniformParameters(View);
LumenReflections::SetupCompositeParameters(View, PassParameters->ReflectionsCompositeParameters);
PassParameters->UpsampleKernelSize = GLumenReSTIRUpsampleKernelSize;
PassParameters->UpsampleNumSamples = GLumenReSTIRUpsampleNumSamples;
FUpsampleAndIntegrateCS::FPermutationDomain PermutationVector;
PermutationVector.Set< FUpsampleAndIntegrateCS::FUpsampleMethod >((EReSTIRUpsampleMethod)GLumenReSTIRUpsampleMethod);
PermutationVector.Set< FUpsampleAndIntegrateCS::FBilateralFilter >(bBilateralFilter);
auto ComputeShader = View.ShaderMap->GetShader<FUpsampleAndIntegrateCS>(PermutationVector);