Performance of Bake to Blueprint vs Actors vs Foliage

   225   1   0
User Avatar
Member
11 posts
Joined: 2月 2018
Offline
Hi Guys,

I've noticed this new Bake to Foliage feature and wanted to talk about performance implications of different baking types especially since UE4.22 introduced auto instancing.

So from my previous experience with UE4.21, baking a huge amount of instances (I'm talking about 10-100K instances) into Static Meshes Actors was giving a big impact on performance so no go. There where also HISMs (Hierarchical Instanced Static Meshes) with LODs that seemed like a good solution (which were generated by Bake Blueprint button). However, the caveat was that occlusion and camera culling only works per actor and it would not cull individual HISMs and at some point would give even bigger performance impact than using static meshes. So my solution was to split instances into clusters inside of Houdini HDAs by providing clusters number and cluster index and would bake out individual clusters into separate blueprints with HISMs which would allow for better culling. It was working pretty ok for my needs but the setup and baking process was a little bit daunting. There were other issues with too large lightmaps and HISM LODs distances not behaving correctly in UE4 so still not ideal.

Now having UE4.25 with static meshes auto instancing and ability to bake to foliage tool with Houdini Engine I wonder if there is a better way to handle instances not only for foliage scattering but also for procedural/modular geometry.

So the questions are:
- Do we still need HISMs and Foliage baking or it's best to use Bake to Static Mesh Actors and let UE4 auto instancing to do the rest?

- What benefits Bake to Foliage provides comparing to HISMs blueprint, cause as far as I understand Foliage is HISMs underneath, no?
Does it solve culling issues at least and maybe even lightmaps and LODs behaviours?

- Does anyone have a better workflow for procedural/modular geo to share? I'm trying to find a way to efficiently render models like the one attached bellow which is made of a bunch of individual instanced pieces.



Thank you for sharing your knowledge and experience in advance!

Attachments:
Pagoda.png (582.5 KB)

User Avatar
Member
11 posts
Joined: 2月 2018
Offline
So I've done a bit of stress testing and would like to share the results for discussion.
I've created an HDA that would instance rubber toys on a 3D grid. Every toy is 25k tris, no LODs, and I had 10k of them in the scene.
Don't be alarmed by the frame rate cause it's usually much better with LODs. The empty scene runs at about 700 FPS.

The first was Bake to Blueprint with HISMs. The bake itself was fairly quick. The frame rate goes down and it's about the same regardless how many ducks on the screen and how close you are, as long as you get at least 1 duck on the screen the frame rate drops so still no culling as expected.



Then it was Bake to Foliage. The bake was instant. I'm not sure I've figured this one out correctly though. I had some weird behaviours with culling, the meshes would disappear (all of them at once) at a fairly close distance and when I look from a different angle. I've found the foliage settings field in Houdini HDA and set distance culling to be big, no difference. After some testing even if I use UE4 Foliage Paint tool the weirdness would kick in after painting about 4k meshes. It does work fine if less. So I've decided to split 10k toys into 5 clusters 2k each and it worked.

As you can see when all meshes are on the screen the performance is about the same as with HISMs maybe a bit better due to faster draw calls but it does get way better when I get closer, so there should be camera view culling at least.






The next one was Bake to Actors. The baking took forever. But when it was done the performance was about 2 times better than Foliage and HISMs. Even though draw call seems slower than foliage it's still way lighter on GPU. And it also respects the usual culling behaviour for static meshes and when I get quite close it's running pretty well.

The only weird thingy was that when zoomed in looking down would make the framerate drop as if I would look at all meshes together but when I look slightly up it was running very well again. O_o Not sure what happens here.






It seems that using Static Mesh Actors with Auto Instancing gives the best performance comparing to the other two if ignoring that weird issues I had when was looking down, unless, I'm doing something very wrong with HISMs and Foliage.

Any thoughts?

I'm excited about UE5 virtual meshes which would solve all these problems all together but for now, I'm looking for your guidance!
Edited by illiastatkevych - 2020年5月23日 04:08:22

Attachments:
StressTestBlueprints01.PNG (979.5 KB)
StressTestFoliage01.PNG (1.1 MB)
StressTestFoliage02.PNG (1.5 MB)
StressTestFoliage03.PNG (1.8 MB)
StressTestFoliage04.PNG (1.6 MB)
StressTestMeshes01.PNG (1.1 MB)
StressTestMeshes02.PNG (1.4 MB)
StressTestMeshes03.PNG (1.6 MB)
StressTestMeshes04.PNG (1.6 MB)

  • Quick Links