Camera Postprocessing
Last updated
Last updated
Unlike camera shakes, native Unreal only supports per-camera camera postprocessing. You can explicitly set the parameters under the Post Process
group in Camera Component
. But the post process effects only live when current active camera is the owned one. That is to say, when you transition from one camera with PP to another one without PP, the PP effects will vanish as soon as transition finishes. Moreover, PP blending is not well supported.
If you've already enabled EPlayerCameraManager
in game mode, you can readily use blueprint node AddPostProcess to add your post process effect to current acive camera, and node RemoveAllPostProcesses to immediately remove all post processes, without worrying about which specific camera you are using. This will apply to all cameras during the life cycle of post process effects.
Add post process. In the blueprint, you should first get the player camera manager in level. Do it by using node GetPlayerCameraManager
. Then, cast it to the EPlayerCameraManager
class. Finally, use the AddPostProcess
node to add a post process effect to camera. You can use Make PostProcessSettings
to make post process effects in place, or pass in a reference to the In Post Process
parameter. In Weight
is the amount of contribution the post process effects make to camera. A value of 1 means full effect, while a value of 0 means no effect.
Remove post process. You can use node RemoveAllPostProcesses to remove all added post process effects. Currently removing a specific post process effect is not supported.
Add and remove blendables. A blendable is an asset that has properties which can be smoothly interpolated with other blendables. You can create a blendable material with domain Post Process
to highly customize camera post-process effects, not only the pre-defined ones shown in Post Process Settings
. You may also need to use post process volumes for blending. Refer to the official Post Process Materials and Post Process Effects documentations for more information. Once you have created a post process material, you can add it via node AddBlendable
, or remove it via node RemoveBlendable
. You can also use the utility version AddBlendable and RemoveBlendable for a more convenient call. If you are using post process volumes, more blueprint nodes can be leveraged to give a finer control over PP effects along with blending.
If you are using blendables, you should setup your materials following the next steps to make post process effects work correctly:
Create a material with Post Process
domain. In the material blueprint, before the output, insert a lerp
node with the vanilla source as first Input, your post process effect as second input and a parameterized scalar as the third input Alpha. Set the scalar as default 0.
Create a material instance from this material and toggle on the blend parameter and set it to 1.
At where you want to use this material, invoke the Add Blendable
node and pass in the material instance you just created. Set other parameters as you want.
Play the game and you will see the effect now works as expected!
If you followed these steps and observe anomaly, you can delete the blend parameter and re-add it. If it still fails, check the material blueprint and make sure: (1) the blend parameter is the only scalar parameter within range 0 and 1 and, (2) set default as 0. You can refer to this discussion for further information.