I have had some issues with that when using instanced meshes. I could be wrong but I believe it has something to do with the way unreal batches the materials by default when they are instanced so it’s “culling” some of the shadows as you move around closer and farther away and those shadows that are culling are also attached to the trees in the distance, so they just pop in and out as if they were still close to you or further away if that makes sense.
I believe I solved it by increasing the shadow culling distance, so they just render continuously within that radius. I also had some weird artifacts when the lighting levels were too low, but the exposures were turned up and the materials just don’t render in places leaving unexplained blackness.
The culling distance can be a double-edged sword. If you have a single foliage asset that is within range of your character inside the culling distance that is instanced, but they are spread throughout the map, if I remember correctly, they ALL render the shadows and can be expensive on the GPU rendering things that are too far away to be relevant for shadows… Like a little plant that’s a half a mile away, but it’s unnecessarily casting fully rendered shadow. Hope that helps.