Foliage rendering dropping frames

So I am currently creating a level in unreal and I am just a beginner. I was happy with the overall landscape but when I tried adding grass foliage to the ground, once it reached 30k foliages, the fps started to drop. I want the entire landscape to be filled with grass that is also dense. Is there a way that I can tweak in the settings where I can keep the grass as well as the fps performance as well?

1 Like

try using a better grass model for the preformance
edit the start cult distance and end cult distance
you can also adjuct the landscape so that it dosent show all of the folaige in one frame so it will only render the visible foliage on your screen

1 Like

I have this exact problem. The last LOD for foliage is billboard material, or a flat texture that faces you. You have to set up cull distances.

1 Like

The engine doesn’t perform well enough to allow infinite instances of random stuff.

Particularly, GFXs don’t perform well enough on tris smaller than 2 pixels to be able do to grass in full detail with great performance.

The ways around it are:
Larger meshes with opacity and enabling early Z Pass.
This allows the gfx to render stuff fast enogh and is really only encumbered by the overdraw caused by the alpha of the textures.
assuming early z pass works.
And thats a big assumption as ot was broken from ue4.19 to ue4.26 or just about.

Alternative, you have to “live” with the GFX bottleneck on meshes with more and more tris.

You can get OK pefromance by making conglomerates of .5mx.5m and 1mx1m of grass to distribute around with proper LODs where:
Lod0 to lod4 are tris only but properly reduced.
Lod5 is a billboard.
The setup is decent enough on the lod distribution to where the billboard happens around 10m from the character.

Other workarounds and better functionality involve going back to direct HLSL input/creation. And its not really something Unreal allows for without having a mesh as far as I’m aware.

Stuff like Abuzu had to re-write half the engine to create fish with the vertex shader only (since only skeletal meshes have animation curves but using those even with a single bone would
destroy your system).

One other tricks is reducing the overall scene size so that you have less total instances loaded as individual pieces (level impsators replace foliage as a wole element, usually an octohedral impostor).

And/or setting up better HLODs (except not in ue5 apparently as they don’t work right).

2 Likes

True, but instancing can’t fix everything. You have to also optimize your scene grass with these techniques:

  • LODs. You may already have these, but LOD 0 causes issues. Make the minimum LOD 1
  • Cull distances. Never set these too far, but not too close.
  • Scaling. This can help instancing costs.

This is the same as the last response, but simpler.

1 Like

Could you please let me know how to adjust the landscape so it does not load all the foliages on the screen?

sure , You can add Hills in the landscape so that the hills will block the grass behind it so it wont load many grass a mountain can work too

did you understand what i meant or do you need me to explain more

1 Like

I have understood it but the issue is that I am working on a an almost plan field so adding hills or mountains will… but I thin if I add more structures like buildings or even trees that might help right?

Very minimally.
Overdraw kills peformance, and on flat terrains there’s usually too much overdraw…

Also, when stuff is unplayable Less is most definitely more… (read as “cull your foliage”).

1 Like

building would block many grass so it would help , but if the building require a lot of performance i wont recommend it but if made it better i would recommend it for sure

also you can change the folaige model smaller one would do better than tall once

Is there a way that I can only render the scenes that the player is seeing and not anything else?

I Think this is auto done by the engine , try to look to the sky the fps would go high bc you are not looking at foliage therefore it will only render the sky not the foliage

if you want to you use fog and make the viewdistance near and lower the grass cult distance so it wont load far mesh , foiage and it wont look wierd cuz fog would be blocking the far things

i would like more info about your foliage and map if possible a screenshot so i would be able to help more

1 Like

Fog does not affect fustrum culling, so that isnt going to change anything - and make things worse by adding extra complexity to the render…

I Meant lowering view distance + fog so it still look good bc lowering distance alone would make it look weird

That is called occlusion culling. I can’t really explain it. Try looking up a tutorial on it. Or maybe that could be the LODs I just explained. To set them up, open an asset and look for it.

@PhantomBladeX8

When adding assets(Especially something dense and multiplied like foliage) it’s going to hit your performance once you get to a certain point. In terms of helping reduce the performance cost I think @MostHost_LA hit the nail on the head with information provided.

I am not sure how to reply to that…

@Td1, that does work, but I think it’s just better to cull and do that. You can’t shorten the view distance that short, so you also have to cull.

By the way why do moderators come to these threads?

I may have missed a deleted message, but obviously they do?
Particularly considering the message right above yours is from a moderator?

Also, lets all try and stick to the topic at hand.

For instance, writing “cull” isn’t very helpful to anyone reading this, and its essentially parroting what has already been explained in more detail above.

The suggestion of adding fog is liekly only detrimental to performance. It would have to be some fairly thick fog in order to allow an instance count reduction, and distant instances which LOD dont really pose as much of a problem to the rendering pipeline as the quantiy of the nerby instances.

Fuether, for your edification too, occlusion culling deals expressly with occlusion:
Something in the way preventing items from being seen causes them to not display.
So what you are telling the user, in essence, boils down to “dont use a flat landscape” - which everone else already mentioned, it is also something he obviously understood and replied to stating it was not an option…

Also, so you are aware, LODs for grass arent necessarily going to do much of anything.

Grass specific performance problems are born ojt of tris to pixel distribution/calculations.

When a single tris is rendered into a single pixel all grpahic cards - by design - have longer computational times returned in order to render a scene.

As such, nearby (to the camera) vertex based grass will perform somewhat OK, but the same mesh moving further out from camera to where the tris are sub 1 pixel will end up costing more.
If you therefore transition from the really high detail/vertex grass to an LOD which joins many grass strands into an alpha based texture the tris to render will be wider than 1 pixel returning some performance increase.

The increase you just got however is immidiately used up by the overdraw caused by the transparency.

Fine tuning the meshes used to the project/scene - and bench marking every step of the way - is the only way to guarantee performance…

Moderator come to these threads to help people who got an unsolved issue