# Animate DOF in DefaultRenderingPipeline

**URL:** <https://forum.babylonjs.com/t/animate-dof-in-defaultrenderingpipeline/60568>\
**Category:** Questions\
**Tags:** postprocessing\
**Created:** [September 19, 2025, 4:38am UTC](https://forum.babylonjs.com/t/animate-dof-in-defaultrenderingpipeline/60568 "2025-09-19T04:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fab](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fab](https://forum.babylonjs.com/u/fab)\
**Post date:** [September 19, 2025, 4:38am UTC](https://forum.babylonjs.com/t/animate-dof-in-defaultrenderingpipeline/60568/1 "2025-09-19T04:38:04Z")

</div>

Dear BJSforum,

i have a scene, where i have an invisible player, being followed by a followcam to different positions. I want to animate the DOF values (fStop, LensSize and focallength), but i couldn’t figure out, how…?

I set up my DOF via this.pipe = new BABYLON.DefaultRenderingPipeline and then setting depthOfFieldEnabled to true.

when logging this.pipe or this.pipe.depthOfField i couldn’t find the values either…

DefaultRenderingPipeline has an animations property, so i guess it’s (somehow:) possible, i just couldn’t find any expanation on how in the forum or the documentation.

when trying to animate fstop on this.pipe or this.pipe.depthOfField ( new BABYLON.Animation(“animDof”, ‘fstop’, 30, BABYLON.Animation.ANIMATIONTYPE\_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE\_CONSTANT); )

i get the error: “Uncaught Error: Invalid property (fstop) in property path (fstop)”

So: what are the valid properties to animate this values? can someone please help me or send me in the right direction?

Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 19, 2025, 10:50am UTC](https://forum.babylonjs.com/t/animate-dof-in-defaultrenderingpipeline/60568/2 "2025-09-19T10:50:45Z")

</div>

You can see how this works in this PG:

> **[Babylon.js Playground](https://playground.babylonjs.com/#Y3C0HQ%23146)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

**Author:** ![fab](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fab](https://forum.babylonjs.com/u/fab)\
**Post date:** [September 19, 2025, 5:17pm UTC](https://forum.babylonjs.com/t/animate-dof-in-defaultrenderingpipeline/60568/3 "2025-09-19T17:17:55Z")

</div>

Hey Evgeni,

thanks for your reply! 🙂 I think you misunderstood me though. I have no problem setting the DOF values, this works fine! I want to animate them, and I don’t know how? 🙂

I thought about setting the DOF values via scene.registerBeforeRender, while animating the cameraposition, but there has to be a more elegant way?!

---

<div class="post-metadata">

**Author:** ![fab](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fab](https://forum.babylonjs.com/u/fab)\
**Post date:** [September 19, 2025, 6:45pm UTC](https://forum.babylonjs.com/t/animate-dof-in-defaultrenderingpipeline/60568/4 "2025-09-19T18:45:09Z")

</div>

figured it out. for anybody coming here in the future: fstop != fStop 😉
