r.CameraAnimation.LegacyPostProcessBlending

r.CameraAnimation.LegacyPostProcessBlending

#Overview

name: r.CameraAnimation.LegacyPostProcessBlending

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.CameraAnimation.LegacyPostProcessBlending is to control how camera animation post-process settings are blended with the main camera’s settings in Unreal Engine 5. Specifically, it determines whether these settings are blended under the main camera (legacy behavior) or over it.

This setting variable is primarily used in the GameplayCameras plugin, which is part of Unreal Engine’s camera system. It’s specifically utilized within the CameraAnimationCameraModifier module, which handles camera animations.

The value of this variable is set through a console variable, which allows it to be changed at runtime. It’s initialized with a default value of true, meaning the legacy blending behavior is enabled by default.

The associated variable GCameraAnimationLegacyPostProcessBlending directly interacts with r.CameraAnimation.LegacyPostProcessBlending. They share the same value and purpose.

Developers must be aware that this variable affects how camera animations’ post-process settings are applied. When set to true (legacy mode), the animation’s post-process settings are blended under the main camera’s settings. When false, they’re blended over the main camera’s settings.

Best practices when using this variable include:

  1. Consider the desired visual outcome when deciding whether to use legacy blending or not.
  2. Be consistent in its usage across a project to avoid unexpected visual discrepancies.
  3. Test thoroughly with both true and false settings to ensure the desired effect is achieved in all scenarios.

Regarding the associated variable GCameraAnimationLegacyPostProcessBlending:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Cameras/GameplayCameras/Source/GameplayCameras/Private/Animations/CameraAnimationCameraModifier.cpp:17

Scope: file

Source code excerpt:


TAutoConsoleVariable<bool> GCameraAnimationLegacyPostProcessBlending(
	TEXT("r.CameraAnimation.LegacyPostProcessBlending"),
	true,
	TEXT("Blend camera animation post process settings under the main camera instead of over it"));

FCameraAnimationHandle FCameraAnimationHandle::Invalid(MAX_uint16, 0);

FActiveCameraAnimationInfo::FActiveCameraAnimationInfo()

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Cameras/GameplayCameras/Source/GameplayCameras/Private/Animations/CameraAnimationCameraModifier.cpp:16

Scope: file

Source code excerpt:

DECLARE_CYCLE_STAT(TEXT("Camera Animation Eval"), CameraAnimationEval_Total, STATGROUP_CameraAnimation);

TAutoConsoleVariable<bool> GCameraAnimationLegacyPostProcessBlending(
	TEXT("r.CameraAnimation.LegacyPostProcessBlending"),
	true,
	TEXT("Blend camera animation post process settings under the main camera instead of over it"));

FCameraAnimationHandle FCameraAnimationHandle::Invalid(MAX_uint16, 0);

#Loc: <Workspace>/Engine/Plugins/Cameras/GameplayCameras/Source/GameplayCameras/Private/Animations/CameraAnimationCameraModifier.cpp:436

Scope (from outer to inner):

file
function     void UCameraAnimationCameraModifier::TickAnimation

Source code excerpt:

	{
		const float TotalPostProcessBlendWeight = CameraStandIn->PostProcessBlendWeight * Scale;
		EViewTargetBlendOrder CameraShakeBlendOrder = GCameraAnimationLegacyPostProcessBlending.GetValueOnGameThread() ? VTBlendOrder_Base : VTBlendOrder_Override;
		CameraOwner->AddCachedPPBlend(CameraStandIn->PostProcessSettings, TotalPostProcessBlendWeight, CameraShakeBlendOrder);
	}
}

UCameraAnimationCameraModifier* UGameplayCamerasFunctionLibrary::Conv_CameraAnimationCameraModifier(APlayerCameraManager* PlayerCameraManager)
{