# \`ClusteredLightContainer.maxRange\` does not work for some lights

**URL:** <https://forum.babylonjs.com/t/clusteredlightcontainer-maxrange-does-not-work-for-some-lights/63287>\
**Category:** Bugs\
**Created:** [April 28, 2026, 12:29pm UTC](https://forum.babylonjs.com/t/clusteredlightcontainer-maxrange-does-not-work-for-some-lights/63287 "2026-04-28T12:29:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![syuilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syuilo/32/49788_2.png) [@syuilo](https://forum.babylonjs.com/u/syuilo)\
**Post date:** [April 28, 2026, 12:29pm UTC](https://forum.babylonjs.com/t/clusteredlightcontainer-maxrange-does-not-work-for-some-lights/63287/1 "2026-04-28T12:29:47Z")

</div>

For more details, please see the repro.

repro: [https://playground.babylonjs.com/#CSCJO2#93](https://playground.babylonjs.com/#CSCJO2#93)

In this pg, the `maxRange` of `clustered` is set to `0.1`.  
Additionally, the `range` of each `pointLight` is set to `5`.  
Now, if you look at the rendered scene, you’ll notice that while most `pointLight`s have their range correctly clamped to 0.1, a few lights ignore this range and illuminate a wider area.

Thank you for maintaining this great framework!

---

<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:** [April 28, 2026, 5:55pm UTC](https://forum.babylonjs.com/t/clusteredlightcontainer-maxrange-does-not-work-for-some-lights/63287/2 "2026-04-28T17:55:37Z")

</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:** [April 29, 2026, 8:12am UTC](https://forum.babylonjs.com/t/clusteredlightcontainer-maxrange-does-not-work-for-some-lights/63287/3 "2026-04-29T08:12:07Z")

</div>

Confirmed bug — thanks for the great repro! The clustered container’s `addLight()` was leaving the child light in each mesh’s per-mesh light list (`mesh.lightSources`) when it had been constructed with `dontAddToScene = true` (which happens when `addLight()` is the only thing that ever puts the light into the scene). The PBR shader then picked it up as a regular point light, bypassing the cluster entirely and ignoring `maxRange`. Because PBR materials default to `maxSimultaneousLights = 4`, only the first few lights showed the issue — which matches what you saw (“most lights are clamped, a few aren’t”).

Fix is up: [Fix ClusteredLightContainer.maxRange ignored for some lights by Popov72 · Pull Request #18395 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/18395)

---

<div class="post-metadata">

**Author:** ![syuilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syuilo/32/49788_2.png) [@syuilo](https://forum.babylonjs.com/u/syuilo)\
**Post date:** [April 29, 2026, 8:19am UTC](https://forum.babylonjs.com/t/clusteredlightcontainer-maxrange-does-not-work-for-some-lights/63287/4 "2026-04-29T08:19:36Z")

</div>

Thank you so much!  
I’m looking forward to the release!
