r.Lumen.IrradianceFieldGather.NumClipmaps
r.Lumen.IrradianceFieldGather.NumClipmaps
#Overview
name: r.Lumen.IrradianceFieldGather.NumClipmaps
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of radiance cache clipmaps.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.IrradianceFieldGather.NumClipmaps is to control the number of radiance cache clipmaps in Unreal Engine 5’s Lumen global illumination system. This setting variable is specifically used for the rendering system, particularly for the Lumen Irradiance Field Gather feature.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Based on the callsites provided, it’s clear that this variable is utilized within the LumenIrradianceFieldGather namespace, which is part of the Lumen global illumination system.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 4 and can be modified at runtime using the console command system.
The associated variable GLumenIrradianceFieldNumClipmaps directly interacts with r.Lumen.IrradianceFieldGather.NumClipmaps. They share the same value, with GLumenIrradianceFieldNumClipmaps being the actual integer variable used in the C++ code.
Developers must be aware that this variable affects the number of radiance cache clipmaps, which can impact both rendering quality and performance. Increasing the number of clipmaps may improve lighting detail at different distances but could also increase memory usage and computational cost.
Best practices when using this variable include:
- Adjusting it based on the scale and lighting complexity of your scene.
- Balancing it with other Lumen settings for optimal performance and quality.
- Testing different values to find the sweet spot for your specific use case.
Regarding the associated variable GLumenIrradianceFieldNumClipmaps:
The purpose of GLumenIrradianceFieldNumClipmaps is to store and provide access to the number of radiance cache clipmaps within the C++ code of the Lumen system.
This variable is used directly in the Lumen Irradiance Field Gather feature of the rendering system. It’s accessed in the SetupRadianceCacheInputs function to set up the radiance cache parameters.
The value of GLumenIrradianceFieldNumClipmaps is set by the console variable system through r.Lumen.IrradianceFieldGather.NumClipmaps.
It interacts with other variables in the radiance cache setup, such as GLumenIrradianceFieldGridResolution and GLumenIrradianceFieldProbeResolution.
Developers should be aware that this variable is clamped between 1 and LumenRadianceCache::MaxClipmaps when used, ensuring it stays within a valid range.
Best practices for using GLumenIrradianceFieldNumClipmaps include:
- Avoiding direct modification of this variable in code, instead use the console variable to change its value.
- Considering its impact on other related variables and overall system performance when adjusting it.
- Using it in conjunction with other Lumen settings to achieve the desired balance of quality and performance.
#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:23
Scope: file
Source code excerpt:
int32 GLumenIrradianceFieldNumClipmaps = 4;
FAutoConsoleVariableRef CVarLumenIrradianceFieldNumClipmaps(
TEXT("r.Lumen.IrradianceFieldGather.NumClipmaps"),
GLumenIrradianceFieldNumClipmaps,
TEXT("Number of radiance cache clipmaps."),
ECVF_RenderThreadSafe
);
float GLumenIrradianceFieldClipmapWorldExtent = 5000.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenIrradianceFieldNumClipmaps
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:21
Scope: file
Source code excerpt:
);
int32 GLumenIrradianceFieldNumClipmaps = 4;
FAutoConsoleVariableRef CVarLumenIrradianceFieldNumClipmaps(
TEXT("r.Lumen.IrradianceFieldGather.NumClipmaps"),
GLumenIrradianceFieldNumClipmaps,
TEXT("Number of radiance cache clipmaps."),
ECVF_RenderThreadSafe
);
float GLumenIrradianceFieldClipmapWorldExtent = 5000.0f;
FAutoConsoleVariableRef CVarLumenIrradianceFieldClipmapWorldExtent(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:135
Scope (from outer to inner):
file
namespace LumenIrradianceFieldGather
function LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs
Source code excerpt:
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;
Parameters.CalculateIrradiance = 1;
Parameters.IrradianceProbeResolution = GLumenIrradianceFieldProbeIrradianceResolution;
Parameters.OcclusionProbeResolution = GLumenIrradianceFieldProbeOcclusionResolution;