I have one mesh with 2 water pools (basically just 2 rectangles extruded into the ground). On the left side of the scene I have a directional light with hard shadows.
As you can see the shadow of the right pool looks fine. But the shadow on the left pool has a gap on the left side. When I rotate the directional light slightly (to look more downwards), the gap disappears.
I want to understand this bug. Can anyone explain me why there is this gap in the shadow? And is there any other fix than changing the light direction?
Look at the scene from the direction the light is facing. My guess is you can see the bottom of the pool from that angle due to not having any geometry beyond that wall in the background. If you can see it, so too can the light.
Unity’s shadows by default only use the front faces of objects. You can try turning on double sided shadows on the ground’s mesh renderer component, but there’ll still be a small gap between the pool wall and the pool floor due to biasing (what @Johannski was getting at). So it’s better to have a bit more geometry than you “need”, i.e.: make sure everything is capped, for shadows. You can also use a mesh renderer set to Shadows Only if you don’t want to have anything visible to the camera beyond the wall.