r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold
r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold
#Overview
name: r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Per-step stochastic semi-transparency threshold, for tracing users that have dithered transparency enabled, for Mesh SDFs that contain mostly two sided materials (foliage)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold is to control the per-step stochastic semi-transparency threshold for tracing in Lumen’s diffuse indirect lighting system, specifically for Mesh SDFs that contain mostly two-sided materials like foliage.
This setting variable is part of the Lumen global illumination system in Unreal Engine 5’s rendering subsystem. It’s specifically used in the Mesh SDF (Signed Distance Field) culling process, which is a part of Lumen’s diffuse indirect lighting calculations.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as a float with a default value of 0.1f.
The associated variable GMeshSDFDitheredTransparencyStepThreshold directly interacts with this console variable. They share the same value, with the console variable acting as an interface for runtime modification of the engine parameter.
Developers should be aware that this variable affects the rendering of semi-transparent objects, particularly those with two-sided materials like foliage. Adjusting this value will impact the balance between performance and visual quality for these types of objects in scenes using Lumen for global illumination.
Best practices when using this variable include:
- Fine-tuning it based on the specific requirements of your scene, especially if it contains a lot of foliage or other semi-transparent, two-sided materials.
- Testing different values to find the optimal balance between performance and visual quality.
- Being cautious when modifying it, as it can affect the overall look and performance of Lumen’s diffuse indirect lighting.
Regarding the associated variable GMeshSDFDitheredTransparencyStepThreshold:
- Its purpose is to store the actual value used by the rendering system, mirroring the console variable.
- It’s used within the Lumen Mesh SDF tracing system, specifically in the SetupLumenMeshSDFTracingParameters function.
- Its value is set by the console variable system and can be modified at runtime.
- Developers should treat it as read-only within their code, using the console variable for any necessary modifications.
- Best practices include accessing this variable only when needed in performance-critical code paths related to Lumen’s Mesh SDF tracing.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenMeshSDFCulling.cpp:49
Scope: file
Source code excerpt:
float GMeshSDFDitheredTransparencyStepThreshold = .1f;
FAutoConsoleVariableRef CVarMeshSDFDitheredTransparencyStepThreshold(
TEXT("r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold"),
GMeshSDFDitheredTransparencyStepThreshold,
TEXT("Per-step stochastic semi-transparency threshold, for tracing users that have dithered transparency enabled, for Mesh SDFs that contain mostly two sided materials (foliage)"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenSceneHeightfieldCullForView(
#Associated Variable and Callsites
This variable is associated with another variable named GMeshSDFDitheredTransparencyStepThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenMeshSDFCulling.cpp:47
Scope: file
Source code excerpt:
);
float GMeshSDFDitheredTransparencyStepThreshold = .1f;
FAutoConsoleVariableRef CVarMeshSDFDitheredTransparencyStepThreshold(
TEXT("r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold"),
GMeshSDFDitheredTransparencyStepThreshold,
TEXT("Per-step stochastic semi-transparency threshold, for tracing users that have dithered transparency enabled, for Mesh SDFs that contain mostly two sided materials (foliage)"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenSceneHeightfieldCullForView(
TEXT("r.LumenScene.Heightfield.CullForView"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenMeshSDFCulling.cpp:80
Scope (from outer to inner):
file
function void SetupLumenMeshSDFTracingParameters
Source code excerpt:
OutParameters.MeshSDFNotCoveredExpandSurfaceScale = GMeshSDFNotCoveredExpandSurfaceScale;
OutParameters.MeshSDFNotCoveredMinStepScale = GMeshSDFNotCoveredMinStepScale;
OutParameters.MeshSDFDitheredTransparencyStepThreshold = GMeshSDFDitheredTransparencyStepThreshold;
}
uint32 CullMeshSDFObjectsForViewGroupSize = 64;
class FCullMeshSDFObjectsForViewCS : public FGlobalShader
{