Download

Why does this tree kill my fps?

Hi all. I’m having a bit of an issue and I’m hoping someone out there can point me towards a solution. I’m using a Speedtree model to make a forest, ish. It’s a simple pine tree model that I optimized down to 2800 tris inside of Speedtree. It has 2 LODs and a billboard. It uses two materials, with one color texture and normal map each, all of which are 512x512. All in all, a fairly simple unremarkable asset:

fac6e58fd6edc5fc29779c5ef2c6961d9b9d8e56.jpeg

Yet this tree kills my fps when used with an instancing node.

I am using an algorithm that takes creates a “forest” of about 30 trees on a ~100 UU wide hexagonal tile. It does this by randomly generating vectors and using those to add instances to a HISM node. This all works fine and makes something that looks forest-y. The problem comes when you scale up.

For example, if I have a level that is 20 hex tiles wide and 10 hex tiles tall, so 200 tiles total, with the current system I end up with about 1500-2000 tree instances. And the impact on frame rate is negligible. I rigged up a hotkey to toggle the visibility of the trees to test the impact of having the trees on fps. In the 20x10 map, toggling the trees off results in less then 1 fps increase in framerate. Stepping up to a 40x20 map, I end up with around 6500 instances, and toggling the trees gets me about 4-5 more fps. The next step up, 60x30, generates about 10K instances and toggling them nets a 12-14 fps boost. Even farther up, at a 100x50 tile map which generates about 30k tree instances has a fps difference of 26.

So, the number of instances seems to be having a non-linear impact on performance. However, I was under the impression that using instances would have a very minor impact on performance. Again, these are all instances of one single HISM node. The docs on the HISM node talks about millions of instances. I can’t get decent performance out of 30K instances. What’s going on? Is it the fact the model uses a lot of transparency? About 99% of the tris in the model use a material that is masked. As a test I changed the materials blend mode from Masked to Opaque but there was no noticeable difference in fps so I don’t think that’s the problem. I can’t find a way to toggle the blend mode of the material during runtime so I can’t be 100% sure. Is it the poly count? Is 2800 tris too high for the top LOD? Is the LOD system not working properly so it’s trying to show all 30K instances at full res? Does the HISM node only work when used with the foliage system? Is there some extra step I need to do to make this work?

I don’t understand what the problem might be and I’m stuck at where to look next. Any advice on what I can do to fix this would be greatly appreciated. Even if it’s to point out I’m just tying to do something the engine can’t do. Cheers,

J^2

A quick fairly related side question. Let’s say you’re using an Instanced Static Mesh in your blueprint. You have a variable you use to reference it, add instances to it, etc. If you want to use a HISM instead, can you just simply replace the add ISMcomponent node with the HISM version, or do you have to update the variable and all related nodes as well in order to benefit from the improvements in the HISM? I ask since I was able to do just that, replace the AddISMComp node with the AddHISMComp node and everything seems to work, but I see no difference in performance. Do I need to replace every variable ref, getter, setter, addInstance, etc with the HISM versions? Just wondering if that might help with my speed issues.

Also, I’ve seen while researching this issue a lot of people call instances “free” render calls. They don’t really mean free though right? Because that would imply I could have 1 instance or 1 million and the framerate would remain the same. At least, that’s how I read that. Someone please clear up my ignorance. Cheers,

J^2

Would be nice if anyone could say they have gotten speed trees to work with the new hierarchical instance blueprint node. And if they do have it working, what do you have to do to get it to work?

It would be really helpful to know your system specs…

Normally you should get a pretty good performance:

-how many fps do you get when you place those trees with the foilage tool? :slight_smile:
-your system specs
-do you use the default speedtree material or have you modified something?

Re: System specs = 12 x 3GHz cores, 12GB RAM nVidia 970 GTX WIN 8.1, latest drivers, patches, etc.

Re: Foliage Tool We can’t use the foliage tool as it doesn’t work with Z’s procedural map generation. We need to be able have a “forest” per tile which the foliage system just doesn’t allow us to do. We have tried using the default speedtree material, as well as a modified one that uses Z’s spherical projection. No apparent difference in frame rate hit. I’m beginning to suspect that Speed Tree is just is not a viable solution for our particular situation. Cheers,

J^2

I would like to see the Hierarchical Instance Mesh blueprint node working before we call the speed trees bad. Performance is still low with the old single mat trees I found on the net.