r.Lumen.IrradianceFieldGather.ClipmapDistributionBase

r.Lumen.IrradianceFieldGather.ClipmapDistributionBase

#Overview

name: r.Lumen.IrradianceFieldGather.ClipmapDistributionBase

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.IrradianceFieldGather.ClipmapDistributionBase is to control the size distribution of successive clipmaps in the Lumen Irradiance Field Gather system. It serves as the base value for a power function that determines how the size of each clipmap relates to the first one.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering system. Specifically, it’s utilized in the Irradiance Field Gather component of Lumen, which is responsible for 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 2.0f.

The variable interacts directly with GLumenIrradianceFieldClipmapDistributionBase, which is the C++ variable that stores the actual value. They share the same value, with the console variable serving as an interface for runtime modification.

Developers should be aware that changing this value will affect the distribution of clipmap sizes in the Lumen Irradiance Field. A higher value will result in a more aggressive scaling of clipmap sizes, potentially improving performance at the cost of precision in distant areas.

Best practices for using this variable include:

  1. Carefully balancing performance and visual quality when adjusting the value.
  2. Testing changes across various scenes to ensure consistent results.
  3. Considering the impact on memory usage, as changing clipmap distribution may affect the overall memory footprint of the Irradiance Field system.

Regarding the associated variable GLumenIrradianceFieldClipmapDistributionBase:

The purpose of GLumenIrradianceFieldClipmapDistributionBase is to store the actual value used by the rendering code for clipmap size distribution calculations in the Lumen Irradiance Field system.

This variable is used directly in the Lumen subsystem, specifically in the LumenIrradianceFieldGather namespace within the Renderer module.

The value of this variable is set by the console variable system when r.Lumen.IrradianceFieldGather.ClipmapDistributionBase is modified.

It interacts with other Lumen Irradiance Field parameters, such as GLumenIrradianceFieldClipmapWorldExtent and GLumenIrradianceFieldGridResolution, to define the overall structure of the Irradiance Field.

Developers should be aware that this variable is used in performance-critical code paths and should be careful when directly modifying it outside of the console variable system.

Best practices include using the console variable for runtime modifications rather than directly changing this variable, and ensuring that any code that reads this value is prepared to handle potential changes during runtime.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:39

Scope: file

Source code excerpt:

float GLumenIrradianceFieldClipmapDistributionBase = 2.0f;
FAutoConsoleVariableRef CVarLumenIrradianceFieldClipmapDistributionBase(
	TEXT("r.Lumen.IrradianceFieldGather.ClipmapDistributionBase"),
	GLumenIrradianceFieldClipmapDistributionBase,
	TEXT("Base of the Pow() that controls the size of each successive clipmap relative to the first."),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldNumProbesToTraceBudget = 200;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:37

Scope: file

Source code excerpt:

);

float GLumenIrradianceFieldClipmapDistributionBase = 2.0f;
FAutoConsoleVariableRef CVarLumenIrradianceFieldClipmapDistributionBase(
	TEXT("r.Lumen.IrradianceFieldGather.ClipmapDistributionBase"),
	GLumenIrradianceFieldClipmapDistributionBase,
	TEXT("Base of the Pow() that controls the size of each successive clipmap relative to the first."),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldNumProbesToTraceBudget = 200;
FAutoConsoleVariableRef CVarLumenIrradianceFieldNumProbesToTraceBudget(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:132

Scope (from outer to inner):

file
namespace    LumenIrradianceFieldGather
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

		Parameters.ReprojectionRadiusScale = 1.5f;
		Parameters.ClipmapWorldExtent = GLumenIrradianceFieldClipmapWorldExtent;
		Parameters.ClipmapDistributionBase = GLumenIrradianceFieldClipmapDistributionBase;
		Parameters.RadianceProbeClipmapResolution = FMath::Clamp(GLumenIrradianceFieldGridResolution, 1, 256);
		Parameters.ProbeAtlasResolutionInProbes = FIntPoint(GLumenIrradianceFieldProbeAtlasResolutionInProbes, GLumenIrradianceFieldProbeAtlasResolutionInProbes);
		Parameters.NumRadianceProbeClipmaps = FMath::Clamp(GLumenIrradianceFieldNumClipmaps, 1, LumenRadianceCache::MaxClipmaps);
		Parameters.RadianceProbeResolution = FMath::Max(GLumenIrradianceFieldProbeResolution, LumenRadianceCache::MinRadianceProbeResolution);
		Parameters.FinalProbeResolution = GLumenIrradianceFieldProbeResolution + 2 * (1 << (GLumenIrradianceFieldNumMipmaps - 1));
		Parameters.FinalRadianceAtlasMaxMip = GLumenIrradianceFieldNumMipmaps - 1;