Download

Dynamic DoF(Depth of Field) - Blueprint

Hey everyone,

After the discussion on Lordink’s question here i managed to get a dynamic DoF system working using the blueprint FPS template.

Here’s the end result;

You can see the collapsed nodes and the macro together with the rest of the BP in full res. here;

-Blur type, scale, interp speed and trace distance depend on your project so you can set them as you like. You can also set the transition speed dynamically with a little more calculation. And you can increase/decrease Near and Far Transition Region by adding/subtracting whatever value you want to focus distance.

-You need to set Max Bokeh Size inside the blueprint(Make PostProcess Settings node), otherwise it uses the default value even if you set it in the camera component’s options for some reason.

Wiki post for more detailed explanation:

Let me know if there is anything else that can be added or changed and hope you find it useful!

That’s so cool! Nice work dude. Thank’s for sharing :slight_smile:

Glad you liked it!

I’ve updated the main post with the Wiki page if anyone wants a more detailed explanation of what is what.

Awesome stuff man! Thanks alot!

The last node has a ‘set’ for the post processing which also has a target input. How do you go about getting this node?
I can make a struct but there isn’t the extra light blue input to attach my camera/capture2D to.

Thanks.

Drag from the camera variable and just type set post:

Awesome stuff Jacky!

:slight_smile:

Rama

Very nice Jacky. :slight_smile:

Thanks guys!
(Even though my stuff can never be as awesome as Rama’s plug ins. :D)

Make/Break Post Process Settings nodes are the weirdest nodes in the engine right now. You need to disable the bools for every property(especially Blendables) and enable only those you need if you want to work with them easily.

Copy those and paste(ctrl + V) in the blueprint, and you’ll have post process settings nodes with every property disabled. Then enable only the ones you need and you shouldnt get any errors.

Great work Jacky :slight_smile: :cool:

Jacky.

Nice tutorial.

One step is overkill I think.

You have a macro to do some math to get the distance between 2 vectors.
There’s a node call get length. It works on vector. Just subtract location of actor from focus location and get the length of that output.

It works for me that way :slight_smile:

Thanks for the tutorial.

Thanks for the heads up, Rasped!

I actually found out about that later on. I should add that to the wiki page.

Hello friend, I really want to know if there is any way to make the UE 4.2 because the PostProcessSettings node it is very different, has only the Boolean options and you can not convert :confused:

Hey JHanziwest,

I already answered you at AnswerHub. As i said, it is working for me in 4.2 as well so i’m not sure what the problem is with your node. Sorry. :\

Hello, thank you for this instructions. I have a question: as I would like to have on focus the aimed object, is it possible to get the same result of the video automatically, without clicking the right mouse button?
Thank you in advance

Of course. Just remove the mouse button input and the Gate, like so:

40a23940a885a3be87ece7ab94583bfe9d7c360a.jpeg

Thank you so much for your quick reply!

Very interesting thank you Jacky

It would be really cool to see this effect in games (or at least more often if it already is.)