Unity 5 Real time lights cast shadows with gaps / light leaks


Real time shadows cast by a directional light in Unity 5 have tiny gaps in them. As if the models had cracks and there was light passing through.

alt text

As you can see, the models are very simple and I checked them for actual gaps, missing polygons and reversed normals. I tested close to 20 models from different projects and they all exhibit the same issue when placed into the scene. The lines get rougher and finer depending on the quality settings but never actually disappear.

The bug appears in places where two polygons are perpendicular to each other - hard edges, walls, ledges, etc. They emerge and disappear as the camera angle changes.

This wasn’t an issue in Unity 4 and appeared upon the update of this project to Unity 5.

Any input would be appreciated. I tried to search for a solution but couldn’t find anyone with a similar problem.




Oh never mind.

The answer was setting the Directional light Bias all to 0 OR selecting “Two sided” in a prefab’s cast shadow setti0ngs.

Hope someone with a similar issue might find this helpful.


The problem you are going to face by putting your lights shadow bias down to 0 is “shadow acne” try setting the shadow bias to 0.04 and turn your normal bias down :smiley:

In my case, the solution is the normal bias should be “0”