title: Three.js light is not static
body: <p>I need to create static light (invariant to move of camera) and i need to get actual position of light in fragment shader.</p>
  
  <p>What i am doing now :</p>
  
  <pre><code>        scene = new THREE.Scene();
          camera = new THREE.PerspectiveCamera(60, canvas.width() / canvas.height(), 1, 10000);
          camera.position.z = 2000;
          camera.lookAt(0, 0, 0);
  
          var light = new THREE.SpotLight(0xFFFFFF, 1);
          light.position.set(0.5, 0.5, 0.1).normalize();
          camera.add(light);
  
          ....
  
          var lambertShader = THREE.ShaderLib['lambert'];
          uniformsVolume = THREE.UniformsUtils.clone(lambertShader.uniforms);
  
          ....
  
          materialVolumeRendering = new THREE.ShaderMaterial({
              uniforms: uniformsVolume,
              vertexColors: THREE.VertexColors,
              vertexShader: vertVolumeRendering,
              fragmentShader: fragVolumeRendering,
              vertexColors: THREE.VertexColors,
              lights :true
          });
  
          ....
          scene.add(camera);
  </code></pre>
  
  <p>Than in fragment shader i set uniform variable:</p>
  
  <pre><code>uniform vec3 spotLightPosition;
  </code></pre>
  
  <p>and compute light for voxel:</p>
  
  <pre><code>float dProd = max(0.0, dot(getGradient(posInCube), normalize(lightPos
  - posInCube)));             
  voxelColored.rgb = voxelColored.rgb * dProd + voxelColored.rgb * 0.2;
  </code></pre>
  
  <p>Problem is, that it doesnt work correctly. My idea is, that i will moving with object (in reality with camera). Light will shine still from the same side (will be static in scene). At this time light is not static and work very strange.</p>
  
  <p>Any idea?
  Somebody please...</p>
  
  <p>Tanks a lot.
  Tomáš</p>