Lots of Foliage, not a lot of frames.

Hello, I want to have a bunch of grass in my scene, but no matter what density, lightmap resolution or engine quality settings I set, I simply cannot get decent frames when I have a lot of foliage. I’ve seen other projects have a baloney load of foliage and have excellent frame rate. So there must be something I’m missing, anybody have any ideas? (And before you ask no it’s not my computer, it’s freaking amazing and I do not believe it is the problem)

The SpeedTree seems to be the problem here.

How many tris is the tree?
How many tris is the grass?

That grass looks very high poly, and you seem to have a lot of it. You’d really need to create LODs for it, and switch to them pretty quickly.

My grass is 3600 tris and the trees are about 6600 each. I’m working on lowering them now…

The trees are no problem whatsoever.

What you’re encountering here is sub pixel triangle from your grass. Whenever your triangles go smaller than a pixel your going to see an exponential drop in performance, and since you’re overlapping these high (for a grass mesh) poly grass meshes a lot you’re getting a lot of performance drop.

The idea here is to treat triangle density like texel density, you want to keep it uniform over your view. So a huge mesh, like a tree, can easily fit tens of thousands of polys without a problem, because each of those polys is going to be covering a lot of space. While your grass mesh, which is small in view of your camera, needs to be a lot less.

You’ll also need LODs for all this, because as you get farther away the amount of screen space that each mesh covers shrinks, and so is more likely to give you more and more sub pixel triangles.

That makes a lot of sense and actually lines up with the games behaviour. It runs better (not good) up close and then get laggy when I look out. I’ll try to implement LODs and get back to ya.

Also take care of Overdraw. Minimize the transparent areas.

Wow, I added two LODs, one with 3600 tris and one with 1000 tris, the difference is amazing! I went from 10 fps to 35 - 40. You are literally a life saver. I’m still getting around 22 fps on full screen though, should I keep lowering the tris?

Generally a cluster of grass would be around maximum 500 Tris for main mesh and it can go as low as possible with LoDs.

Okie doke, thanks a ton y’all!