Shadow from object to ground not working


I can’t manage to display shadow on the planeMesh from the antenna I created. The antenna has shadows but it isn’t casted to the ground, I checked everything and I can’t find the solution.

Here’s my source code, thanks for helping :

Have a nice day!


Add this:

renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;

and change some values for your shadow camera and light source:

const sun = new THREE.DirectionalLight(0xffffff, 4);
sun.position.set(-50, 75, -50); // lesser values
sun.castShadow = true; = 0.1; = 150; // greater value

The result:

PS Next time try to use CameraHelper for to see, if objects are inside shadow camera’s frustum.

1 Like

Thank you, I also found that for larger maps :

Your solution works on the codepen but when I implement it to my real project it doesn’t render well, even after trying changing x y z of the light or the far value:

Like OrthographicCamera, has left, right, top and bottom properties.