Shadows going through objects

3.6k views Asked by At

I'm new to Lighting in 3D. Just started working with Unity3D. I was creating a sample for myself to test shadows and there is a problem.

enter image description here

As you can see that i have created two simple walls with two cubes. Also I have setup a directional light. Let's go the backside of the walls to view the problem enter image description here

Technically the front wall should be blocking the shadow of the back wall. But it is not. I have painted a read line to show that where the shadow of front wall is overlapping the shadow of the other, meaning going all the was through the wall. Why is that happening. Help please...

2

There are 2 answers

1
gerrix paul delima On BEST ANSWER

set your shader to DIFFUSE. i have the same problem and solved this. my spotlight is passing thor

0
Theodor Solbjørg On

that is interesting indeed, i have used unity3d for 5 plus years and never seen or noticed this. however, this might seem like a weird request, could you set the ground and the two cubes to bumped diffuse and make sure the cubes are touching the ground.

Since the shader that is used might allow shadows to pass, secondly, could you go to player settings and check if you are using forward of differed rendering, since their lighting techniques are very different they might have different results.

but all in all, best guess is that the shader you are using allows shadows to pass.