# AOV DOF Comp
It will never be perfect as it is doing inpainting when you FG is blured
### Zdefocus
- I usually don't render DOF inside a render engine, except Unreal. To heavy to render for not enough control
- From the Depth AOV --> Layer contact sheet to display
- ~~(OPIONNAL) Display Depth + Grade from 0 to 1 :~~
- ![[file-20241001134309994.png]]
ZDEFOCUS PARAMETERS :
**USE REFERENCE**
- Math = Arnold : **far = 0**
- Link **size and maximum** together
- Output type to see the **focal distance**
- Size = amount of focus at infinity
### Pxf_Zdefocus
- Better because you can use Lens simulation ! so you don't have to guess the size of blur.
- Custom Bokeh
- **Depth Layer** : 256 Max in case of strong depth
- **ALIASING** FIX :
- 1. **Prefer render Layer**
- 2. **Erode fast node** in -1 + **Edge Detect on Depth pass, clamp + Blur** and make an other Blur after the defocus and put everything in the mask of the Blur
- ![[file-20241002104138253.png]]
- before : ![[file-20241002102830319.png]]
- After : ![[file-20241002103017615.png]]