Light Leaking Appears When Using Shadow Maps

(Using Unreal Engine 5.6)

Light leakage appears at select edges of my mesh when “shadow map method” is set to “shadow maps”. However, using virtual shadow maps fixes the light leakage but causes noisy shadows (specifically from rect lights).

Regular shadow maps:

Virtual shadow maps:

Virtual shadow map shadow noise:

Something that should be noted is that I use most of the settings found in this blog post, which disables things like lumen and ray-tracing: Unreal Performance Maxxing

However, I toggled a few since I was experiencing that light leakage. Essentially, I’m looking for one solution to either of the problems; what causes the light leakage with regular shadow maps and how can I fix it? Or, what causes the noisy shadows with virtual shadow maps and how can I fix that?

Any and all help is appreciated. Thanks!

Hello there @Cytra_Z!

Beyond having Lumen and RT off, I think you are getting two separated problems in this scenario, so let’s tackle both shadow approaches:

  • Working with classic shadow maps: Select your main light, the one were the leak origins, navigate through it’s details panel, and look for “Shadow Bias” and “Shadow Slope Bias”. Test by lowering both of these values, until the leak is reduced, or disappears entirely. But don’t overdo it, or you will start getting shadow stripes, or similar artifacts. If that doesn’t resolve the issue, try adjusting “Contact Shadow Length” as well.

  • Using VSM instead: In this case, it’s more of adjusting scene settings themselves, rather than the light source. First, check your project’s AA settings, test with both TSR and TAA. Then, you can increase the shadow sample counts with the cmdlet r.Shadow.Virtual.SMRT.RayCountLocal. It’s default value starts at 8, try short increases to 10, 12, and so forth.

Thanks for the response! I stuck with classic shadow maps and your advice solved the light leak problem. After experimenting with the rect light settings, I found that bumping the Shadow Resolution up got rid of the leak created by them; in my case they disappeared when I set the resolution to “2.0”. As for the leak at the top of the corner of wall, that one was created by my Directional Light, and for that I had to gradually decrease the “Shadow Bias” instead (increasing the Shadow Resolution did nothing). The leak from that light disappeared around “0.22”. I appreciate your help and hopefully this can help anyone with a similar problem in the future!