# Shadows arent updated

**URL:** <https://discourse.threejs.org/t/shadows-arent-updated/19465>\
**Category:** Questions\
**Tags:** shadows\
**Created:** [October 6, 2020, 9:21am UTC](https://discourse.threejs.org/t/shadows-arent-updated/19465 "2020-10-06T09:21:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [October 6, 2020, 9:21am UTC](https://discourse.threejs.org/t/shadows-arent-updated/19465/1 "2020-10-06T09:21:33Z")

</div>

Hey, im trying to include images of my scene to the print document for printing.  
Im making a scene and add lights once, replacing the model, taking a image of each one. I made a queue, that waits for each one to load, then renders and saves the image.  
My problem is that the first model looks fine, but the second has the shadow of the first model and does not have a shadow of its own. So the shadow is not updated. I tried to update everything in my scene like so

```
  this.camera.updateProjectionMatrix();

  this.directionalLight.updateMatrix()
  this.pointLight.updateMatrix()

  this.directionalLight.shadow.camera.updateProjectionMatrix();
  this.pointLight.shadow.camera.updateProjectionMatrix();
  
  this.scene.traverse(o => o.updateMatrix())

  this.imageRenderer.setSize(thumbWidth, thumbHeight)
  this.imageRenderer.setPixelRatio(window.devicePixelRatio)

  // Render
  this.imageRenderer.render(this.scene, this.camera)

  // Saving

```

How do I update my shadows?

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [October 6, 2020, 11:33am UTC](https://discourse.threejs.org/t/shadows-arent-updated/19465/2 "2020-10-06T11:33:41Z")

</div>

> [@Fluqz](#):
>
> So the shadow is not updated

I may be wrong, but that’s kinda totally not possible. They update automatically on render (unless these are baked shadows.) 😅

Shadow of the first model is still there probably because the first model is still there (looking at the screenshots, that’s seems true.) The second model may not have `castShadow` enabled - but it’s hard to tell from that part of code.

---

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [October 6, 2020, 3:41pm UTC](https://discourse.threejs.org/t/shadows-arent-updated/19465/3 "2020-10-06T15:41:47Z")

</div>

Okay you’re right. I guess the callbacks that were called when finished loading we’re not right. Cant really figure out how it happened exactly, but I got it working by creating a new scene, camera, renderer, each time. Have to fix the callbacks first till I can say more.  
Thanks!
