Scene / Foliage Optimization tips

Hi Everyone,

Does someone know how can I improve the FPS in this scene?
I’m using dynamic light because I’m making a big open world map and I’ve already setup occlusion culling for grass inside the foliage tool.

My PC is a I5-4440, gtx 750 ti, 32gb ram, 500gb hdd, x2 monitors 1920x1080.

Unfortunately my fps are low… probably because the “RenderViewFamily” and some other stuff are really slow.

Grass is 8 triangles
Trees are 7k triangles with 3 LOD levels

-add some hills and other stuff that blocks the view of the player
-use LOD’s for the the grass
-reduce the density
-it also depends on the shader complexity
-I personally use grass with 6 tris :slight_smile:

When I read the thread title I was hoping to see some tips in the OP. heh

Anyway from what I’ve read in other threads it seems like the complexity of the shading model currently used for foliage is the culprit.
You can read more about it here:
Including some vague hint from Epic that they might try to make a simpler foliage shading model. It would be nice to get an update on that though.
This is something that affects all games with large outdoor environments btw so you are not alone. ^^

Yes – reduce view distance any way you can. Amount of stuff to render is square of how far you can see.

Thank you guys! you’re really helpful.

I’ll fix my grass to 6 or 4 tris.

2 more questions…

How many LOD should have my grass?

This is the grass shader, is it performance heavy?

I think the most performance is used by the Textures, for examble i made a gras, where every Blade of gras is its own 8 tris model, but i haf just a simple texture with colors and no alpha input, so its not “masked”. This gras has no LODs but needs nearly no performance, here a littel Video.
The texture could be made with more love :rolleyes:

also intensity seems to be no problem ^^

with this Gras I tried to reproduce the Gras LOD technik from the Witcher 2, they also have this highpoly Gras (which is much nicer btw) models for the base and for the first (and last) LOD a REALY simple Masked 2 tris Plane-Sprite.

it sounds like a good idea! I’ll try it asap. Thanks

I didn’t try siebencorgie idea, but I got a good FPS for a gtx 750 TI in full hd.

while packaging the project LoL

I am curious, could you link us to anywhere they are talking about the grass they used in ‘The Witcher 2’? Would love to read it but couldn’t find anything about it.

  1. I always use LOD0 and LOD1
  2. it shouldnt cause any big fps drops -> but when you remove the wind, you will get a better fps rate :slight_smile:

I can say from I experience that most performance issues related to grass come from overlapping transparency rather than from the amount of tris or even other types of shader complexity. Basically, you should try your best to leave as little empty space in your alpha as possible, try to not have many many planes overlap each other (if possible). Your LODs should be about reducing this issues rather than reducing polygon count (as an example, my LOD0 has bended, intersected grass planes to look good from above. My second LOD removes the intersecting plane because it will no longer be looked from above. This means less overlapping transparency).

If your material is taking a performance hit (wind, SSS, etc.), It’s not a bad idea to use a different material for your LODs, a cheaper version which won’t look very different because it’s not being looked at closely.

I also set my LODs to not cast any shadows and only my base mesh casts one so only the closeup has the detail it needs.

No grass
almost everything was placed with the foliage tool in a area of 1km x 1km

the frame rate is 14 - 23

All objects have occlusion culling working properly.
Trees have 3 LOD

Lights are dynamic and Static

Level streaming doesn’t work with foliage.

I’ll add some of my experience with this, even though it’s pretty late for the poster, might be useful for future wonderers.

Things I do with my foliage:

  • Make material instances out of everything (in general, have 1-5 master materials for your whole level (With special exceptions))
  • If your mesh only has one LOD by default, export it and reimport it. In this other Lod (LOD1 would be), reduce the lightmap resolution, disable casting shadows)
  • If you’re far from reaching your pool limit, duplicate the textures. This is, create another texture and force the mip level to a quite low resolution with more compression or so.
  • Have another master material for the lod one. Depending on the distance this gets activated and your goals, you can disable winds, surface colors, opacity masks.
  • Add culling distance maximum (go to your vegetation tool, select a mesh and scroll down until you see the culling distance.
  • Be smarter in vegetation placement. More =! better. A well placed vegetation system will need a lot less spawns to look suficing than a none one.
  • Disable certain types of shadows (Dynamic shadows for example) on most vegetation.
  • Make your level in a way that not a lot of the vegetation is rendered at once (rocks, buildings, etc).
  • Improve general performance by instancing all other static meshes in your level with tools (there’s a blueprint that you can make with it :).

Hope this helps :slight_smile:

Try to use Level streaming. It may helps.

Do material instances affect performance much? I always thought they were more about better organisation.