r.MotionBlurQuality

r.MotionBlurQuality

#Overview

name: r.MotionBlurQuality

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.MotionBlurQuality is to control the quality level of the motion blur effect in Unreal Engine’s rendering system. It allows developers to adjust the trade-off between visual quality and performance for motion blur.

This setting variable is primarily used by the Renderer module, specifically within the post-processing pipeline for motion blur. It’s referenced in the PostProcessMotionBlur.cpp file, indicating its direct impact on the motion blur implementation.

The value of this variable is set through the console variable system. It’s initialized with a default value of 4 (very high quality) in the ConsoleManager.cpp file. However, it can be changed at runtime through console commands or programmatically.

The r.MotionBlurQuality variable interacts with other motion blur-related settings, such as r.DefaultFeature.MotionBlur, which enables or disables motion blur globally.

Developers should be aware that:

  1. The variable accepts values from 0 to 4, where 0 turns off motion blur, and 1 to 4 represent increasing quality levels.
  2. Higher quality levels may have a performance impact, especially on lower-end hardware.
  3. The effect of this variable is render thread safe, meaning it can be changed dynamically without causing threading issues.

Best practices for using this variable include:

  1. Providing user-facing options to adjust motion blur quality in the game’s graphics settings.
  2. Using lower quality settings (1 or 2) for performance-critical scenarios or on lower-end hardware.
  3. Consider disabling motion blur (setting to 0) for competitive gameplay modes where visual clarity is crucial.
  4. Testing the visual and performance impact of different quality levels across various hardware configurations.
  5. Using the scalability system to automatically adjust this setting based on the overall graphics quality preset.

#Setting Variables

#References In INI files

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

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

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

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

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:3653

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarMotionBlurQuality(
	TEXT("r.MotionBlurQuality"),
	4,
	TEXT("Defines the motion blur method which allows to adjust for quality or performance.\n"
		 " 0:off, 1:low, 2:medium, 3:high (default), 4: very high"),
	ECVF_Scalability | ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarFullscreenMode(

#Loc: <Workspace>/Engine/Source/Developer/FunctionalTesting/Private/AutomationBlueprintFunctionLibrary.cpp:242

Scope (from outer to inner):

file
function     FAutomationTestScreenshotEnvSetup::FAutomationTestScreenshotEnvSetup

Source code excerpt:

	, DefaultFeature_AutoExposure(TEXT("r.DefaultFeature.AutoExposure"))
	, DefaultFeature_MotionBlur(TEXT("r.DefaultFeature.MotionBlur"))
	, MotionBlurQuality(TEXT("r.MotionBlurQuality"))
	, ScreenSpaceReflectionQuality(TEXT("r.SSR.Quality"))
	, EyeAdaptationQuality(TEXT("r.EyeAdaptationQuality"))
	, ContactShadows(TEXT("r.ContactShadows"))
	, TonemapperGamma(TEXT("r.TonemapperGamma"))
	, TonemapperSharpen(TEXT("r.Tonemapper.Sharpen"))
	, ScreenPercentage(TEXT("r.ScreenPercentage"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMotionBlur.cpp:87

Scope (from outer to inner):

file
namespace    anonymous
function     int32 GetMotionBlurQualityFromCVar

Source code excerpt:

		int32 MotionBlurQuality;

		static const auto ICVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.MotionBlurQuality"));
		MotionBlurQuality = FMath::Clamp(ICVar->GetValueOnRenderThread(), 0, 4);

		return MotionBlurQuality;
	}

DECLARE_GPU_STAT(MotionBlur)