# THREE.UniformsLib\['lights'\] gives wrong light position?

**URL:** <https://discourse.threejs.org/t/three-uniformslib-lights-gives-wrong-light-position/36672>\
**Category:** Questions\
**Tags:** lights, uniforms, materials, shaders\
**Created:** [April 3, 2022, 10:17am UTC](https://discourse.threejs.org/t/three-uniformslib-lights-gives-wrong-light-position/36672 "2022-04-03T10:17:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brainafic](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/brainafic/32/25377_2.png) [@Brainafic](https://discourse.threejs.org/u/Brainafic)\
**Post date:** [April 3, 2022, 10:17am UTC](https://discourse.threejs.org/t/three-uniformslib-lights-gives-wrong-light-position/36672/1 "2022-04-03T10:17:51Z")

</div>

Hi!

I’m working on a shader that will take scene light data and use it to make light calculations in the shader.  
To pass the light data from the scene to the uniforms I am using:

```javascript
var u = THREE.UniformsUtils.merge(
    [
        THREE.UniformsLib['lights'],
        {
            flipUv1: { type: 'bool', value: 0 },
            flipUv2: { type: 'bool', value: 1 },
        }
    ])

```

And I have a single spotlight in my scene:

```javascript
const spotLight = new THREE.SpotLight({
    color: 'white',
    intensity: 1,
    distance: 5,
    penumbra: 1,
    decay: 0,
})
spotLight.position.set(-5, 5, 5)
scene.add(spotLight)

```

The problem is that if I console.log(spotLight) I get this position:

```javascript
position: Vector3 {x: -5, y: 5, z: 5}

```

But when I console.log(THREE.UniformsLib[‘lights’]), what I get in the position for that same light is completely different, and color is Pi?:

```javascript
color: Color {r: 3.141592653589793, g: 3.141592653589793, b: 3.141592653589793}
coneCos: 0.5000000000000001
decay: 1
direction: Vector3 {x: 0.8164965809277259, y: 0.4714045207910315, z: 0.3333333333333334}
distance: 0
penumbraCos: 0.5000000000000001
position: Vector3 {x: 7.071067811865478, y: 4.08248290463863, z: -2.3094010767585025}

```

I am a bit confused, is this expected behavior? Or am I doing something wrong?  
Thank you!
