Download

Hazy Vision

I would like to create a hazy vision effect on the first person camera, which could be used to simulate the effects of the character being drunk, drugged or concussed or something similar.

I think I want a class blueprint that can be activated in the level blueprint which will change the post processing effects on the first person camera. I’m not sure on the best way to do this and how.

Do I need to create a Player Controller class blueprint that will communicate with the “MyCharacter” Blueprint? In the Class Blueprint I’m creating I take it I need to use the “Make PostProcessSettings” node to change the depth of field to create the blurred vision? What nodes should I be using to set the values on the settings I want? Do I use object variable or casting to communicate between these different blueprints and how does the flow structure to connect between the post processing node and the first person camera component?

Any help on getting me started in the right direction would be greatly appreciated.

Try taking a look at this:

You don’t necessarily need Post Process Materials, a simple Post Process Volume that you activate and deactivate (or fade) using Blueprint should do the trick:

To create a blurred vision effect I used a negative depth of field on my post processing component (attached to the player camera), and then use scale to change the amount of blur.

Here’s the code for anyone who stumbles along here:
[variable: UPostProcessComponent *CameraPostProcessComponent]

CameraPostProcessComponent->Settings.bOverride_DepthOfFieldScale = true;
CameraPostProcessComponent->Settings.bOverride_DepthOfFieldMethod = true;
CameraPostProcessComponent->Settings.bOverride_DepthOfFieldFocalDistance = true;

CameraPostProcessComponent->Settings.DepthOfFieldMethod = EDepthOfFieldMethod::DOFM_BokehDOF;
CameraPostProcessComponent->Settings.DepthOfFieldFocalDistance = -100.f; //basically make everything blurry so focus behind the camera
CameraPostProcessComponent->Settings.DepthOfFieldScale = 0.2f; //I found a scale 0.2 in my game was a good amount for a maximum blur