Can someone explain why the shadows are trailing?

Is this trailing shadow effect caused by my PC’s lack of processing power, or is it another problem? I have tried changing my Character’s movement speed, baking lighting and materials, and adjusting several lighting/post-processing details. Nothing I have tried solves the problem. I do not want the shadow to linger as my character moves.

1 Like

shadow_bug
I have similar issues from fast moving objects - pretty unpredictable. Can’t find any settings to solve this.
This artefacts come only with virtual shadow maps. If you change them to normal - it will be fine. But virtual maps have some advantages, so it would be nice if anyone has solution.

Well, it seems I found it. It’s virtual maps caching. Can be disabled by

r.Shadow.Virtual.Cache 0

Obviously will affect performance.
More info here:

Virtual Shadow Maps in Unreal Engine | Unreal Engine 5.0 Documentation

So either disable caching either switch to normal Shadow maps.

4 Likes

The screenshot above is the result of changing the shadow rendering to normal. The shadows are not as clean as when using the virtual shadow maps, but the shadow trailing is gone. The finger shadows sometimes simplify to a cube.

I went ahead and changed the skeletal mesh to the cube. I decided to switch to the normal shadow rendering because this game will be of lower resolution. I won’t need high-fidelity graphics. I will have to account for the rendering quality when I use another character mesh.

This is due to the bounds of the mesh not being large enough. I guess virtual shadowmaps use the object bounds to determine which VSM pages to invalidate, so if your geometry goes outside of its bounds while animating then they will leave trails behind.

Solution: Increase the bounds scale of your character

1 Like

Oh man, I was looking at visualising invalidating bounds for a while wondering how I can solve this and didn’t know about bound scale option in mesh setting. You saved me! :slight_smile: Helped a lot!
Also. In second case trailing shadow appears because movement done not on transform but on bone. Can be solved by “Include component location into Bounds” in Skeletal Mesh settings.

1 Like

This is the right answer!

Thank you for the advice Arkiras! Increasing the mesh bounds solved the trailing shadows while using VSM rendering. I increased the mesh bounds scale to 1.1 instead of the default 1.0 and did not see any more trailing shadows.

One more addition to this thread. If you’re seeing this with a skeletal mesh, make sure your skeleton has a physics asset attached to it with at least one body.

3 Likes

This ended up being the fix for me, without needing to adjust mesh bounds. Thank you!