UE - How to improve Groom hair performance?

Hi, Groom is performing really bad, just 1 actor in the scene with hair, drops my FPS to 45FPS, duplicating the same actor 8 times, and FPS drops to 8-12FPS, If I leave these 8 characters and open that BP and make Groom invisible, FPS increases up to 90FPS or more in a second…

I already disable Dynamics, created several LODS… none works unless my far LOD makes hair invisible, but even like that it won’t fix it completely (very weird), I also tweaked interpolation… nothing helps performance, It will be useless because even If I use cards for all secondary characters, just the main actor is causing a huge drop, and If I try in UE5… the drop is even worst 1-5FPS, actually disabling dynamics did not have a big impact, and my materials are pretty basic, from 45FPS and optimizing it the most of my knowledge I can only get 48FPS.

I wonder how can we optimize Groom hairs, please help

2 Likes

Just updating my post, I couldn’t make it work, FPS is still bad even trying everything, so I went back to haircards, but I’m also having issues with masked materials while using “Super resolution (TSR)” and translucent materials look blurry, so it is a lose lose LOL… but I will update it if I found any solution, but for the Groom system, I think you can use it for a cinematic trailer or short film, but not for a game.

2 Likes

I tried converting daz3d hairs into grooms with blender plugin and noticed that it creates a LOT of extra strands and huge polycount. Mine was like 1 million verticles large. And i got the same fps drop that you experienced. After reducing strands number fps went up considerably. I think there’s also a functionality to add hair cards that would help with performance as well.

1 Like

Thought I’d shed some light on this with my own experience using grooms.

In my opinion, grooms are not suitable for realtime gameplay in most circumstances yet. There are exceptions to this- The Windwalker Echo project uses grooms for example, and seems to maintain a playable framerate on my machine (RTX 2060 Super). However, the hair isn’t especially detailed and there is only one character on screen.

If you have a really powerful machine, it might be fine running a few grooms. But if you intend to distribute your game, keep in mind that according to steam hardware surveys as of Sep 2022 the most common GPU is a GTX 1060, which can barely handle a single groom, if at all. So while YOU might be able to run a bunch of grooms just fine, others will not.

There are some things you can do to improve groom performance. Reduce strand count, decimate the curves/vertices, use LODs, etc. And while these will provide some performance gain, grooms are so expensive to begin with that the gain simply isn’t enough to justify usage most of the time. It is absolutely not worth it to have your FPS drop from 120 to 60 or less for a single groom hairstyle.

I would imagine that you can get even better results by using Maya xgen or similar and creating hairstyles specifically meant for realtime gameplay (ie, very low strand count, tweaked over multiple iterations for performant results). But creating realtime hair this way is almost an entire career path in itself, and certainly too much for an indie dev to concern themselves with.

If you are creating a game that only has a single character that uses groom hair, you can probably get away with it with some optimization tricks. But if you intend to have multiple characters on screen, all with their own groom hair, save yourself the frustration and use hair cards instead. Banging your head against the wall figuring out ways to get grooms to be more performant is a waste of time, and hair cards can look quite good with decent materials.

7 Likes

First of all LODs are everything. Hair groom are THE most expensive of all grooms, you should start with it.

Open up your groom’s file, go to LOD tab on the right and change the LOD 0 settings to your liking. Changing only “Curve Decimation” to 0.1 made a lot of performance boost for me, but other settings are interesting too. Don’t forget to delete\edit other LODs.

Additionally, you can reduce texture size for MH materials, here’s tut - https://www.youtube.com/watch?v=YvB_drutelc.

Moreover, try forcing LOD of your MH mesh component in “Level Of Detail”, you don’t need 64k triangles, LOD 4 with 3k triangles - seems nice.

1 Like

UPDATE: anyways, grooms suck. I decided it’s more performance friendly to use groom’s mesh card, then exporting it to blender, adding weights for head bone, exporting UV map to photoshop, adding custom textures for hair strings and using all of it except for groom - literally zero FPS drop.

1 Like