const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(0, 2, 10);
some light classes support casting shadows, while some don’t, and it depends
on their physics. For instance, “Dynamic Light” is a light that gets emitted
in a specific direction.A common use case for this is to simulate daylight.
Since it’s a one-directional light, it can emit shadows.
The AmbientLight on the other hand is a light that globally illuminates all
objects in the scene equally. Since every spot in the scene receives the same
amount of light, AmbientLight can’t be used to cast shadows.