r.SkyAtmosphere.TransmittanceLUT.UseSmallFormat
r.SkyAtmosphere.TransmittanceLUT.UseSmallFormat
#Overview
name: r.SkyAtmosphere.TransmittanceLUT.UseSmallFormat
The value of this variable can be defined or overridden in .ini config files. 13
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, the transmittance LUT will use a small R8BG8B8A8 format to store data at lower quality.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkyAtmosphere.TransmittanceLUT.UseSmallFormat is to control the format of the transmittance Look-Up Table (LUT) used in the Sky Atmosphere rendering system of Unreal Engine 5. Specifically, it determines whether to use a smaller, lower-quality format for storing the transmittance data.
This setting variable is primarily used in the rendering system, specifically for the Sky Atmosphere component. It’s part of the Renderer module in Unreal Engine 5.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning the small format is not used by default.
The associated variable CVarSkyAtmosphereTransmittanceLUTUseSmallFormat directly interacts with it, as they share the same value and purpose.
Developers must be aware that enabling this option (setting it to 1) will result in lower quality rendering of the sky atmosphere, as it uses a smaller R8BG8B8A8 format to store the transmittance data. This can be useful for performance optimization on lower-end hardware or for scalability purposes.
Best practices when using this variable include:
- Keep it disabled (0) for high-quality renders or when targeting high-end hardware.
- Enable it (1) when performance is a concern, especially on lower-end devices.
- Test the visual impact thoroughly when enabling this option to ensure the quality trade-off is acceptable for your project.
Regarding the associated variable CVarSkyAtmosphereTransmittanceLUTUseSmallFormat:
The purpose of this variable is identical to r.SkyAtmosphere.TransmittanceLUT.UseSmallFormat, as it’s the actual console variable implementation in the C++ code.
It’s used in the SkyAtmosphereRendering.cpp file, which is part of the Renderer module. The variable directly affects the creation of the TransmittanceLutTexture in the InitSkyAtmosphereForScene function.
The value is set through the console variable system and can be accessed using GetValueOnRenderThread() method.
This variable interacts with other rendering parameters, particularly affecting the format of the pooled render target used for the transmittance LUT.
Developers should be aware that changes to this variable will directly impact the memory usage and quality of the sky atmosphere rendering.
Best practices include using this variable in conjunction with other sky atmosphere settings to find the right balance between performance and visual quality for your target hardware and quality requirements.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:634, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:661, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:688, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:715, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:743, section: [EffectsQuality@Cine]
- INI Section:
EffectsQuality@Cine
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:153, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:166, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:179, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:192, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:153, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:166, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:179, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:192, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
1
- 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:157
Scope: file
Source code excerpt:
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."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarSkyAtmosphereTransmittanceLUTWidth(
TEXT("r.SkyAtmosphere.TransmittanceLUT.Width"), 256,
TEXT(""),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSkyAtmosphereTransmittanceLUTUseSmallFormat
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SkyAtmosphereRendering.cpp:156
Scope: file
Source code excerpt:
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."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarSkyAtmosphereTransmittanceLUTWidth(
TEXT("r.SkyAtmosphere.TransmittanceLUT.Width"), 256,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SkyAtmosphereRendering.cpp:1144
Scope (from outer to inner):
file
function void InitSkyAtmosphereForScene
Source code excerpt:
if (CVarSkyAtmosphereTransmittanceLUT.GetValueOnAnyThread() > 0)
{
const bool TranstmittanceLUTUseSmallFormat = CVarSkyAtmosphereTransmittanceLUTUseSmallFormat.GetValueOnRenderThread() > 0;
TRefCountPtr<IPooledRenderTarget>& TransmittanceLutTexture = SkyInfo.GetTransmittanceLutTexture();
Desc = FPooledRenderTargetDesc::Create2DDesc(
FIntPoint(TransmittanceLutWidth, TransmittanceLutHeight),
TranstmittanceLUTUseSmallFormat ? TextureLUTSmallFormat : TextureLUTFormat, FClearValueBinding::None, TexCreate_None, TexCreate_ShaderResource | TexCreate_UAV, false);
GRenderTargetPool.FindFreeElement(RHICmdList, Desc, TransmittanceLutTexture, TEXT("SkyAtmosphere.TransmittanceLut"));