r.LumenScene.Heightfield.ReceiverBias
r.LumenScene.Heightfield.ReceiverBias
#Overview
name: r.LumenScene.Heightfield.ReceiverBias
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Extra bias for Landscape surface points. Helps to fix mismatching LOD artifacts between fixed LOD in Surface Cache and Landscape CLOD.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.Heightfield.ReceiverBias is to provide extra bias for Landscape surface points in the Lumen rendering system. It helps to fix mismatching LOD artifacts between fixed LOD in Surface Cache and Landscape CLOD (Continuous Level of Detail).
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It specifically affects the heightfield rendering within the Lumen scene.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0.01f, but can be changed at runtime or through configuration files.
The associated variable CVarLumenSceneHeightfieldReceiverBias directly interacts with r.LumenScene.Heightfield.ReceiverBias. They share the same value and purpose.
Developers must be aware that this variable affects the rendering of landscape surfaces in Lumen scenes. Adjusting this value can help resolve LOD-related artifacts, but setting it too high might introduce other visual issues.
Best practices when using this variable include:
- Start with the default value (0.01f) and adjust incrementally if LOD artifacts are observed.
- Keep the value as low as possible while still addressing the artifacts to minimize potential side effects.
- Test changes across different landscape configurations and viewing distances.
Regarding the associated variable CVarLumenSceneHeightfieldReceiverBias:
The purpose of CVarLumenSceneHeightfieldReceiverBias is identical to r.LumenScene.Heightfield.ReceiverBias. It’s the actual console variable implementation that controls the heightfield receiver bias in Lumen scenes.
This variable is used in the Lumen rendering subsystem, specifically in the heightfield rendering component.
The value is set when the console variable is created, but can be modified at runtime through console commands or configuration files.
The GetHeightfieldReceiverBias() function in the Lumen namespace uses this variable, clamping its value between 0.001 and 100.0 for safety.
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 performance scaling.
Best practices include using the GetValueOnRenderThread() method to access the value safely from the render thread, and considering the performance implications of frequent changes to this value.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHeightfields.cpp:19
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarLumenSceneHeightfieldReceiverBias(
TEXT("r.LumenScene.Heightfield.ReceiverBias"),
0.01f,
TEXT("Extra bias for Landscape surface points. Helps to fix mismatching LOD artifacts between fixed LOD in Surface Cache and Landscape CLOD."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
bool Lumen::UseHeightfieldTracingForVoxelLighting(const FLumenSceneData& LumenSceneData)
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenSceneHeightfieldReceiverBias
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHeightfields.cpp:18
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<float> CVarLumenSceneHeightfieldReceiverBias(
TEXT("r.LumenScene.Heightfield.ReceiverBias"),
0.01f,
TEXT("Extra bias for Landscape surface points. Helps to fix mismatching LOD artifacts between fixed LOD in Surface Cache and Landscape CLOD."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHeightfields.cpp:46
Scope (from outer to inner):
file
function float Lumen::GetHeightfieldReceiverBias
Source code excerpt:
float Lumen::GetHeightfieldReceiverBias()
{
return FMath::Clamp(CVarLumenSceneHeightfieldReceiverBias.GetValueOnRenderThread(), 0.001, 100.0);
}
void FLumenHeightfieldGPUData::FillData(const FLumenHeightfield& RESTRICT Heightfield, const TSparseSpanArray<FLumenMeshCards>& MeshCards, FVector4f* RESTRICT OutData)
{
// Note: layout must match GetLumenHeightfieldData in usf