r.Lumen.RadianceCache.SupersampleTileBRDFThreshold

r.Lumen.RadianceCache.SupersampleTileBRDFThreshold

#Overview

name: r.Lumen.RadianceCache.SupersampleTileBRDFThreshold

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.RadianceCache.SupersampleTileBRDFThreshold is to control the threshold value for supersampling in Lumen’s Radiance Cache system. This setting is part of Unreal Engine 5’s global illumination solution, Lumen, specifically for its Radiance Cache component.

This setting variable is primarily used in the Lumen subsystem, which is part of Unreal Engine 5’s rendering system. It’s referenced in the LumenRadianceCache.cpp file, indicating its relevance to the Radiance Cache functionality within Lumen.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands. Its default value is 0.1f, representing a BRDF (Bidirectional Reflectance Distribution Function) threshold between 0 and 1.

The variable interacts directly with GLumenRadianceCacheSupersampleTileBRDFThreshold, which is the C++ variable that stores the actual value. They share the same value, with the console variable acting as an interface for adjusting the C++ variable.

Developers must be aware that this variable affects the quality and performance of Lumen’s global illumination. A lower threshold will result in more supersampling, potentially improving quality but at the cost of performance. Conversely, a higher threshold will reduce supersampling, potentially improving performance but potentially at the cost of quality.

Best practices when using this variable include:

  1. Balancing quality and performance based on the specific needs of the project.
  2. Testing different values to find the optimal balance for your scene.
  3. Considering the target hardware when setting this value, as higher-end systems may be able to handle lower thresholds (more supersampling) better.

Regarding the associated variable GLumenRadianceCacheSupersampleTileBRDFThreshold:

The purpose of GLumenRadianceCacheSupersampleTileBRDFThreshold is to store the actual value used by the Lumen system for the supersampling threshold. It’s the C++ representation of the console variable r.Lumen.RadianceCache.SupersampleTileBRDFThreshold.

This variable is used directly in the Lumen Radiance Cache update process, specifically in the UpdateRadianceCaches function. It’s used to set the SupersampleTileBRDFThreshold parameter for the radiance cache update pass.

The value of this variable is set by the console variable r.Lumen.RadianceCache.SupersampleTileBRDFThreshold, allowing for runtime adjustments.

Developers should be aware that changes to this variable will directly affect the Lumen Radiance Cache update process. It determines when additional rays should be traced to supersample the probe radiance based on the BRDF value.

Best practices for this variable are similar to those for the console variable, focusing on finding the right balance between quality and performance 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/LumenRadianceCache.cpp:84

Scope: file

Source code excerpt:

float GLumenRadianceCacheSupersampleTileBRDFThreshold = .1f;
FAutoConsoleVariableRef CVarLumenRadianceCacheSupersampleTileBRDFThreshold(
	TEXT("r.Lumen.RadianceCache.SupersampleTileBRDFThreshold"),
	GLumenRadianceCacheSupersampleTileBRDFThreshold,
	TEXT("Value of the BRDF [0-1] above which to trace more rays to supersample the probe radiance."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

float GLumenRadianceCacheSupersampleDistanceFromCamera = 2000.0f;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCache.cpp:82

Scope: file

Source code excerpt:

);

float GLumenRadianceCacheSupersampleTileBRDFThreshold = .1f;
FAutoConsoleVariableRef CVarLumenRadianceCacheSupersampleTileBRDFThreshold(
	TEXT("r.Lumen.RadianceCache.SupersampleTileBRDFThreshold"),
	GLumenRadianceCacheSupersampleTileBRDFThreshold,
	TEXT("Value of the BRDF [0-1] above which to trace more rays to supersample the probe radiance."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

float GLumenRadianceCacheSupersampleDistanceFromCamera = 2000.0f;
FAutoConsoleVariableRef CVarLumenRadianceCacheSupersampleDistanceFromCamera(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCache.cpp:1879

Scope (from outer to inner):

file
namespace    LumenRadianceCache
function     void UpdateRadianceCaches

Source code excerpt:

				PassParameters->RadianceProbeSH_PDF = RadianceProbeSH_PDF[RadianceCacheIndex] ? GraphBuilder.CreateSRV(FRDGBufferSRVDesc(RadianceProbeSH_PDF[RadianceCacheIndex], PF_R32_SINT)) : nullptr;
				PassParameters->ProbesToUpdateTraceCost = GraphBuilder.CreateSRV(ProbesToUpdateTraceCost[RadianceCacheIndex]);
				PassParameters->SupersampleTileBRDFThreshold = GLumenRadianceCacheSupersampleTileBRDFThreshold;
				PassParameters->SupersampleDistanceFromCameraSq = GLumenRadianceCacheSupersampleDistanceFromCamera * GLumenRadianceCacheSupersampleDistanceFromCamera;
				PassParameters->DownsampleDistanceFromCameraSq = GLumenRadianceCacheDownsampleDistanceFromCamera * GLumenRadianceCacheDownsampleDistanceFromCamera;
				PassParameters->ForcedUniformLevel = GLumenRadianceCacheForceUniformTraceTileLevel >= 0 ? FMath::Clamp<int32>(GLumenRadianceCacheForceUniformTraceTileLevel, 0, 2) : 1;

				PassParameters->RWDebugBRDFProbabilityDensityFunction = GraphBuilder.CreateUAV(FRDGTextureUAVDesc(DebugBRDFProbabilityDensityFunction));
				PassParameters->DebugProbeBRDFOctahedronResolution = DebugProbeBRDFOctahedronResolution;