r.LumenScene.FarField.ReferencePos.Z
r.LumenScene.FarField.ReferencePos.Z
#Overview
name: r.LumenScene.FarField.ReferencePos.Z
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Far-field reference position in Z (default = 100000.0)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.FarField.ReferencePos.Z is to set the Z-coordinate of the far-field reference position in the Lumen scene rendering system. This setting is part of Unreal Engine 5’s Lumen global illumination system, which is responsible for real-time dynamic global illumination.
The Lumen rendering system within Unreal Engine’s renderer module relies on this setting variable. It is specifically used in the far-field calculations of the Lumen scene.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 100000.0f, but can be changed at runtime or through configuration files.
This variable interacts with an associated variable named CVarLumenFarFieldReferencePosZ. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the far-field rendering in Lumen scenes. Changing its value could impact the quality and performance of global illumination, especially for distant objects or large-scale environments.
Best practices when using this variable include:
- Only modify it if you understand the implications on far-field lighting calculations.
- Test thoroughly after changes, as it can affect the overall lighting quality and performance.
- Consider the scale of your scene when adjusting this value.
Regarding the associated variable CVarLumenFarFieldReferencePosZ:
The purpose of CVarLumenFarFieldReferencePosZ is to provide a programmatic way to access and modify the r.LumenScene.FarField.ReferencePos.Z setting within C++ code.
It’s used in the Lumen namespace, specifically in the GetFarFieldReferencePos function, which returns a FVector with the Z component set to this variable’s value.
The value of this variable is set through the CVar system and can be accessed on the render thread using GetValueOnRenderThread().
Developers should be aware that this variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating it’s safe to modify on the render thread and can be adjusted for different scalability settings.
Best practices for using CVarLumenFarFieldReferencePosZ include:
- Access it through the provided CVar interface rather than directly.
- Be cautious when modifying it during runtime, as it can affect ongoing rendering processes.
- Consider using it in conjunction with other Lumen settings for a cohesive adjustment of the far-field rendering behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:46
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarLumenFarFieldReferencePosZ(
TEXT("r.LumenScene.FarField.ReferencePos.Z"),
100000.0f,
TEXT("Far-field reference position in Z (default = 100000.0)"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenSceneUploadEveryFrame = 0;
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenFarFieldReferencePosZ
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:45
Scope: file
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarLumenFarFieldReferencePosZ(
TEXT("r.LumenScene.FarField.ReferencePos.Z"),
100000.0f,
TEXT("Far-field reference position in Z (default = 100000.0)"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:106
Scope (from outer to inner):
file
namespace Lumen
function FVector GetFarFieldReferencePos
Source code excerpt:
FVector GetFarFieldReferencePos()
{
return FVector(0.0f, 0.0f, CVarLumenFarFieldReferencePosZ.GetValueOnRenderThread());
}
}
int32 Lumen::GetGlobalDFResolution()
{
return GLumenSceneGlobalDFResolution;