UE5 | Landscape and Procedural Foliage is not unloading in runtime

Hello.

I have created a big landscape(~8 square km) and I wanted to create a procedural generated foliage for biomes(I have 7 at the moment).

Of course when I added foliage for the entire map, it was exceeding my available memory. That’s fine, since unloading and loading cells while working in viewport is efficient.

However when I started playing, I had the same problem in the runtime. My memory was overloaded and I am just dumbfounded how this actually works. When I reduced culling in foliagetypes I noticed that there are trees in the background. So I jumped to a conclusion that Procedural Foliage is not using any grid to unload and load with static meshes that are inside that cells. Am I wrong or just missing something? Or just completely don’t understand how it works? My settings for the grids are basically default.

Can someone please help me with this issue?

Hi @Savonir!

Would you mind sharing your culling settings that you have set for your foliage? In the meantime, here is some live training that covers cull distance as well as other optimizations for your environment:

Performance Optimization for Environments | Inside Unreal

Any information you can provide should get us closer to solving your problem!

At the moment I didn’t have any culling, since I wanted to check if procedural foliage is using the same grid as for static meshes.

For now max culling: Trees have 15k, grass 7k and bushes 8k.

Procedural foliage can be culled from being drawn on GPU, but the instances locations still need to be processed by CPU and present in the memory. The instance locations for procedural foliage are still pre-determined and saved, rather than dynamically created. So if you populate 8km^2 area with procedural foliage, all those instance locations will be precalculated and serialized, leading to extreme memory and performance impact.

What you are looking for here is probably something along the lines of the grass tool. The grass tool, unlike procedural foliage, spawns the instances dynamically around the camera, and actually despawns them as camera leaves the previous area, instead of just stopping them from being drawn on the GPU.

The problem with the grass tool is that it only works on landscape surfaces, not static mesh surfaces. And also, it works well for grass, but it doesn’t work that great for some more complex instance distributions.

Okay, so that’s why everyone is recommending using grass on landscape material instead of procedural foliage?

Yes, that’s probably a big part of it. But also that the procedural foliage tool is just really painful to use. It uses really overcomplicated set of really confusing parameters which are very difficult to art direct.

It was bad to the point where I wrote my own plugin to replace that tool Simple Scatter in Code Plugins - UE Marketplace

But just to warn you, my plugin is also not well suited for too large landscapes for the same reason procedural foliage tool is not. So for your 8 square km landscape, grass tool is still your best bet.

Thanks for the tips!