Pointlight's castShadow = true makes Objects invisible

Hey, I got a really weird behaviour. When I set the PointLight’s castShadow property to true, objects in the scene get invisible using the OrthographicCamera.

There is one button that triggers a lot of things. For example switching to orthographic camera, setting the lights from a config and rebuilding objects.
After clicking that button, the objects are invisible. I can still select them and so on, but they are not visible. I can avoid that behaviour by setting the PointLight.castShadow to false!

So thats where I stuck. Im pretty sure, that its not a bug from threejs, but rather a error on my side.

I was hoping someone could direct me a little bit. Could that have something to do with the environment map?

The models are glTF/glb models imported. Some have a texture, all of them get the environment map.

Thanks

Not enough information to diagnose this. It could be literally anything. Can you reproduce this in a glitch?

If not… I suggest trying the following things:

  1. Verify there are no errors/warnings in the console…

  2. downgrade to an older version of threejs like ~160 or so… see if the behavior changes…

  3. isolate the issue in a Minimum Possible Reproduction… like a cube or one of your affected models, and a pointlight… and post it here for us to look at.

  4. Check the materials on your meshes and ensure they are using standard THREEJS materials, and not ShaderMaterial or customized variants, as these most likely just won’t support shadowmapping, or interact with it differently than the current versions of threejs.

1 Like