0
votes

I am facing a problem where a THREE.SpotLight is casting a Shadow without an object beeing in its frustum.

I have setup a simple scene containing a THREE.SpotLight and a plane-mesh. The SpotLight is set to cast Shadows and the plane to receive Shadows. There is a square Shadow visible on the ground plane, which is the size of the SpotLights shadowCamera. This scene is the right hand side of the image below.

A cube-mesh is now added and positioned outside the initial camera viewspace. By zooming out, a bit before the cube-mesh becomes visible to the camera, the Spotlight Shadow disappears. This is pictured in the left hand side of the image.

http://jsfiddle.net/L0rdzbej/157/

This happens in Firefox, from what I heared it is not the case in Chrome. What is happening here and how to avoid it?

enter image description here

1
Does the problem go away if you call box.updateMatrixWorld() after you set the box's position? - WestLangley
No: jsfiddle.net/L0rdzbej/158. The box is not the problem, when adding any object (SpotLight-Helper for example) the Shadow is gone too. - Falk Thiele
My conjecture is you are seeing the shadow of the box. Can you change the box to a sphere and try it? - WestLangley
The Shadow is independent from the box, it is always there even when no other mesh is in the scene (except the ground plane). The box is just there as an example mesh, it isnt even set to cast a Shadow. However, this is the same scene with a SphereGeometry: jsfiddle.net/L0rdzbej/159 - Falk Thiele
Can you try the dev branch? - WestLangley

1 Answers

-1
votes

The shadow does not show up anymore, so im marking this as solved.

Edit: In case anyone comes a long who is facing the same problem, here is a link to the reported issue on github: https://github.com/mrdoob/three.js/issues/7750. It hasnt got much attention because it couldnt be reproduced by the maintainers.