Question about lighting

I am quite confused by the behaviour of spotlight in my project. I have spotlight that is positioned exactly in the middle of two planes. What is weird is that it lights only one of the planes and it fails to light or lights improperly the plane on the other side. I have provided three images to show them in action

The first image is to show how the spotlight is positioned with respect to the two planes in question

The second image shows how well and naturally the plane is litup by the spotlight.

The third image shows the other plane that is not lit up the same way as shown in the previous image.

Below are the settings and values of my spotlight shadow related properties

spotlight.castShadow = true;
spotlight.shadow.bias = -0.0005;
spotlight.shadow.normalBias = 0.05;

I tried unsetting the bias and normalBias to their default values and still the same problem can be seen but with artefacts, which is quite expected without those values for the shadow biases.

The plane that is well lighted without the bias values

The plane that still has improper lighting without the bias values

I am stuck and was wondering if any of the amigos can point me in the possible right direction of investigation.

Thank you and Regards,

Are these planes created via code or from a 3D model? If the second one - make sure normals on the planes are set properly.

1 Like

Yes they are created from the code and from the images the vertex normals ate visible(green lines). They are facing correctly.

I figured out the issue. Some walls not illuminated are caused by two things

1 - A wall with a negative normal e.g <0, 0, -1>
2 - Presence of a normal map

However, if I remove the normal map the wall with normal <0, 0, -1> illuminates just fine. But the normal value of <0, 0, -1> is not wrong either because it is the direction that side of the wall is facing. Anyone any ideas?


I solved the issue by setting the normalscale to <-1, -1> for the material applied on the object.


1 Like

I found a weird shadow with my spotlight. Is this type of shadow even possible with a spotlight? I was thinking somehow the helper is causing the shadows but I disabled the shadows on the helper and still this keeps happening. I think too much lights since the last 3 days. I need to take a break into darkness :joy::rofl::laughing:

The walls are set to cast and receive shadows. The floor is set to only recieve shadows. The wall material shadowSide is DoubleSide.

Spotlight Parameters:

angle = 50 degrees;
penumbra = 0.5;
power = 50 watts;
decay = 2;