Shadow LOD (or something) is creating a nasty pixelized shadow from a distance

I’m getting some kind of artifact in my shadows in Unreal engine where the shadow is noisy and inaccurate at a distance leading to crazy shadows like in the first image. I’ve tried a bunch of different settings going between ray tracing and not-ray-tracing and messing with other Lumen and legacy systems and these seem to be consistently there no matter my project settings. Anyone know the setting or a good place to start?

Edit: Another example

is this directional light a megalight? i’ve seen some contact shadow artefacts like that aswell. solution is to not use mega for the directional light at this point, til it is fixed. or disable contact shadows in the first place. don’t actually remember if i had those on when i experienced this glitch.

Looks like Anti-Aliasing got turned off somewhere along the line, so turning on TAA/TSR fixes it mostly. Then I messed around with the static mesh bounds multiplier for larger objects so that they would just show a better shadow LOD. Messing with contact shadow length on the light source also helped a bit.

Mega lights didn’t have any noticeable effect in my case. Seems like it was just a confluence of small settings.