# frustumEdgeFalloff with cascaded shadow not work

**URL:** <https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419>\
**Category:** Bugs\
**Tags:** shadows\
**Created:** [March 1, 2024, 6:24am UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419 "2024-03-01T06:24:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeyKo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joeyko/32/38115_2.png) [@JoeyKo](https://forum.babylonjs.com/u/JoeyKo)\
**Post date:** [March 1, 2024, 6:24am UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419/1 "2024-03-01T06:24:29Z")

</div>

Hey, babylon.js forum guys.

In the demo, I create the cascaded shadow in the scene and set frustumEdgeFalloff. Then rotate the camera at certain angles, the shadow will disappear.

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

How to make the shadow consistent when rotate the camera or move the camera?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 1, 2024, 8:45am UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419/2 "2024-03-01T08:45:14Z")

</div>

cc @Evgeni_Popov

---

<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:** [March 1, 2024, 1:28pm UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419/3 "2024-03-01T13:28:26Z")

</div>

You must set a sensible `camera.maxZ` value for CSM to work as expected:

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

See:

[https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows\_csm#camera-far-plane](https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows_csm#camera-far-plane)

---

<div class="post-metadata">

**Author:** ![JoeyKo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joeyko/32/38115_2.png) [@JoeyKo](https://forum.babylonjs.com/u/JoeyKo)\
**Post date:** [March 4, 2024, 5:47am UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419/5 "2024-03-04T05:47:36Z")

</div>

Thx for you reply, set `frustumEdgeFalloff` then zoom in camera will cause the shadow flashing, seems affected by the camera radius, is that normal?

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

---

<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:** [March 4, 2024, 10:43am UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419/6 "2024-03-04T10:43:53Z")

</div>

Assigned @Evgeni\_Popov on March 4, 2024, 10:43am UTC



---

<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:** [March 4, 2024, 6:20pm UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419/7 "2024-03-04T18:20:15Z")

</div>

`frustumEdgeFalloff` is not supported for CSM, as it will apply to each cascade. By default, the shadows are clipped at `camera.maxZ`, but you can use the `csm.shadowMaxZ` property to clamp before this limit (without falloff, though).

---

<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:** [March 4, 2024, 6:20pm UTC](https://forum.babylonjs.com/t/frustumedgefalloff-with-cascaded-shadow-not-work/48419/8 "2024-03-04T18:20:17Z")

</div>

Unassigned @Evgeni\_Popov on March 4, 2024, 6:20pm UTC


