three.jsshadows

Moving shadows in Three.JS


Is there a way to dynamically change the 'position' of the light which casts the shadow. I only want an area around the player casted with shadows, and not the whole map.


Solution

  • Can be done by moving the shadowCameraTop/Right/Bottom/Left and then updating the projection matrix, or setting the position of the light itself