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!
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.
WPO is world position offset, it’s what you are using to “animate” the grass.
UV warping means playing with the tex coords to manipulate how the texture is plotted. Common for particle effects like fire.
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.