# SpotLight - intensity parameter doesnt work

**URL:** <https://discourse.threejs.org/t/spotlight-intensity-parameter-doesnt-work/1660>\
**Category:** Questions\
**Tags:** lights\
**Created:** [January 21, 2018, 1:46pm UTC](https://discourse.threejs.org/t/spotlight-intensity-parameter-doesnt-work/1660 "2018-01-21T13:46:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andi\_e](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andi\_e](https://discourse.threejs.org/u/andi_e)\
**Post date:** [January 21, 2018, 1:46pm UTC](https://discourse.threejs.org/t/spotlight-intensity-parameter-doesnt-work/1660/1 "2018-01-21T13:46:54Z")

</div>

Hello,

I’m doing my first steps with three.js and I’m playing around with the following code:

```auto
   var scene = new THREE.Scene();
   var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);
   var renderer = new THREE.WebGLRenderer();
	
   renderer.setClearColor(0xEEEEEE);
   renderer.setSize(window.innerWidth, window.innerHeight);
   renderer.shadowMap.enabled=true;
   renderer.shadowMap.type=THREE.PCFSoftShadowMap;

   // Adding a plane (phong-material
   // Adding a cube (phong-material)
   // adding a sphere (phong material)

   var spotLight = new THREE.SpotLight({color: 0x800000, intensity:0.0} );
  
   spotLight.position.set( 40, 60, 10);
   spotLight.castShadow=true;      
   spotLight.shadow.mapSize.width=1024;
   spotLight.shadow.mapSize.height=1024;       
   scene.add( spotLight );

```

I get stuck with the intensity parameter. No matter what I try, it doesn’t have any effect on the scene.  
I have tried with this parameter stand alone or together with the color parameter.

Maybe the intensity have some effect when used with other parameters. But I can’t read anything in the documentation…

Maybe someone can help ?  
Thanks in advance!

Greetings,  
Andy

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [January 21, 2018, 1:53pm UTC](https://discourse.threejs.org/t/spotlight-intensity-parameter-doesnt-work/1660/2 "2018-01-21T13:53:57Z")

</div>

The constructor of [`THREE.SpotLight()`](https://github.com/mrdoob/three.js/blob/da2936540a48774b043a1e617bddbdce5102e417/src/lights/SpotLight.js#L9) takes several separated parameters, not an object with several properties.  
So, try

```
var spotLight = new THREE.SpotLight( 0x800000, 0.5 );

```

[https://jsfiddle.net/prisoner849/7ybfhjap/](https://jsfiddle.net/prisoner849/7ybfhjap/)

---

<div class="post-metadata">

**Author:** ![andi\_e](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andi\_e](https://discourse.threejs.org/u/andi_e)\
**Post date:** [January 21, 2018, 9:50pm UTC](https://discourse.threejs.org/t/spotlight-intensity-parameter-doesnt-work/1660/3 "2018-01-21T21:50:18Z")

</div>

Hi,

thank you, that helped.  
Guess I have to study javascript “a bit” to get the basics right.

Greetings,  
Andy

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [January 21, 2018, 11:46pm UTC](https://discourse.threejs.org/t/spotlight-intensity-parameter-doesnt-work/1660/4 "2018-01-21T23:46:51Z")

</div>

You’re welcome 🙂
