[UE5.5]How to stop shadow flickering in main viewport when using render camera?

I have a tower defense game and when selecting a tower, you can see a preview of it in the side panel on the left. I render this with a capture camera off to the side outside the play area. Everything works fine except for one thing… I get this flickering of shadows. You can see this on the rocks if the video shows up. I thought it might be the render camera changing the LOD, so I changed the render distance of the render camera. No change. I thought it might be the lights, but I turned off the preview lights and it still happened. It’s only when the render camera is active.

And it gets weirder. This does NOT happen in the editor or in standalone. It only happens in a packaged build. It makes debugging this VERY tedious. Anyone have any ideas what might be causing this? Or what it is at all? Is it the LOD changing or is it the lights, reflections, what?

edit: Oh, I did try limiting the LOD to only one LOD and it still flickered. But it’s been a while. I could be wrong.

edit2: I just swapped out some assets with some that have only one LOD to make sure. No change. Those assets still flicker with only one LOD. So it doesn’t seem to be LOD swapping causing this.

edit3: A friend noticed that when the shadow quality is set to low or medium rather than Epic, it no longer flickers. So it is a shadow issue.

Found a bit of information. The difference is that the capture camera turns off distance field shadows for some reason. If I manually turn on/off distance field shadows, I get completely different shadows. Now to figure out why they’re THAT different and why the capture camera is turning them off.

Found it. I turned on display of the distance field and the rocks at the top aren’t producing any distance fields at all despite it being turned on. I think it needs to be a full enclosed object, not just a one side mesh for the rock wall.

The issue is that when distance fields are turned on, the top rocks aren’t casting any shadows anymore, so the shadows below look completely different. I still don’t know why the capture camera is turning off the distance field shadows. But it’s probably just a setting in either the camera or lights.

1 Like

Just a followup. I was using spline mesh components. These do not support distance fields. That’s why the shadows look different with and without distance field shadows.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.