r.SkyAtmosphere.FastSkyLUT.SampleCountMax
r.SkyAtmosphere.FastSkyLUT.SampleCountMax
#Overview
name: r.SkyAtmosphere.FastSkyLUT.SampleCountMax
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:
Fast sky maximum sample count used to compute sky/atmosphere scattering and transmittance.\nThe maximum sample count used to compute FastSkyLUT scattering. The effective sample count is usually lower and depends on distance and SampleCountScale on the component, as well as .ini files.\nThe minimal value will be clamped to r.SkyAtmosphere.FastSkyLUT.SampleCountMin + 1.\n
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkyAtmosphere.FastSkyLUT.SampleCountMax is to set the maximum sample count for computing sky and atmosphere scattering and transmittance in Unreal Engine 5’s sky atmosphere rendering system. This variable is part of the rendering system, specifically for the sky atmosphere rendering.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, as evidenced by its references in the SkyAtmosphereRendering.cpp file. It’s also referenced in the Engine module, specifically in the SkyAtmosphereComponent class.
The value of this variable is set through a console variable (CVarSkyAtmosphereFastSkyLUTSampleCountMax) with a default value of 32.0f. It can be modified at runtime through console commands or configuration files.
This variable interacts with other related variables:
- r.SkyAtmosphere.FastSkyLUT.SampleCountMin: The minimum sample count.
- TraceSampleCountScale: A multiplier for the sample count defined in the SkyAtmosphereComponent.
Developers should be aware of the following:
- The effective sample count is usually lower than the maximum and depends on distance and SampleCountScale on the component.
- The minimum value is clamped to r.SkyAtmosphere.FastSkyLUT.SampleCountMin + 1.
- This setting affects rendering performance and quality, so it should be balanced carefully.
Best practices when using this variable include:
- Adjust it based on the specific needs of your scene and target hardware.
- Use it in conjunction with other sky atmosphere settings for optimal results.
- Test different values to find the best balance between visual quality and performance.
The associated variable CVarSkyAtmosphereFastSkyLUTSampleCountMax is the console variable implementation of r.SkyAtmosphere.FastSkyLUT.SampleCountMax. It’s used internally by the engine to store and access the value of the setting. This variable is used in the SetupSkyAtmosphereInternalCommonParameters function to set the FastSkySampleCountMax parameter, which is then used in the sky atmosphere rendering calculations. The same considerations and best practices apply to this variable as to r.SkyAtmosphere.FastSkyLUT.SampleCountMax.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:631, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
16.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:658, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
32.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:685, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
64.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:712, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
128.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:740, section: [EffectsQuality@Cine]
- INI Section:
EffectsQuality@Cine
- Raw value:
256.0
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:150, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
8.0
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:163, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
8.0
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:176, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
8.0
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:189, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
8.0
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:150, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
8.0
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:163, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
8.0
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:176, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
8.0
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:189, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
8.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:85
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarSkyAtmosphereFastSkyLUTSampleCountMax(
TEXT("r.SkyAtmosphere.FastSkyLUT.SampleCountMax"), 32.0f,
TEXT("Fast sky maximum sample count used to compute sky/atmosphere scattering and transmittance.\n")
TEXT("The maximum sample count used to compute FastSkyLUT scattering. The effective sample count is usually lower and depends on distance and SampleCountScale on the component, as well as .ini files.\n")
TEXT("The minimal value will be clamped to r.SkyAtmosphere.FastSkyLUT.SampleCountMin + 1.\n"),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarSkyAtmosphereFastSkyLUTDistanceToSampleCountMax(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Components/SkyAtmosphereComponent.h:78
Scope (from outer to inner):
file
class class USkyAtmosphereComponent : public USceneComponent
Source code excerpt:
* Scale the atmosphere tracing sample count. Quality level scalability
* The sample count is still clamped according to scalability setting to 'r.SkyAtmosphere.SampleCountMax' when 'r.SkyAtmosphere.FastSkyLUT' is 0.
* The sample count is still clamped according to scalability setting to 'r.SkyAtmosphere.FastSkyLUT.SampleCountMax' when 'r.SkyAtmosphere.FastSkyLUT' is 1.
* The sample count is still clamped for aerial perspective according to 'r.SkyAtmosphere.AerialPerspectiveLUT.SampleCountMaxPerSlice'.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Atmosphere", AdvancedDisplay, meta = (UIMin = "0.25", UIMax = "8", ClampMin = "0.25", SliderExponent = 3.0))
float TraceSampleCountScale;
/** Rayleigh scattering coefficient scale.*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Rayleigh", meta = (UIMin = 0.0, UIMax = 2.0, ClampMin = 0.0, SliderExponent = 4.0))
float RayleighScatteringScale;
#Associated Variable and Callsites
This variable is associated with another variable named CVarSkyAtmosphereFastSkyLUTSampleCountMax
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SkyAtmosphereRendering.cpp:84
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarSkyAtmosphereFastSkyLUTSampleCountMax(
TEXT("r.SkyAtmosphere.FastSkyLUT.SampleCountMax"), 32.0f,
TEXT("Fast sky maximum sample count used to compute sky/atmosphere scattering and transmittance.\n")
TEXT("The maximum sample count used to compute FastSkyLUT scattering. The effective sample count is usually lower and depends on distance and SampleCountScale on the component, as well as .ini files.\n")
TEXT("The minimal value will be clamped to r.SkyAtmosphere.FastSkyLUT.SampleCountMin + 1.\n"),
ECVF_RenderThreadSafe | ECVF_Scalability);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SkyAtmosphereRendering.cpp:1251
Scope (from outer to inner):
file
function static void SetupSkyAtmosphereInternalCommonParameters
Source code excerpt:
InternalCommonParameters.FastSkySampleCountMin = CVarSkyAtmosphereFastSkyLUTSampleCountMin.GetValueOnRenderThread();
InternalCommonParameters.FastSkySampleCountMax = FMath::Min(SkyAtmosphereBaseSampleCount * SkyInfo.GetSkyAtmosphereSceneProxy().GetTraceSampleCountScale(), float(CVarSkyAtmosphereFastSkyLUTSampleCountMax.GetValueOnRenderThread()));
float FastSkyDistanceToSampleCountMaxInv = CVarSkyAtmosphereFastSkyLUTDistanceToSampleCountMax.GetValueOnRenderThread();
InternalCommonParameters.CameraAerialPerspectiveVolumeDepthResolution = float(CameraAerialPerspectiveVolumeDepthResolution);
InternalCommonParameters.CameraAerialPerspectiveVolumeDepthResolutionInv = 1.0f / InternalCommonParameters.CameraAerialPerspectiveVolumeDepthResolution;
InternalCommonParameters.CameraAerialPerspectiveVolumeDepthSliceLengthKm = CameraAerialPerspectiveVolumeDepthSliceLengthKm;
InternalCommonParameters.CameraAerialPerspectiveVolumeDepthSliceLengthKmInv = 1.0f / CameraAerialPerspectiveVolumeDepthSliceLengthKm;