r.Lumen.ScreenProbeGather.SpatialFilterNumPasses

r.Lumen.ScreenProbeGather.SpatialFilterNumPasses

#Overview

name: r.Lumen.ScreenProbeGather.SpatialFilterNumPasses

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Lumen.ScreenProbeGather.SpatialFilterNumPasses is to control the number of spatial filter passes applied in the Lumen screen probe gathering process. This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically related to the screen probe filtering mechanism.

This setting variable is primarily used by the Lumen subsystem within the Renderer module of Unreal Engine 5. Based on the callsites, it’s clear that this variable is utilized in the screen probe filtering process, which is a part of the Lumen global illumination pipeline.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.

The associated variable GLumenScreenProbeSpatialFilterNumPasses directly interacts with r.Lumen.ScreenProbeGather.SpatialFilterNumPasses. They share the same value, with GLumenScreenProbeSpatialFilterNumPasses being the actual integer variable used in the C++ code.

Developers must be aware that this variable affects the quality and performance of the Lumen global illumination system. Increasing the number of spatial filter passes can potentially improve the quality of the lighting, but at the cost of increased computational overhead.

Best practices when using this variable include:

  1. Balancing quality and performance based on the target hardware.
  2. Testing different values to find the optimal setting for your specific scene.
  3. Considering this setting in conjunction with other Lumen settings for best results.

Regarding the associated variable GLumenScreenProbeSpatialFilterNumPasses:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:16

Scope: file

Source code excerpt:

int32 GLumenScreenProbeSpatialFilterNumPasses = 3;
FAutoConsoleVariableRef GVarLumenScreenProbeSpatialFilterNumPasses(
	TEXT("r.Lumen.ScreenProbeGather.SpatialFilterNumPasses"),
	GLumenScreenProbeSpatialFilterNumPasses,
	TEXT("Number of spatial filter passes"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeSpatialFilterHalfKernelSize = 1;

#Associated Variable and Callsites

This variable is associated with another variable named GLumenScreenProbeSpatialFilterNumPasses. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:14

Scope: file

Source code excerpt:

#include "DistanceFieldAmbientOcclusion.h"

int32 GLumenScreenProbeSpatialFilterNumPasses = 3;
FAutoConsoleVariableRef GVarLumenScreenProbeSpatialFilterNumPasses(
	TEXT("r.Lumen.ScreenProbeGather.SpatialFilterNumPasses"),
	GLumenScreenProbeSpatialFilterNumPasses,
	TEXT("Number of spatial filter passes"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeSpatialFilterHalfKernelSize = 1;
FAutoConsoleVariableRef GVarLumenScreenProbeSpatialFilterHalfKernelSize(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:551

Scope (from outer to inner):

file
function     void FilterScreenProbes

Source code excerpt:

	if (LumenScreenProbeGather::UseProbeSpatialFilter() && GLumenScreenProbeSpatialFilterHalfKernelSize > 0)
	{
		for (int32 PassIndex = 0; PassIndex < GLumenScreenProbeSpatialFilterNumPasses; PassIndex++)
		{
			FRDGTextureRef FilteredScreenProbeRadiance = GraphBuilder.CreateTexture(ScreenProbeRadianceDesc, TEXT("Lumen.ScreenProbeGather.ScreenProbeFilteredRadiance"));

			FScreenProbeFilterGatherTracesCS::FParameters* PassParameters = GraphBuilder.AllocParameters<FScreenProbeFilterGatherTracesCS::FParameters>();
			PassParameters->RWScreenProbeRadiance = GraphBuilder.CreateUAV(FRDGTextureUAVDesc(FilteredScreenProbeRadiance));
			PassParameters->ScreenProbeRadiance = ScreenProbeRadiance;