- Home /
How do you stop shadows from casting through meshes?
I created a simple demo scene to illustrate.
I have 2 cubes stacked on top of each other. Then I have a sphere that I place above of the top cube. I only allow the sphere to cast a shadow. Why does the shadow cast on top of the upper cube and go through it and cast on the lower cube as well? This is not ideal and I've been struggling for days trying to fix this. Adjusting the shadow distance in quality settings is not a realistic solution either as the distance should be unrelated to this issue. Shadows should not cast through meshes and I'm not sure how to prevent this from happening. Help would be greatly appreciated. Thank you!
Is there a reason your top cube is not casting a shadow itself? It doesn't make any physical sense to have the top cube not cast shadows, and have your lower cube impossibly receive light from an occluded light source. If the top cube were casting shadows, you wouldn't see the spheres shadows.
That's just how shadow rendering works. If there isn't a shadow caster occluding the results of shadows above, they'll be visible on anything underneath.
Your answer
Follow this Question
Related Questions
Huge unknown shadow in scene [android] 1 Answer
How to add shadows in Game Environment 1 Answer
Shadows much darker in build than in editor. 3 Answers
Directional Light creates wierd shadow? 2 Answers
Lighting and terrain 0 Answers