# For Spotlight. What is the correct way to update the near/far clip planes

**URL:** <https://discourse.threejs.org/t/for-spotlight-what-is-the-correct-way-to-update-the-near-far-clip-planes/6976>\
**Category:** Questions\
**Tags:** spotlight\
**Created:** [April 8, 2019, 8:42pm UTC](https://discourse.threejs.org/t/for-spotlight-what-is-the-correct-way-to-update-the-near-far-clip-planes/6976 "2019-04-08T20:42:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dugla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dugla/32/4044_2.png) [@dugla](https://discourse.threejs.org/u/dugla)\
**Post date:** [April 8, 2019, 8:42pm UTC](https://discourse.threejs.org/t/for-spotlight-what-is-the-correct-way-to-update-the-near-far-clip-planes/6976/1 "2019-04-08T20:42:29Z")

</div>

For potLight, there does not appear to be anyway to update the near/far clip planes.

My code.  
A class that wraps SpotLight and DropShadow functionality:

> <https://gist.github.com/turner/5db8957fe0a3daa927b6fcf073517b71>

The relevant portion of my app that updates near/far:

> <https://gist.github.com/turner/443e44feb30077d566f71811e531b3f2>

Thanks.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [April 9, 2019, 9:38am UTC](https://discourse.threejs.org/t/for-spotlight-what-is-the-correct-way-to-update-the-near-far-clip-planes/6976/2 "2019-04-09T09:38:47Z")

</div>

The projection matrix of the shadow camera is automatically computed by the renderer. It’s sufficient to just update the values.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [April 9, 2019, 9:43am UTC](https://discourse.threejs.org/t/for-spotlight-what-is-the-correct-way-to-update-the-near-far-clip-planes/6976/3 "2019-04-09T09:43:54Z")

</div>

/cc

> <https://stackoverflow.com/questions/55574043/three-js-why-does-spotlight-not-allow-the-near-far-to-be-reset>

---

<div class="post-metadata">

**Author:** ![dugla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dugla/32/4044_2.png) [@dugla](https://discourse.threejs.org/u/dugla)\
**Post date:** [April 9, 2019, 1:14pm UTC](https://discourse.threejs.org/t/for-spotlight-what-is-the-correct-way-to-update-the-near-far-clip-planes/6976/4 "2019-04-09T13:14:06Z")

</div>

> [@dugla](#):
>
> show original

Oh, I like that! Brilliant! Perhaps it can be added as an example to a future release. Cheers.
