Grass optimisation in Unreal Engine 5...

Hey everyone, I hope you’re having an awesome day… I have ran into a little problem though… See, I used Unreal Engine 5.2’s PCG (Procedural Grass) system to procedurally and more realistically place grass. It works wonders really. This is an experimental option though, so there’s that. The problem is, even though the grass uses optimised LODs and Nanite at the same time it is still unbelievably laggy. Around 10 to 7 FPS depending on where you’re looking. I also looked to make the grass as less dense as possible but it just isn’t enough… I use RTX 3050 which I suppose we can agree is a pretty decent graphics card, right? Anyhow, I looked for the answer far and long and everyone on the Discord Server doesn’t seem to know or is just ignoring my question, where as if I Google the thing on the said topic it gives really mixed results (some even showing UE4 even though UE5 was searched for)… Posts on Reddit haven’t helped a ton either and these forums are really my last resort. Please, if anyone has encountered such issue before I’d be more than thankful if you’d manage help resolve this issue. I’ll post some screenshots so you guys can grasp on what kind of environment I’m going for:

Grass models are animated and I don’t plan on removing the animation just for some performance boost… Since it’s open world I need the game to feel alive, hope you understand!

Edit: I managed to adjust the cull distance but it is still lagging nearly as same as before the cull optimisation… The parameters are really reasonable size so I don’t know really. Any other tricks? Maybe I can adjust LODs to a lower quality as my trump card at this point? Or what if I make that thing where it renders just the objects that camera sees? :frowning:

1 Like

If you place the assets using the foliage painting tool with similar density is the performance any different? It may have nothing to do with PCG. One of the biggest performance pitfalls with animated grass is virtual shadow maps cache invalidations when using Virtual Shadow Maps, for example. You will need to profile your scene to see where those milliseconds are being spent.

That grass looks very nice, but there is way too much of it - you need to set a cull distance on the static meshes you’re using:

1 Like

if the grass is animated, go to your pcg graph, select your static mesh spawner node, mesh entries>index[x]>descriptor>world position offset disable distance set to 500 or 1000 depending on how far is important for you to see the animation, that should reduce the shadow maps costs and you should get some performance gain. You should do the same for the trees and all the foliage.

1 Like

Just for performance I disabled Virtual shadow maps, I don’t find them particularly important for looks… You can’t even spot the difference… So they are disabled and yes it is really no improvement when using foliage tool… I doubt PCG does anything to the frame rate

Hey man thank you for the compliment! I saw a Unreal Engine 4 tutorial on how to reduce the cull distance but I couldn’t seem to find any on UE5… Do you know how to get that parameter tab thing?
Screenshot 2023-05-03 113107

Hey @Mateo_The_Dev,

For a quick reference, check out this non-Epic affiliated tutorial on culling foliage in UE5:

Greetings, that was a really epic non-epic tutorial! I can’t believe I managed to miss something like that I mean it was right in front of me XD Anyway, sadly, even with the adjusted cull settings the grass and trees are still slowing it down ridiculously… So sad to say it didn’t do much of an effect :frowning:

Maybe try experimenting with the Scalability settings to see what difference there is between them - I’ve got a 3070 and I have to switch it down to Medium when I’m in the editor - it runs better when packaged too - maybe test a packaged build.

1 Like

Hey there, thanks for the idea but unfortunately I’m already abusing this function lol… I have everything on Low except shadows which are on High :frowning:

Hey @Mateo_The_Dev,

Have you tried optimising the LODs of your foliage? Check out this non-Epic guide for optimising foliage performance that goes over how to do so:

1 Like

Hey that was a real epic tutorial but all the stuff shown unfortunately I’m already using or they’re not relevant… Thanks for trying though!

Guys I’m starting to think of occlusion culling… Can’t find any tuts on UE5?

Hey @Mateo_The_Dev,

Check out this official documentation and non-Epic affiliated tutorial:

1 Like

Hey so when I press “Bulk edit via property matrix” I get this blank window? I’m using the full 5.2 version.


Looks like a bug, I got the same thing when I just tried…

I love it when they say in the title it’s for UE5 AND 4 but then doesn’t work :man_facepalming: Do they do it for views or what? Anyhow, any other way to do this? I already searched the topic on YouTube so I saw this video already and knew it wouldn’t work

Hey @Mateo_The_Dev,

Did you create this project using the full release of 5.2 or the preview? When attempting myself I am not getting that error for bulk editing.

I created it during the second preview… is it a problem tho? I think it might be that

Have you turned off shadows for the grass?