r.Lumen.SkylightLeaking.Roughness
r.Lumen.SkylightLeaking.Roughness
#Overview
name: r.Lumen.SkylightLeaking.Roughness
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Roughness used to sample the skylight leaking cubemap. A value of 0 gives no prefiltering of the skylight leaking, while larger values can be useful to hide sky features in the leaking.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.SkylightLeaking.Roughness is to control the roughness used for sampling the skylight leaking cubemap in the Lumen global illumination system. This setting is part of Unreal Engine’s rendering system, specifically the Lumen lighting system.
The Lumen rendering subsystem within Unreal Engine 5 relies on this setting variable. It’s used in the LumenTracingUtils module, which is part of the Renderer.
The value of this variable is set through the FAutoConsoleVariableRef named CVarLumenSkylightLeakingRoughness. It’s initialized with a default value of 0.3f, but can be changed at runtime through console commands or project settings.
This variable interacts directly with GLumenSkylightLeakingRoughness, which is the actual float variable used in the code. The console variable r.Lumen.SkylightLeaking.Roughness is essentially a wrapper that allows easy modification of GLumenSkylightLeakingRoughness.
Developers must be aware that this variable affects the visual quality of skylight leaking in scenes using Lumen. A value of 0 means no prefiltering of the skylight leaking, while larger values can help hide sky features in the leaking effect. This can be useful for adjusting the appearance of indirect lighting in a scene.
Best practices when using this variable include:
- Experiment with different values to find the right balance between performance and visual quality for your specific scene.
- Consider the overall lighting design of your scene when adjusting this value.
- Be aware that higher values might hide some sky details but could potentially improve performance.
- Use this in conjunction with other Lumen settings for optimal results.
Regarding the associated variable GLumenSkylightLeakingRoughness:
The purpose of GLumenSkylightLeakingRoughness is to store the actual roughness value used in the Lumen skylight leaking calculations. It’s a float variable that directly affects the rendering process.
This variable is used within the Lumen rendering subsystem, specifically in the GetLumenCardTracingParameters function within the LumenTracingUtils module.
The value of GLumenSkylightLeakingRoughness is set initially to 0.3f, but can be modified through the r.Lumen.SkylightLeaking.Roughness console variable.
GLumenSkylightLeakingRoughness interacts directly with the r.Lumen.SkylightLeaking.Roughness console variable, and it’s used in the FLumenCardTracingParameters struct as part of the Lumen tracing process.
Developers should be aware that modifying GLumenSkylightLeakingRoughness directly in code is not recommended. Instead, they should use the r.Lumen.SkylightLeaking.Roughness console variable to ensure proper synchronization and thread safety.
Best practices for GLumenSkylightLeakingRoughness include:
- Avoid modifying it directly in code; use the console variable instead.
- Consider its impact on both visual quality and performance when adjusting its value.
- Test thoroughly in various lighting conditions to ensure desired results.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTracingUtils.cpp:7
Scope: file
Source code excerpt:
float GLumenSkylightLeakingRoughness = 0.3f;
FAutoConsoleVariableRef CVarLumenSkylightLeakingRoughness(
TEXT("r.Lumen.SkylightLeaking.Roughness"),
GLumenSkylightLeakingRoughness,
TEXT("Roughness used to sample the skylight leaking cubemap. A value of 0 gives no prefiltering of the skylight leaking, while larger values can be useful to hide sky features in the leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenSampleFog(
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSkylightLeakingRoughness
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTracingUtils.cpp:5
Scope: file
Source code excerpt:
#include "SystemTextures.h"
float GLumenSkylightLeakingRoughness = 0.3f;
FAutoConsoleVariableRef CVarLumenSkylightLeakingRoughness(
TEXT("r.Lumen.SkylightLeaking.Roughness"),
GLumenSkylightLeakingRoughness,
TEXT("Roughness used to sample the skylight leaking cubemap. A value of 0 gives no prefiltering of the skylight leaking, while larger values can be useful to hide sky features in the leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenSampleFog(
TEXT("r.Lumen.SampleFog"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTracingUtils.cpp:37
Scope (from outer to inner):
file
function void GetLumenCardTracingParameters
Source code excerpt:
TracingParameters.DiffuseColorBoost = 1.0f / FMath::Max(View.FinalPostProcessSettings.LumenDiffuseColorBoost, 1.0f);
TracingParameters.SkylightLeaking = View.FinalPostProcessSettings.LumenSkylightLeaking;
TracingParameters.SkylightLeakingRoughness = GLumenSkylightLeakingRoughness;
TracingParameters.InvFullSkylightLeakingDistance = 1.0f / FMath::Clamp<float>(View.FinalPostProcessSettings.LumenFullSkylightLeakingDistance, .1f, Lumen::GetMaxTraceDistance(View));
TracingParameters.SampleHeightFog = CVarLumenSampleFog.GetValueOnRenderThread() > 0 ? 1u : 0u;
TracingParameters.FogUniformParameters = CreateFogUniformBuffer(GraphBuilder, View);
const FScene* Scene = ((const FScene*)View.Family->Scene);