Dynamic Shadow Issues

I have been fighting with some issues with shadows in UE4 for a long while, and it’s been enough to make me quit for a while because I couldn’t figure them out.

Though, first off, I should state that I am ** not using baked shadows, ** as I had even more problems with them (and AFAIK they would be unsuitable for some of the things I plan). I am currently using dynamic shadows along with raytraced mesh distance fields.

The image below shows two of my issues:

As is shown (or should be), I am constructing the environment from prefabricated pieces, made in blender. The first issue is that the shadows display gaps corresponding to where the meshes are up against one another. These gaps used to be much more pronounced, until I made the meshes entirely solid instead of just featuring the visible geometry (inefficient, I know). The gaps aren’t as bad now, but I still seem them corresponding to the upper portions of the meshes.

The other issue is that the shadows lose detail too quickly with distance, causing shadows from thin objects (such as the streetlight) to get faded out or vanish altogether. In this case, don’t know how to change the LOD falloff for dynamic shadows.

One other issue, shown below, is that shadows appear wrong beneath the overhangs, when the wall is facing into sunlight:

Well, apparently the mesh distance fields weren’t the cause of the problem. Increasing the resolution didn’t change anything. I turned mesh distance fields off from the project settings and restarted the editor, and the problem still occurs.

Raytraced shadows are meant to be used for distant environment in order to get shadows for meshes far away from the player and still keep cascade distance low to help with performance. The issues you are seeing in the first screenshot is because of insufficient detail in distance field representation of the meshes. It can be fixed by increasing the resolution in static mesh editor sometimes but it wont give you the perfect look for every mesh. So, stick with cascaded shadows until a certain distance and use raytraced for the rest of the view distance.

Have a look at the dynamic lighting section in the Wiki here: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

Specifically look at the Cascaded Shadow Maps tab of the Directional light source. As a last resort, try adjusting the shadow bias and filter sharpen.

This solves the majority of my problems. The only lingering issue is the shadows cast by the streetlight, which vanish at a distance

Enable far shadows on all of the outdoor objects then set the far shadow cascades to around 15 or more, remember to not have the regular shadow distance over 7000 but i would recommend under 2500.