r.SkyAtmosphere.TransmittanceLUT.SampleCount
r.SkyAtmosphere.TransmittanceLUT.SampleCount
#Overview
name: r.SkyAtmosphere.TransmittanceLUT.SampleCount
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The sample count used to evaluate transmittance.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkyAtmosphere.TransmittanceLUT.SampleCount is to control the sample count used to evaluate transmittance in the Sky Atmosphere rendering system of Unreal Engine 5.
This setting variable is primarily used by the Renderer module, specifically within the Sky Atmosphere rendering subsystem. It directly influences the quality and performance of the sky and atmosphere rendering in the engine.
The value of this variable is set through a console variable (CVar) system, which allows for runtime adjustments. It’s defined with a default value of 10.0f, but can be changed during runtime or through configuration files.
The associated variable CVarSkyAtmosphereTransmittanceLUTSampleCount interacts directly with r.SkyAtmosphere.TransmittanceLUT.SampleCount. They share the same value and purpose, with CVarSkyAtmosphereTransmittanceLUTSampleCount being the actual C++ variable used in the code to access and modify the setting.
Developers must be aware that this variable affects the quality and performance trade-off in sky rendering. A higher sample count will result in more accurate transmittance evaluation but at the cost of increased computational load.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project, considering both visual quality and performance requirements.
- Testing different values to find the optimal balance between quality and performance for your specific scenes.
- Potentially exposing it as a user-configurable setting for players with different hardware capabilities.
Regarding the associated variable CVarSkyAtmosphereTransmittanceLUTSampleCount:
- Its purpose is to provide programmatic access to the r.SkyAtmosphere.TransmittanceLUT.SampleCount setting within the C++ code.
- It’s used in the Renderer module, specifically in the SetupSkyAtmosphereInternalCommonParameters function.
- Its value is set when the r.SkyAtmosphere.TransmittanceLUT.SampleCount console variable is modified.
- It interacts directly with the InternalCommonParameters.TransmittanceSampleCount in the sky atmosphere rendering logic.
- Developers should be aware that changes to this variable will directly affect the sky rendering pipeline.
- Best practices include using GetValueOnRenderThread() when accessing this variable to ensure thread-safe operations in the rendering code.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:635, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
10.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:662, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
10.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:689, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
10.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:716, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
10.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:744, section: [EffectsQuality@Cine]
- INI Section:
EffectsQuality@Cine
- Raw value:
30.0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SkyAtmosphereRendering.cpp:152
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarSkyAtmosphereTransmittanceLUTSampleCount(
TEXT("r.SkyAtmosphere.TransmittanceLUT.SampleCount"), 10.0f,
TEXT("The sample count used to evaluate transmittance."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarSkyAtmosphereTransmittanceLUTUseSmallFormat(
TEXT("r.SkyAtmosphere.TransmittanceLUT.UseSmallFormat"), 0,
TEXT("If true, the transmittance LUT will use a small R8BG8B8A8 format to store data at lower quality."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSkyAtmosphereTransmittanceLUTSampleCount
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SkyAtmosphereRendering.cpp:151
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarSkyAtmosphereTransmittanceLUTSampleCount(
TEXT("r.SkyAtmosphere.TransmittanceLUT.SampleCount"), 10.0f,
TEXT("The sample count used to evaluate transmittance."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarSkyAtmosphereTransmittanceLUTUseSmallFormat(
TEXT("r.SkyAtmosphere.TransmittanceLUT.UseSmallFormat"), 0,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SkyAtmosphereRendering.cpp:1260
Scope (from outer to inner):
file
function static void SetupSkyAtmosphereInternalCommonParameters
Source code excerpt:
InternalCommonParameters.CameraAerialPerspectiveSampleCountPerSlice = FMath::Max(AerialPerspectiveBaseSampleCountPerSlice, FMath::Min(2.0f * SkyInfo.GetSkyAtmosphereSceneProxy().GetTraceSampleCountScale(), float(CVarSkyAtmosphereAerialPerspectiveLUTSampleCountMaxPerSlice.GetValueOnRenderThread())));
InternalCommonParameters.TransmittanceSampleCount = CVarSkyAtmosphereTransmittanceLUTSampleCount.GetValueOnRenderThread();
InternalCommonParameters.MultiScatteringSampleCount = CVarSkyAtmosphereMultiScatteringLUTSampleCount.GetValueOnRenderThread();
const FSkyAtmosphereSceneProxy& SkyAtmosphereSceneProxy = SkyInfo.GetSkyAtmosphereSceneProxy();
InternalCommonParameters.SkyLuminanceFactor = FVector3f(SkyAtmosphereSceneProxy.GetSkyLuminanceFactor());
InternalCommonParameters.AerialPespectiveViewDistanceScale = SkyAtmosphereSceneProxy.GetAerialPespectiveViewDistanceScale();
InternalCommonParameters.FogShowFlagFactor = ViewFamily.EngineShowFlags.Fog > 0 ? 1.0f : 0.0f;