r.DefaultFeature.MotionBlur

r.DefaultFeature.MotionBlur

#Overview

name: r.DefaultFeature.MotionBlur

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

This variable is created as a Console Variable (cvar).

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.DefaultFeature.MotionBlur is to control the default setting for motion blur in the Unreal Engine rendering system. It determines whether motion blur is enabled or disabled by default in the engine.

This setting variable is primarily used by the Unreal Engine’s rendering system, specifically the post-processing pipeline. It’s referenced in the Engine module and the FunctionalTesting module.

The value of this variable is set through a console variable (CVarDefaultMotionBlur) in the Engine’s source code. It’s initialized with a default value of 1, meaning motion blur is enabled by default.

The r.DefaultFeature.MotionBlur variable interacts with the MotionBlurAmount setting in the post-processing settings. When r.DefaultFeature.MotionBlur is set to 0, it forces MotionBlurAmount to 0, effectively disabling motion blur.

Developers should be aware that this setting acts as a default and can be overridden by post-process volumes, camera settings, or game-specific settings. It’s important to note that changing this value at runtime may not immediately affect existing views or post-process volumes.

Best practices for using this variable include:

  1. Use it to set a project-wide default for motion blur.
  2. Consider performance implications when enabling motion blur by default.
  3. Remember that it can be overridden in more specific contexts.

Regarding the associated variable CVarDefaultMotionBlur:

The purpose of CVarDefaultMotionBlur is to provide a console variable interface for r.DefaultFeature.MotionBlur. It allows runtime modification of the motion blur default setting.

This console variable is used in the Engine module, specifically in the scene view construction and post-processing setup.

The value of CVarDefaultMotionBlur is set in the same location as r.DefaultFeature.MotionBlur, and they share the same value.

CVarDefaultMotionBlur directly interacts with the FinalPostProcessSettings, setting MotionBlurAmount to 0 if the console variable is set to 0.

Developers should be aware that changes to CVarDefaultMotionBlur take effect on the next frame or scene view construction.

Best practices for using CVarDefaultMotionBlur include:

  1. Use it for debugging or testing different motion blur configurations.
  2. Be cautious when changing it in shipping builds, as it might affect performance or visual quality.
  3. Consider exposing it as a user-configurable option if motion blur toggling is desired in the final product.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:114, section: [/Script/Engine.RendererSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:195

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarDefaultMotionBlur(
	TEXT("r.DefaultFeature.MotionBlur"),
	1,
	TEXT("Engine default (project setting) for MotionBlur is (postprocess volume/camera/game setting still can override)\n")
	TEXT(" 0: off, sets MotionBlurAmount to 0\n")
	TEXT(" 1: on (default)"));

// off by default for better performance and less distractions

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

Scope (from outer to inner):

file
function     FAutomationTestScreenshotEnvSetup::FAutomationTestScreenshotEnvSetup

Source code excerpt:

	: DefaultFeature_AntiAliasing(TEXT("r.AntiAliasingMethod"))
	, 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"))

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scene.cpp:601

Scope (from outer to inner):

file
function     FPostProcessSettings::FPostProcessSettings

Source code excerpt:

	LensFlareTints[6] = FLinearColor(1.0f, 0.8f, 0.4f, 0.22f);
	LensFlareTints[7] = FLinearColor(0.9f, 0.7f, 0.7f, 0.15f);
	// next value might get overwritten by r.DefaultFeature.MotionBlur
	MotionBlurAmount = 0.5f;
	MotionBlurMax = 5.0f;
	MotionBlurTargetFPS = 30;
	MotionBlurPerObjectSize = 0.f;
	ScreenPercentage_DEPRECATED = 100.0f;
	ReflectionsType_DEPRECATED = EReflectionsType::RayTracing;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:194

Scope: file

Source code excerpt:

	TEXT("Engine default (project setting) for Local Exposure Shadow Contrast (postprocess volume/camera/game setting still can override)\n"));

static TAutoConsoleVariable<int32> CVarDefaultMotionBlur(
	TEXT("r.DefaultFeature.MotionBlur"),
	1,
	TEXT("Engine default (project setting) for MotionBlur is (postprocess volume/camera/game setting still can override)\n")
	TEXT(" 0: off, sets MotionBlurAmount to 0\n")
	TEXT(" 1: on (default)"));

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:1980

Scope (from outer to inner):

file
function     void FSceneView::StartFinalPostprocessSettings

Source code excerpt:

		}

		if (!CVarDefaultMotionBlur.GetValueOnGameThread())
		{
			FinalPostProcessSettings.MotionBlurAmount = 0;
		}
		if (!CVarDefaultLensFlare.GetValueOnGameThread())
		{
			FinalPostProcessSettings.LensFlareIntensity = 0;