ShadowDepth tanking fps with Nanite/VSM foliage. UE 5.3

Hello everyone! I am fairly new to UE but I have been learning a bit about optimization over the past week. I am working with an open world that is using the black alder quixel foliage. I converted them to nanite, although from what I understand the way those meshes are masked is not ideal for it. I used PCG to create a forest, however my VSM cache is constantly invalidating causing my poor fps to tank to 19.

Currently I have WPO enabled for simple wind, but I have set all of my tree meshes to rigid Shadow Cache Invalidation Behavior (Disappointing however as now all of my shadows are stationary but compromises had to be made). This means my trees have some sway but again, sadly the shadows are static. I have also set a decent cull distance for them, converted all their textures to 2048 as well as set their min LODs to 2 (Which I’m not sure really matters with Nanite but figured it couldnt hurt!).

My question is, even with every tree set to rigid, my fps is still quite low, around 25 fps and this is especially true when looking toward a light source like my sun. Does anyone have any suggestions? From what I understand some of this might be mitigated with a new tree asset that has an opaque material for its leaves, but I haven’t found any free options for that kind of asset.



Make sure you’re not using Pixel Depth Offset in your materials, as it’s a horrid performance sink for shadow depths on Nanite meshes.

1 Like

Thanks Arkiras!

It turns out that I was so focused on the megascan trees I didn’t notice one of my other foliage had Pixel Depth Offset on its material. (Just as an added note for anyone else, as far as I could find the Black Alder megascans don’t have pixel depth offset in their materials) I also wasn’t aware just how much this affects ShadowDepth so thank you for the suggestion, it was a major help! Back up to 60fps even in extremely low lighting, which was nearly impossible before.


1 Like

I’m curious about one thing though, is it possible to somehow change Shadow Cache Invalidation Behavior depending on how close you are to a mesh? I feel like, needing to see swaying shadows close to the camera/player makes sense while benefiting from rigid shadows on further away foliage.

It should be possible to set it from blueprint, but it will likely be expensive to check the distance to the player every frame for every piece of foliage. Normally the way this is done is by using the World Position Offset Disable Distance in the foliage actor settings

1 Like

Makes sense! Thanks again for your help Arkiras!

1 Like

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