# Dynamic DoF(Depth of Field) - Blueprint

**URL:** <https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 17, 2014, 4:39pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561 "2014-05-17T16:39:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [May 17, 2014, 4:39pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/1 "2014-05-17T16:39:07Z")

</div>

Hey everyone,

After the discussion on Lordink’s question [here](https://answers.unrealengine.com/questions/27771/focus-based-dynamic-dof.html) i managed to get a dynamic DoF system working using the blueprint FPS template.

Here’s the end result;

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/3/5/235ff052d70a50cdc0767be912cc08aa5c0d3730.jpeg "Dynamic DoF - UE4") ](https://www.youtube.com/watch?v=rEargI8dNFk)

 ![DoF_1.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/6/b6338b04b90fec9b59ac7b3f162d39e42e91528f.jpeg)

 ![DoF_2.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/e/dea73eb17c1e0db5d8650d90314e17144e346008.jpeg)

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

> **[Dynamic\_DoF](https://www.dropbox.com/sh/m0vjmtwqd16ylwa/AABHxm9heePiGUAgeshtkP7fa#/)**
>
> Shared with Dropbox

-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:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

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

---

<div class="post-metadata">

**Author:** ![Benjam901](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Benjam901](https://forums.unrealengine.com/u/Benjam901)\
**Post date:** [May 18, 2014, 3:08pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/2 "2014-05-18T15:08:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [May 19, 2014, 5:03am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/3 "2014-05-19T05:03:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TheOneWolf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheOneWolf](https://forums.unrealengine.com/u/TheOneWolf)\
**Post date:** [May 19, 2014, 7:36am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/4 "2014-05-19T07:36:25Z")

</div>

Awesome stuff man! Thanks alot!

---

<div class="post-metadata">

**Author:** ![GraphicsMode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GraphicsMode](https://forums.unrealengine.com/u/GraphicsMode)\
**Post date:** [May 19, 2014, 1:36pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/5 "2014-05-19T13:36:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [May 19, 2014, 1:59pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/6 "2014-05-19T13:59:42Z")

</div>

> [@GraphicsMode;52381](#):
>
> 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:

 ![set_postproc.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/c/4c067e65cdcd1fed2bb123088ef88fc13011c110.jpeg)

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 19, 2014, 8:44pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/7 "2014-05-19T20:44:47Z")

</div>

Awesome stuff !

🙂

---

<div class="post-metadata">

**Author:** ![ryanjon2040](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ryanjon2040/32/906587_2.png) [@ryanjon2040](https://forums.unrealengine.com/u/ryanjon2040)\
**Post date:** [May 20, 2014, 6:44am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/8 "2014-05-20T06:44:29Z")

</div>

Very nice . 🙂

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [May 20, 2014, 1:08pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/9 "2014-05-20T13:08:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [May 20, 2014, 2:17pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/11 "2014-05-20T14:17:18Z")

</div>

> [@Samsterdam;53620](#):
>
> When I try and compile the MyCharacter blueprint with the Make Post Process Settings node get the following error…
> 
> Error Default value ‘’ for Blendables is invalid: ‘Literal values are not allowed for array parameters. Use a Make Array node instead’
> 
> Any ideas why?

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.

https://.unrealengine.com/showthread.php?5938-PostProccessSettings-node-is-too-\*\*\*\*-long-!&p=45395&viewfull=1#post45395

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.

---

<div class="post-metadata">

**Author:** ![LexLuthor1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LexLuthor1](https://forums.unrealengine.com/u/LexLuthor1)\
**Post date:** [May 21, 2014, 1:28am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/12 "2014-05-21T01:28:28Z")

</div>

Great work 🙂 🆒

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [June 23, 2014, 12:59pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/13 "2014-06-23T12:59:17Z")

</div>

Thanks for the heads up, !

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

---

<div class="post-metadata">

**Author:** ![JHanziwest](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JHanziwest](https://forums.unrealengine.com/u/JHanziwest)\
**Post date:** [July 9, 2014, 12:23am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/14 "2014-07-09T00:23:57Z")

</div>

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 😕

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [July 9, 2014, 12:38am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/15 "2014-07-09T00:38:44Z")

</div>

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. :\

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a85a598b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a85a598b](https://forums.unrealengine.com/u/anonymous_user_a85a598b)\
**Post date:** [November 19, 2014, 11:18am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/16 "2014-11-19T11:18:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [November 19, 2014, 3:13pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/17 "2014-11-19T15:13:03Z")

</div>

> [@master2014;181310](#):
>
> 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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/a/40a23940a885a3be87ece7ab94583bfe9d7c360a.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a85a598b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a85a598b](https://forums.unrealengine.com/u/anonymous_user_a85a598b)\
**Post date:** [November 19, 2014, 3:33pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/18 "2014-11-19T15:33:38Z")

</div>

> [@;181400](#):
>
> Of course. Just remove the mouse button input and the Gate, like so:
> 
> ![40a23940a885a3be87ece7ab94583bfe9d7c360a.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/a/40a23940a885a3be87ece7ab94583bfe9d7c360a.jpeg)

Thank you so much for your quick reply!

---

<div class="post-metadata">

**Author:** ![ChrisTm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChrisTm](https://forums.unrealengine.com/u/ChrisTm)\
**Post date:** [November 19, 2014, 5:07pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/19 "2014-11-19T17:07:00Z")

</div>

Very interesting thank you

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcdd396d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcdd396d](https://forums.unrealengine.com/u/anonymous_user_bcdd396d)\
**Post date:** [November 20, 2014, 6:29pm UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/20 "2014-11-20T18:29:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hippowombat](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hippowombat/32/906590_2.png) [@hippowombat](https://forums.unrealengine.com/u/hippowombat)\
**Post date:** [March 31, 2015, 12:51am UTC](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561/21 "2015-03-31T00:51:00Z")

</div>

What are these nodes/how do I find them?

[![](https://i.imgur.com/2FCjAU8.png) ](https://i.imgur.com/2FCjAU8.png)

[Next page](https://forums.unrealengine.com/t/dynamic-dof-depth-of-field-blueprint/4561.md?page=2)
