r.Bloom.ScreenPercentage

r.Bloom.ScreenPercentage

#Overview

name: r.Bloom.ScreenPercentage

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).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Bloom.ScreenPercentage is to control the axis resolution of the FFT convolution for bloom in the rendering system of Unreal Engine 5.

This setting variable is primarily used in the rendering subsystem, specifically in the post-processing module for bloom effects. It’s part of the Fast Fourier Transform (FFT) bloom implementation.

The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with a default value of 100.0f, which represents 100% of the screen resolution.

The associated variable CVarBloomScreenPercentage directly interacts with r.Bloom.ScreenPercentage. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable affects the performance and quality of the bloom effect. A higher percentage will result in higher quality bloom but at the cost of performance, while a lower percentage will improve performance but may reduce bloom quality.

Best practices when using this variable include:

  1. Adjusting it based on the target hardware capabilities.
  2. Balancing between visual quality and performance requirements.
  3. Testing different values to find the optimal setting for your specific game or application.

Regarding the associated variable CVarBloomScreenPercentage:

The purpose of CVarBloomScreenPercentage is the same as r.Bloom.ScreenPercentage, controlling the axis resolution of the FFT convolution for bloom.

It’s used in the same rendering subsystem and post-processing module for bloom effects.

The value is set in the same way as r.Bloom.ScreenPercentage, through the console variable system.

CVarBloomScreenPercentage directly interacts with r.Bloom.ScreenPercentage, as they share the same value.

Developers should be aware that this variable is used to calculate the actual resolution fraction for the bloom effect. It’s clamped between 0.1 (10%) and a maximum value based on the GMaxTextureDimensions and the current view size.

Best practices for using CVarBloomScreenPercentage are the same as for r.Bloom.ScreenPercentage. Additionally, developers should consider the impact on texture memory usage when adjusting this value, as it affects the size of textures used in the bloom calculations.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseScalability.ini:401, section: [PostProcessQuality@0]

Location: <Workspace>/Engine/Config/BaseScalability.ini:421, section: [PostProcessQuality@1]

Location: <Workspace>/Engine/Config/BaseScalability.ini:454, section: [PostProcessQuality@2]

Location: <Workspace>/Engine/Config/BaseScalability.ini:489, section: [PostProcessQuality@3]

Location: <Workspace>/Engine/Config/BaseScalability.ini:527, section: [PostProcessQuality@Cine]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessFFTBloom.cpp:14

Scope: file

Source code excerpt:


TAutoConsoleVariable<float> CVarBloomScreenPercentage(
	TEXT("r.Bloom.ScreenPercentage"), 100.0f,
	TEXT("Controles the axis resolution of the FFT convolution for bloom.\n"),
	ECVF_Scalability | ECVF_RenderThreadSafe);

TAutoConsoleVariable<int32> CVarBloomCacheKernel(
	TEXT("r.Bloom.CacheKernel"), 1,
	TEXT("Whether to cache the kernel in spectral domain."),

#Associated Variable and Callsites

This variable is associated with another variable named CVarBloomScreenPercentage. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessFFTBloom.cpp:13

Scope: file

Source code excerpt:

{

TAutoConsoleVariable<float> CVarBloomScreenPercentage(
	TEXT("r.Bloom.ScreenPercentage"), 100.0f,
	TEXT("Controles the axis resolution of the FFT convolution for bloom.\n"),
	ECVF_Scalability | ECVF_RenderThreadSafe);

TAutoConsoleVariable<int32> CVarBloomCacheKernel(
	TEXT("r.Bloom.CacheKernel"), 1,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessFFTBloom.cpp:226

Scope: file

Source code excerpt:

	float MaxResolutionFraction = FMath::Min(float(GMaxTextureDimensions) * 0.5f / float(FMath::Max(ViewSize.X, ViewSize.Y)), 1.0f);

	return FMath::Clamp(CVarBloomScreenPercentage.GetValueOnRenderThread() / 100.0f, 0.1f, MaxResolutionFraction);
}

bool IsFFTBloomEnabled(const FViewInfo& View)
{
	const bool bUseFFTBloom = View.FinalPostProcessSettings.BloomMethod == EBloomMethod::BM_FFT && View.ViewState != nullptr && DoesPlatformSupportFFTBloom(View.GetShaderPlatform());