Add Post Process to PlayerCameraManager

I’m on binary 4.8.3 and am trying to dynamically modify post process settings on my camera.

I have defined an FPostProcessSettings like so:

FPostProcessSettings RobProccessing;
RobProccessing.DepthOfFieldMethod = EDepthOfFieldMethod::DOFM_Gaussian;
RobProccessing.DepthOfFieldFocalDistance = CameraFurthestDistance;
RobProccessing.DepthOfFieldFocalRegion = 400.f;
RobProccessing.DepthOfFieldNearTransitionRegion = 500.f;
RobProccessing.DepthOfFieldFarTransitionRegion = 500.f;
RobProccessing.DepthOfFieldNearBlurSize = 15.f;
RobProccessing.DepthOfFieldFarBlurSize = 15.f;
RobProccessing.bOverride_DepthOfFieldMethod = true;
RobProccessing.bOverride_DepthOfFieldFocalDistance = true;
RobProccessing.bOverride_DepthOfFieldFocalRegion = true;
RobProccessing.bOverride_DepthOfFieldNearTransitionRegion = true;
RobProccessing.bOverride_DepthOfFieldFarTransitionRegion = true;
RobProccessing.bOverride_DepthOfFieldNearBlurSize = true;
RobProccessing.bOverride_DepthOfFieldFarBlurSize = true;

In my player camera manager, I’m using AddCachedPPBlend to add this post process to the camera with a weight of 1. However I never see the affect.

Anything I might be missing?

This is old but… Did anyone figure this out? or is it bugged?

Okay so I just spent a lot of time tracking down how to do this in the Engine source, and for future people like myself that are trying to track down a solution for this: as far as I can tell this is not supported in the default PlayerCameraManager.

However, I have a small implementation that does support this behavior that I am using with success.

// PPCameraManager.h
// Feel free to move some/all implementation to a separate .cpp file
#pragma once

#include "CoreMinimal.h"
#include "Camera/PlayerCameraManager.h"
#include "PPCameraManager.generated.h"

/**
 * Camera manager that allows applying post process effects.
 */
UCLASS()
class APPCameraManager : public APlayerCameraManager
{
	GENERATED_BODY()

    FPostProcessSettings PPSettings;

public:
    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    float PPWeight = 1.f;

    virtual void ApplyCameraModifiers(float DeltaTime, FMinimalViewInfo& InOutPOV) override
    {
        Super::ApplyCameraModifiers(DeltaTime, InOutPOV);
        if (PPWeight > 0.f)
        {
            AddCachedPPBlend(PPSettings, PPWeight);
        }
    }

    UFUNCTION(BlueprintCallable)
    void AddBlendable(const TScriptInterface<IBlendableInterface> InBlendableObject, const float InWeight = 1.f)
    {
        PPSettings.AddBlendable(InBlendableObject, InWeight);
    }

    UFUNCTION(BlueprintCallable)
    void RemoveBlendable(const TScriptInterface<IBlendableInterface> InBlendableObject)
    {
        PPSettings.RemoveBlendable(InBlendableObject);
    }
};

You’ll just need to make sure that your player controller has this new type set for the camera manager class (see screenshot). Then you can just cast your camera manager to the new type and add/remove post process effects at your heart’s content. :slight_smile:

316901-cameramanager.png