# Shadow not appearing

**URL:** <https://discourse.threejs.org/t/shadow-not-appearing/3793>\
**Category:** Questions\
**Tags:** shadows\
**Created:** [August 15, 2018, 9:58am UTC](https://discourse.threejs.org/t/shadow-not-appearing/3793 "2018-08-15T09:58:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Seabrook](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/james_seabrook/32/14190_2.png) [@James\_Seabrook](https://discourse.threejs.org/u/James_Seabrook)\
**Post date:** [August 15, 2018, 9:58am UTC](https://discourse.threejs.org/t/shadow-not-appearing/3793/1 "2018-08-15T09:58:03Z")

</div>

I’m completely new to three.js and have been following a tutorial in a book, trouble I have is that the book is behind the current release of Three.js and a lot has changed so I’m trying to keep up.

One thing I’m completely stuck on is shadows. I can not get them to show and not sure what I’m missing on this.

This is my light, when I added a camera helper I get an Error:

> THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The “position” attribute is likely to have NaN values.

However this error does not appear if I use `PointLight` instead of Directional, but I still don’t get any shadows

Here’s the code

```
            scene.add( new THREE.AmbientLight( 0xffffff, 0.3 ) ); // added under advice that it will show shadows.. it didn't
            var light = new THREE.DirectionalLight(0xf6e86d, 1);
            light.castShadow = true;
            light.shadowDarkness = 0.5;
            light.shadow.mapSize.Width = 2048;
            light.shadow.mapSize.Height = 2048;
            light.position.set(500, 1500, 1000);
            light.shadow.camera.far = 2500;
            light.shadow.camera.left = 1000;
            light.shadow.camera.right = 1000;
            light.shadow.camera.top = 1000;
            light.shadow.camera.bottom = 1000;
            
            scene.add(light);

            var helper = new THREE.CameraHelper(light.shadow.camera);
            scene.add(helper);

```

Any help or pointers in the right direction would be greatly appreciated. Feel like I’m falling down before I’ve even began.

---

<div class="post-metadata">

**Author:** ![TheJim01](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thejim01/32/2007_2.png) [@TheJim01](https://discourse.threejs.org/u/TheJim01)\
**Post date:** [August 15, 2018, 2:39pm UTC](https://discourse.threejs.org/t/shadow-not-appearing/3793/2 "2018-08-15T14:39:12Z")

</div>

When in doubt, look at the examples.

[https://threejs.org/examples/?q=shadow#webgl\_shadowmap\_pointlight](https://threejs.org/examples/?q=shadow#webgl_shadowmap_pointlight)

They provide live demos _and_ source code, so you can supplement the book’s information with up-to-date structures and techniques.
