Nanite foliage for open world

Any tips for creating a large world with dense foliage? I struggle with nanite overdraw, and dont know if I should combine nanite foliage with hlod to get a better performance… any tips for optimising dense nanite foliage in a large world would be very welcome!

1 Like

hey mate,
try merge actor as instance help with the overdraw , it will create an instance static mesh components .

1 Like

Thanks, I already use instances for the foliage! My main problem is that the nanite instance foliage, such as trees get a massive nanite overdraw due to the engine not being able to separate layers of leaves… I use geometry meshes with opaque materials.

there are different type of instances for foliage, and different way to make foliages.
I found some instances systems are working better with foliage and nanite overdraw than other one

I see! Thanks, will test different ones😅

Probably use foliage for foliage.

You are limited by alpha transparency on perfoemance.

The more transparent stuff the more the overdraw the higher the rendering cost.

Ofc, if you were to use a better performing engine you probably wouldn’t need to micromanage this sort of stuff…

Im not talking about the overdraw caused by masked materials, but the nanite overdraw happening when small nanite objects are overlapping. This seems to increase performance as it renders several layers instead of just the first one. I have no idea how to minimize it… can be view through the nanite overdraw setting in the editor…

Overdraw is overdraw - its literally caused similarly or exactly the same way.
Which is
By having many transparencis and requiring a single on screen pixel to determine if it has to color or not many times over.

Now i have no idea why your grass mesh which looks to be solid has ehat appers to be high overdraw where it shouldn’t
But if you look closely this is also visible on the green section.

So, is the material transparent or are you instructing nanite to rander with opacity?

This was just a similar picture to my problem that I found online, but I use opaque materials and geometry, but the engine seems to struggle determining which pixels to render, så it renders way to many of them…

You have to actually cut out the geometry for the leaves and blades of grass and use opaque materials to reduce Nanite overdraw in foliage. (As described in Epic’s blogpost about upgrading Fortnite to UE5). You won’t eliminate the overdraw completely, but it will significantly reduce it and can give you a pretty sizeable frame time reduction. Masked materials on Nanite are actually very expensive, even in situations with limited overdraw, and should be used sparingly.

Basically, the problem is that Nanite overdraw occurs when a cluster or clusters can’t be occlusion culled because some part of it is visible (which is why it mostly occurs around object intersections), and masked materials mess that up more because the clusters are still visible, even when the final pixel isn’t.

This talk from GDC also goes into some other methods to improve nanite foliage performance

I also made a tutorial a while back for a method using Geometry Nodes in Blender to speed up the process of cutting out the foliage somewhat.

1 Like

Its really hilarious that they are trying to use nanite to fix everything that’s wrong with the engine.

Its obviously only going to fall flat on its face and everyone and their 99yo grandmas are able to see it coming except for Tim, The EggHeads he hires for management, and the dev team…

Yeah I know, thats why I said I use opaque materials and cutout geometry only, but still there is a massive nanite overdraw showing.

Poly count might be too low for efficient cluster culling? Or maybe the layers of geo are too close to each other and the cluster bounds are overlapping.

Hard to figure without screenshots from your actual project.

In my own projects I’ve reduced nanite overdraw from this:


to this:


with opaque cut out geo. I don’t think it’s possible to completely eliminate Nanite overdraw for foliage. In the GDC talk I linked the guy talks about using HLOD to switch to non-nanite impostors for distant foliage. That might help you.

I see, this might help me a bit! thanks :smiley:

Any other suggestions for optimizing a large landscape with dense foliage (grass, flowers, etc.)?

Not saying this is the correct thing to do but when i tackled this issue in my game I was using very realistic forest assets and need to increase performance massively. Some of the steps/tricks I took were:

  • Use HISM (not ISM, as HISM can cull) this is the same process as the foliage tool and procedural generation.
  • Set a cull value on the assets (especially for procedural) so that only things in a certain radius around the player actually render.
  • I used fog to help hide the new meshes ‘popping in’.
  • I used nanite.
  • I found that using lumen caused an enormous amount of the performance issues alongside nanite. I switched to screen space.
  • I removed any unnecessary collisions from the assets and replaced the necessary ones with simple columns.

Hope some of this helps :slight_smile:

1 Like

Thanks for the tips!! It isnt easy to optimize with all the new ue5 features and no tips from epic on how to make the most performant setup!

Epic has literally never given you any good tips on performance.

EPIC doe not care about performance.

The people they hire don’t care about performance.

The people who talk at conventions, their evangelists etc, dont give a rats ■■■■ about perfoemance.

In short, youll never fine anything touched by epic thats been optimized for performance.

At best, you get sh*t shows like Boy and Kite which are made to run at 60fps over 1080p if even (I think it was max of 30fps at 1080p).

If you want Perfromance you need to look at other engines and companies who actually care about the subject matter. Cryengine is fairly good at the subject for one.
And no, Unity is just about as bad as epic.

As far as tips go, short of “dont use UE because its unperformant” the usual suspects include:

Using the foliage tool provides built in aggregation/optimization when it works, so keep your foliage into the foliage system.

Heavy LOD transitions with final LODs being octohedral impostors usually outperform anything else (but good luck with nanite).

less tris for each model = better performance.

1 and only 1 material slot for each model. (2 of using octohedral LODs)

shared texture assets for multiple aggregated models.

Instancing whenever possible if not using foliage.

mesh merging whenever possible.

And then theres the obvious settings whoch are more UE specific.
Definitely, precompute velocities in basepass or whatever it is.
Fix your TAA or even ditch for something else like forward rendering.

And/or make sure to also compute the transparencies in the basepass (or whatever that setting is. Which helps with Overdraw).

Don’t expect miracles if using UE.
The devs seem to think your avarage player is happy with 800x600 res.
If you want to run 4k res, you probably get 2fps. And apparently its just your fault for thinking that in 2024 4k is the only acceptable output for a Video Game engine.
Not the devs fault for sucking at their job or anything like that…

This one:

or these (the z-pass ones)?

I can say for my experience using masked, with early Z-pass on NON-nanite grass did save me a few frames. It hasn’t seemed to cause any other glitches so far. Masked also lets you leverage PerInstanceFadeAmount to help with pop-in or other effects that pivot off the fading-transition (like flattening the mesh to prevent it drawing).

Early z-pass.

Re grass, the amount of overdraw is usually minimal. Trees will generally incur a lot more of if.

When using meshes, Per instance fade can just be done in the shader for the grass mesh. Same as the flattening of it.
In my case, since cost is very minimal for moving verts, I’m able to use an RT to define how tall the grass is by placing gameplay elements around the level.
So one doesn’t necessarily need the grass node to make things work (though it is faster to set up by a factor or 10 or just about).

On the other transparency setting, i believe it would cost you more. But if you are using transparent materials - particularly as foliage - you have worse performance issues to begin with…

Note: masks dithering looks ok in temporal AA, but potentially does not in forward rendering and other modalities.
Unfortunately optimizing for one thing precludes optimizing for the other.
And those who live in a forward rendered world have their own secret tips/tricks to optimize which i for one am not privy to…

1 Like