# Shadows in sandbox.babylonjs

**URL:** <https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211>\
**Category:** Questions\
**Created:** [October 27, 2020, 1:08pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211 "2020-10-27T13:08:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlenC](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@AlenC](https://forum.babylonjs.com/u/AlenC)\
**Post date:** [October 27, 2020, 1:08pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/1 "2020-10-27T13:08:18Z")

</div>

Hi,

I’ve been playing around with an object exported from 3ds max and I’d like to use real time shadows with it, but they don’t seem to work. Am I doing something wrong or maybe this can’t be done in sandbox?

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:** [October 27, 2020, 1:34pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/2 "2020-10-27T13:34:41Z")

</div>

Welcome aboard!

You should be able to use the sandbox to test shadows. Maybe you should provide the file you are testing with so that we can help more?

Note that you won’t get shadows just by loading the file: you must create a shadow generator for shadows to be generated. This is possible in the sandbox, on the light node (but the light must be a spot, point or directional light).

---

<div class="post-metadata">

**Author:** ![AlenC](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@AlenC](https://forum.babylonjs.com/u/AlenC)\
**Post date:** [October 27, 2020, 1:53pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/3 "2020-10-27T13:53:48Z")

</div>

Thanks for the wecome and the reply.

I added a directional light and a shadow generator on it, but nothing happens.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/c/c6f5ea588d7dba29452a86a09cec40553061b178.png)

I can’t share this model, but I can try creating a simple scene and share that if shadows continue not working.

Edit: here is a simple scene: [Dropbox - scene.babylon - Simplify your life](https://www.dropbox.com/s/5x39ob80rq7oret/scene.babylon?dl=0)

I loaded .glb exported from max and added a directional light, then exported the scene as babylon.

---

<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:** [October 27, 2020, 2:34pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/4 "2020-10-27T14:34:35Z")

</div>

Ok, got it.

That’s because the skybox mesh is also added in the list of the shadow casters when you create a shadow generator in the sandbox that you can’t see what happens, this mesh being very far from the scene.

This PR prevents the objects that are infinitely far (like the skybox) from being added to the shadow caster list:

> <https://github.com/BabylonJS/Babylon.js/pull/9285>

After this change, you will have to remove and recreate the shadow generator so that the sky is not in the shadow caster list anymore.

---

<div class="post-metadata">

**Author:** ![AlenC](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@AlenC](https://forum.babylonjs.com/u/AlenC)\
**Post date:** [October 27, 2020, 2:38pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/5 "2020-10-27T14:38:49Z")

</div>

Thank you very much!!

Just to understand correctly, when can I expect this change to take effect?

---

<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:** [October 27, 2020, 11:52pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/6 "2020-10-27T23:52:29Z")

</div>

It is live 🙂

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/e/ecbe6af9a690e1769ccdb51556463ac110d4461f.png)

---

<div class="post-metadata">

**Author:** ![AlenC](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@AlenC](https://forum.babylonjs.com/u/AlenC)\
**Post date:** [October 28, 2020, 5:50pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/7 "2020-10-28T17:50:06Z")

</div>

Hey, that’s amazingly fast, but I think I might be using an old version because shadows are still being cast by skybox. How can I verify the sandbox version I’m using?

---

<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:** [October 28, 2020, 7:52pm UTC](https://forum.babylonjs.com/t/shadows-in-sandbox-babylonjs/15211/8 "2020-10-28T19:52:50Z")

</div>

Are you using the online version of the sandbox? You need to use the latest preview version files.

You should look at the browser console:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/03e324e4a1bc4a098117684e7c2759039ccdb089.png)
