In my simple scene, there is a single .dae mesh and a 7000*7000 plane underneath it. I want to illuminate the scene with a high SpotLight
to cast a shadow of the mesh on the ground. However, there seems to be an issue! No matter how high I position the SpotLight
, the plane remains unlit. Additionally, the mesh is only partially illuminated within a small square area.
You can observe the scenario here:
Whenever I move the mesh (a monster), the lighting becomes inconsistent.
This is how I set up the light:
// create a spotlight
self.spotLight = new THREE.SpotLight();
// set its position
self.spotLight.position.y = 1000; //I assume it needs to be elevated to illuminate everything
self.spotLight.position.x = 0; //(0, 0) are the spawn coordinates of the mesh and also the center of the plane
self.spotLight.position.z = 0;
self.spotLight.castShadow = true;
This is how the plane is constructed:
//The plane.
self.plane = new THREE.Mesh(new THREE.PlaneGeometry(self.groundSize, self.groundSize), new THREE.MeshLambertMaterial({color: 0x5C8A00}));
self.plane.receiveShadow = true;
self.plane.position.x = 0;
self.plane.position.y = -26;
self.plane.position.z = 0;
Furthermore, here is an image showing multiple PointLights
:
Despite adding more lights, the shadow still vanishes!
What am I doing incorrectly here? From what I know, light should spread uniformly in all directions! Another problem is that I'm having difficulty incorporating multiple SpotLights in the scene. The performance drastically declines when I do so – could this be planned? Perhaps due to enabling shadows on each one...
@Neil, you're experiencing the same issue in your code!