# .castShadow = true; is not working

**URL:** https://discourse.threejs.org/t/castshadow-true-is-not-working/15078
**Category:** Questions
**Tags:** shadows
**Created:** [May 11, 2020, 7:40am UTC](https://discourse.threejs.org/t/castshadow-true-is-not-working/15078 "2020-05-11T07:40:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Victor\_M\_Barba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/victor_m_barba/32/10693_2.png) [@Victor\_M\_Barba](https://discourse.threejs.org/u/Victor_M_Barba)
#### Post date: [May 11, 2020, 7:40am UTC](https://discourse.threejs.org/t/castshadow-true-is-not-working/15078/1 "2020-05-11T07:40:25Z")

</div>

Hello: I have two files…  
WORKING with shadows… : [http://songnes.com/g/g60.html](http://songnes.com/g/g60.html)  
NOW WORKING, No Shadows… : [http://songnes.com/g/g63.html](http://songnes.com/g/g63.html)

both of them have this code:

object.castShadow = true;  
object.receiveShadow = true;

I have the light… I think it might be with the settings in the light!

const light = new THREE.SpotLight( 0xffffff, 1.5 );  
light.position.set( 0, 100, 100 );  
light.angle = Math.PI / 9;

light.castShadow = true;  
light.shadow.camera.near = 1000;  
light.shadow.camera.far = 4000;  
light.shadow.mapSize.width = 1024;  
light.shadow.mapSize.height = 1024;

can someone help me understand the far, or near, or mapSize, or the Position, or light.angle = Math.PI / 9;… you can see both full code in the “view source” of the web-page

Thank you for all your help…

---

<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: [May 11, 2020, 8:50am UTC](https://discourse.threejs.org/t/castshadow-true-is-not-working/15078/2 "2020-05-11T08:50:21Z")

</div>

In the second demo, you are using `MeshNormalMaterial` which is an unlit material. Hence, it does not receive any shadows.

---

<div class="post-metadata">

### Author: ![Victor\_M\_Barba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/victor_m_barba/32/10693_2.png) [@Victor\_M\_Barba](https://discourse.threejs.org/u/Victor_M_Barba)
#### Post date: [May 11, 2020, 7:10pm UTC](https://discourse.threejs.org/t/castshadow-true-is-not-working/15078/3 "2020-05-11T19:10:01Z")

</div>

Thanks for that, little things that I’m learning.  
I change the code, I put Lambert Material, and Phong material… see this:  
[http://songnes.com/g/g63.html](http://songnes.com/g/g63.html)  
and still no shadow… see full source code in web-page…  
I think it might be the numbers on the light…maybe
