r.CameraAnimation.LegacyPostProcessBlending
r.CameraAnimation.LegacyPostProcessBlending
#Overview
name: r.CameraAnimation.LegacyPostProcessBlending
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Blend camera animation post process settings under the main camera instead of over it
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:
- Consider the desired visual outcome when deciding whether to use legacy blending or not.
- Be consistent in its usage across a project to avoid unexpected visual discrepancies.
- Test thoroughly with both true and false settings to ensure the desired effect is achieved in all scenarios.
Regarding the associated variable GCameraAnimationLegacyPostProcessBlending:
- Its purpose is identical to r.CameraAnimation.LegacyPostProcessBlending.
- It’s used in the same GameplayCameras plugin and CameraAnimationCameraModifier module.
- Its value is set and accessed through the TAutoConsoleVariable mechanism.
- It directly controls the blending order in the UCameraAnimationCameraModifier::TickAnimation function.
- Developers should be aware that changes to this variable will immediately affect all camera animations in the game.
- Best practices include using the GetValueOnGameThread() method to access its value, as shown in the provided code snippet, to ensure thread-safe access.
#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)
{