# Particle and DepthofFiled

**URL:** https://forum.babylonjs.com/t/particle-and-depthoffiled/4585
**Category:** Questions
**Created:** [July 18, 2019, 1:17pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585 "2019-07-18T13:17:44Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)
#### Post date: [July 18, 2019, 1:17pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/1 "2019-07-18T13:17:44Z")

</div>

Is it possible to have a depth of field effect using particleSystem only?

I tried to play with depthoffiled parameters but particles are either all blurry or all clear but it never depends on their position in the world.

Here is a playground which shows the problem: [https://www.babylonjs-playground.com/#49XARW#3](https://www.babylonjs-playground.com/#49XARW#3)  
See line 60 to play with the depthoffield parameters.

However the motion blur effect is working as you can see in the example.

Thanks

---

<div class="post-metadata">

### Author: ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)
#### Post date: [July 18, 2019, 2:45pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/2 "2019-07-18T14:45:19Z")

</div>

pinging @sebavan

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [July 18, 2019, 3:21pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/3 "2019-07-18T15:21:33Z")

</div>

I ll have a look ASAP

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [July 18, 2019, 4:40pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/4 "2019-07-18T16:40:56Z")

</div>

The DOF effect uses the depth renderer which can not render particles to it due to ordering and transparency issue. It is then not possible to use with particles.

---

<div class="post-metadata">

### Author: ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)
#### Post date: [July 18, 2019, 8:06pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/5 "2019-07-18T20:06:08Z")

</div>

Hum, not possible at all? (It doesn’t sound BabylonJS to me 😄)

The goal would be to have this kind of particle effect: [blur particle - Google Search](https://www.google.com/search?q=blur+particle&rlz=1C1CHBF_frFR797FR797&tbm=isch&source=iu&ictx=1&fir=5aXmh54CwMJc4M%253A%252CGJkiKrWouYg3kM%252C_&vet=1&usg=AI4_-kRPENx4sA5sAMcl8s4ACMsASbHlLw&sa=X&ved=2ahUKEwjE6qHSob_jAhVaD2MBHU7MBtQQ9QEwAHoECAcQBg#imgrc=ejGzdjNTrxxUCM:&vet=1)

Admit that it would be awesome!

---

<div class="post-metadata">

### Author: ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)
#### Post date: [July 18, 2019, 9:43pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/6 "2019-07-18T21:43:13Z")

</div>

Nope this is just incompatible as depth of field needs depth and particles as no depth value stored

---

<div class="post-metadata">

### Author: ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)
#### Post date: [July 18, 2019, 9:50pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/7 "2019-07-18T21:50:50Z")

</div>

Ok thanks for the clarification. No possibilities to maybe add those depth value on particles?

And same issue with the solid particle I guess?: [https://www.babylonjs-playground.com/#2FPT1A#301](https://www.babylonjs-playground.com/#2FPT1A#301)

---

<div class="post-metadata">

### Author: ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)
#### Post date: [July 18, 2019, 10:16pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/8 "2019-07-18T22:16:21Z")

</div>

nope solid particles should work  
We do not add particles to depth buffer because it is what we should do not because we do not want. This is how particles work

---

<div class="post-metadata">

### Author: ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)
#### Post date: [July 18, 2019, 10:43pm UTC](https://forum.babylonjs.com/t/particle-and-depthoffiled/4585/9 "2019-07-18T22:43:18Z")

</div>

Indeed it works with solid particle: [https://www.babylonjs-playground.com/#2FPT1A#302](https://www.babylonjs-playground.com/#2FPT1A#302)

So I guess if we want blur and particle we have to use solid particle! 😉
