r.Lumen.IrradianceFieldGather.ClipmapWorldExtent
r.Lumen.IrradianceFieldGather.ClipmapWorldExtent
#Overview
name: r.Lumen.IrradianceFieldGather.ClipmapWorldExtent
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
World space extent of the first clipmap
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.IrradianceFieldGather.ClipmapWorldExtent is to define the world space extent of the first clipmap in the Lumen Irradiance Field system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically the Irradiance Field component.
This setting variable is primarily used in the rendering system, particularly in the Lumen subsystem. Based on the callsites, it’s clear that this variable is utilized in the LumenIrradianceFieldGather module of the Renderer.
The value of this variable is set through a console variable (CVar) system, allowing it to be changed at runtime. It’s initialized with a default value of 5000.0f, but can be modified using the console command or through project settings.
The variable interacts directly with GLumenIrradianceFieldClipmapWorldExtent, which is the associated C++ variable that stores the actual value. It’s also used in conjunction with other Lumen Irradiance Field settings, such as GLumenIrradianceFieldClipmapDistributionBase.
Developers should be aware that this variable affects the spatial extent of the Irradiance Field system. Changing this value will impact the coverage area of the global illumination system, potentially affecting performance and visual quality.
Best practices when using this variable include:
- Adjusting it based on the scale of your game world to ensure proper coverage.
- Balancing it with other Irradiance Field settings for optimal performance and quality.
- Testing different values to find the best trade-off between performance and visual fidelity for your specific project.
Regarding the associated variable GLumenIrradianceFieldClipmapWorldExtent:
The purpose of GLumenIrradianceFieldClipmapWorldExtent is to store the actual value of the clipmap world extent in the C++ code. It’s directly linked to the console variable and is used in the implementation of the Lumen Irradiance Field system.
This variable is used within the LumenIrradianceFieldGather namespace, specifically in the SetupRadianceCacheInputs function of the LumenRadianceCache class. It’s used to set the ClipmapWorldExtent parameter of the RadianceCacheInputs structure.
The value of this variable is set by the console variable system and can be modified at runtime.
Developers should be aware that changes to this variable will directly affect the behavior of the Irradiance Field system. It’s crucial for determining the extent of the first clipmap, which impacts the overall coverage and detail of the global illumination.
Best practices include:
- Ensuring that any code that relies on this variable can handle potential runtime changes.
- Considering the impact on memory usage and performance when modifying this value.
- Coordinating changes to this variable with other related Lumen settings for consistent results.
#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:31
Scope: file
Source code excerpt:
float GLumenIrradianceFieldClipmapWorldExtent = 5000.0f;
FAutoConsoleVariableRef CVarLumenIrradianceFieldClipmapWorldExtent(
TEXT("r.Lumen.IrradianceFieldGather.ClipmapWorldExtent"),
GLumenIrradianceFieldClipmapWorldExtent,
TEXT("World space extent of the first clipmap"),
ECVF_RenderThreadSafe
);
float GLumenIrradianceFieldClipmapDistributionBase = 2.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenIrradianceFieldClipmapWorldExtent
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:29
Scope: file
Source code excerpt:
);
float GLumenIrradianceFieldClipmapWorldExtent = 5000.0f;
FAutoConsoleVariableRef CVarLumenIrradianceFieldClipmapWorldExtent(
TEXT("r.Lumen.IrradianceFieldGather.ClipmapWorldExtent"),
GLumenIrradianceFieldClipmapWorldExtent,
TEXT("World space extent of the first clipmap"),
ECVF_RenderThreadSafe
);
float GLumenIrradianceFieldClipmapDistributionBase = 2.0f;
FAutoConsoleVariableRef CVarLumenIrradianceFieldClipmapDistributionBase(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:131
Scope (from outer to inner):
file
namespace LumenIrradianceFieldGather
function LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs
Source code excerpt:
LumenRadianceCache::FRadianceCacheInputs Parameters = LumenRadianceCache::GetDefaultRadianceCacheInputs();
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));