Tall Grass Optimization

Im currently building a scene with tons of tall grass. I noticed my framerate was getting a huge hit so I explored optimization options and I decided to make it so the tall grass model will have less and less triangles the further you get away from it. It starts with around 6-7 planes then lowers to 2-3 then 1. My tallgrass uses a material that makes it blow in the wind and I thought to myself less triangles means less to animate which should improve performance. Then I started to notice if all tallgrass models are full detail with 6-7 planes everywhere it gives the same framerate when there’s 1 plane everywhere which means there’s way less planes being animated on screen but the framerate doesn’t change. So what is causing this?

Check the overdraw visualization in the editor. Rendering foliage in general means lots of invisible pixels and when they are stacked multiple times it gets expensive quickly.

Using WPO in combination can add more, an alternate is UV warping the grass to simulate wind.

You can try playing with the mask clip value (default 0.333).

How do I check the overdraw visualization in the editor? So why is there invisible pixels? What is WPO and what is UV warping the grass? Are you talking about the mask clip value on the material?

Lost of great info in the docs of course!

  1. View Modes | Unreal Engine Documentation

  2. How else does masking work if by not rendering pixels? It is geometry; vertices are processed. After vertex shader, it’s pixel shader - engine must figure out what pixels not to render.

  3. WPO is world position offset, it’s what you are using to “animate” the grass.

  4. UV warping means playing with the tex coords to manipulate how the texture is plotted. Common for particle effects like fire.

  5. Yes. As a test, you can set it to reveal the entire texture and see what happens performance-wise. The less invisible pixels stacking on each other in the camera, the less impact.

Okay thanks but I still dont understand why when I use LOD on the grass it doesnt increase perfomance. Like I have about 6-7 planes with a grass texture on it and its about 14 triangles, then when I decrease how many planes there are on screen with LOD it doesnt change perfomance. Any Ideas?

What’s causing that is that your performance limit is probably due to number of drawcalls rather than anything else.

Also, as I believe they are telling you already, if you are using transparent planes the performance will almost never be good. You are way better off slicing up the mesh in grass strands which limits the amount of transparency required per mesh.
this can improve performance drastically. Onviously don’t go nuts with the tris count or you overload the GFX just the same. 1400 tris per lod0 is probably good.
distant meshes are often ok as transparent planes (less overdaw at a distance).

Another option is to enable early zpass.

What is early zpass? Also I tried making the tall grass an actually model instead of a 2d plane but the perfomance is the same.The lod0 is 700 triangles, I tested lod with it and it makes zero difference with perfomance look: Screenshot by Lightshot Screenshot by Lightshot