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:
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