r.Lumen.IrradianceFieldGather.NumMipmaps
r.Lumen.IrradianceFieldGather.NumMipmaps
#Overview
name: r.Lumen.IrradianceFieldGather.NumMipmaps
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of radiance cache mipmaps.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.IrradianceFieldGather.NumMipmaps is to control the number of radiance cache mipmaps in the Lumen Irradiance Field system, which is part of Unreal Engine 5’s global illumination solution.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Specifically, it’s utilized in the Irradiance Field Gather component of Lumen, which is responsible for caching and interpolating global illumination data.
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 variable interacts directly with GLumenIrradianceFieldNumMipmaps, which is the internal C++ variable that stores the actual value. This value is used in calculations for setting up the radiance cache inputs, specifically in determining the final probe resolution and the maximum mip level of the final radiance atlas.
Developers should be aware that this variable affects the quality and performance of the Lumen Irradiance Field system. Increasing the number of mipmaps can potentially improve the quality of indirect lighting at different distances but may also increase memory usage and computational cost.
Best practices when using this variable include:
- Balancing between quality and performance based on the specific needs of the project.
- Testing different values to find the optimal setting for your scene.
- Considering the target hardware capabilities when adjusting this value.
Regarding the associated variable GLumenIrradianceFieldNumMipmaps:
The purpose of GLumenIrradianceFieldNumMipmaps is to store the actual value of the number of radiance cache mipmaps within the C++ code.
This variable is used directly in the Lumen Irradiance Field Gather system, specifically in the SetupRadianceCacheInputs function of the LumenRadianceCache class.
The value of this variable is set by the console variable system when r.Lumen.IrradianceFieldGather.NumMipmaps is modified.
GLumenIrradianceFieldNumMipmaps interacts with several other variables in the radiance cache setup, influencing calculations for probe resolution and atlas mip levels.
Developers should be aware that modifying this variable directly in the code is not recommended, as it’s meant to be controlled via the console variable system.
Best practices for this variable include accessing it only for read operations within the rendering code and relying on the console variable system for any modifications to its value.
#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:87
Scope: file
Source code excerpt:
int32 GLumenIrradianceFieldNumMipmaps = 1;
FAutoConsoleVariableRef CVarLumenIrradianceFieldNumMipmaps(
TEXT("r.Lumen.IrradianceFieldGather.NumMipmaps"),
GLumenIrradianceFieldNumMipmaps,
TEXT("Number of radiance cache mipmaps."),
ECVF_RenderThreadSafe
);
int32 GLumenIrradianceFieldProbeAtlasResolutionInProbes = 128;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenIrradianceFieldNumMipmaps
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:85
Scope: file
Source code excerpt:
);
int32 GLumenIrradianceFieldNumMipmaps = 1;
FAutoConsoleVariableRef CVarLumenIrradianceFieldNumMipmaps(
TEXT("r.Lumen.IrradianceFieldGather.NumMipmaps"),
GLumenIrradianceFieldNumMipmaps,
TEXT("Number of radiance cache mipmaps."),
ECVF_RenderThreadSafe
);
int32 GLumenIrradianceFieldProbeAtlasResolutionInProbes = 128;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeAtlasResolutionInProbes(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:137
Scope (from outer to inner):
file
namespace LumenIrradianceFieldGather
function LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs
Source code excerpt:
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;
Parameters.CalculateIrradiance = 1;
Parameters.IrradianceProbeResolution = GLumenIrradianceFieldProbeIrradianceResolution;
Parameters.OcclusionProbeResolution = GLumenIrradianceFieldProbeOcclusionResolution;
Parameters.NumProbesToTraceBudget = GLumenIrradianceFieldNumProbesToTraceBudget;
Parameters.RadianceCacheStats = GLumenIrradianceFieldStats;
return Parameters;