# Depth of Field (DoF)

**URL:** <https://forum.defold.com/t/depth-of-field-dof/81995>\
**Category:** The Defoldmine\
**Created:** [November 23, 2025, 7:42am UTC](https://forum.defold.com/t/depth-of-field-dof/81995 "2025-11-23T07:42:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![selimanac](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/selimanac/32/6397_2.png) [@selimanac](https://forum.defold.com/u/selimanac)\
**Post date:** [November 23, 2025, 7:42am UTC](https://forum.defold.com/t/depth-of-field-dof/81995/1 "2025-11-23T07:42:58Z")

</div>

Developed as a part of the [Tiny Worlds Challenge](https://forum.defold.com/t/community-challenge-tiny-worlds/81931) project.

This implementation is based on [David Lettier](https://github.com/lettier?tab=repositories)’s [Depth Of Field](https://lettier.github.io/3d-game-shaders-for-beginners/depth-of-field.html), but it uses the depth buffer instead of vertex positions and provides a Gaussian blur, which is relatively faster than a box blur.

See it in action (The textures are large, it may take some time to load)

- Click left mouse button to focus
- Hold right mouse button to rotate
- 1 -2- 3 keys to change the mode (1- Depth-only, 2- Radial hybrid, 3- Circular region)
- Mouse wheel to zoom

> **[Defold 3D Depth of Field (DoF) 1.0](https://selimanac.github.io/defold-depth-of-field/)**

[![](https://img.youtube.com/vi/j4Cie_BjMv4/maxresdefault.jpg "dof2") ](https://www.youtube.com/watch?v=j4Cie_BjMv4)

> **[GitHub - selimanac/defold-depth-of-field](https://github.com/selimanac/defold-depth-of-field)**
>
> Contribute to selimanac/defold-depth-of-field development by creating an account on GitHub.
