I was also worried about morph target performance, and did a test using the default Daz3D Genesis 8 male character. I exported the facial lipsync rig morphs also from Daz. The character had over 150 morphs skinned into the mesh, but I was only actively modifying the facial morphs in realtime while the mesh looped idle. I added around 50 characters into a map and did the test. The performance impact was only 10 fps or so, with the total staying above 90 fps on a midrange rig (6700k/1070).
For our project we are using Genesis 3 as the base frame work and have been doing so since 4.0 which at the time had a lot of deal breaking issues and at that time morphing was CPU bound and the performance impact of a single actor was a performance drop was between 25-45% and unusable. Since then the problems were solve by Epic so my thinking is Epic was aware of the issues and fixed them. So as a group we have been testing different configurations with the idea of including Daz Studio as part of our character development along with each update to UE4 continuing to improve.
Some test examples using G3
So in support as you your comments morphing, now being hardware rendered, is no longer an issue it use to be.
Just some thoughts
That’s interesting! So it looks like large amount of morph targets shouldn’t be a problem if they are not actively modified.
For example, if we have an in-game character creator with many morphs (things like head shape, muscle definition, etc.) that are used only during character creation process, we can probably still use the same character with all the morphs in gameplay, right…? They’d just be unused.
I’ve just found this plugin for baking morphs: Morph Tools Plugin - Marketplace - Epic Developer Community Forums
… So it looks like even if morphs are not used, they still impact performance…? I’ll need to test that, I’m quite lost here.
@ Regarding the first video, do you use the new 4.24 hair simulation there? Looks very nice.
@ Regarding the first video, do you use the new 4.24 hair simulation there? Looks very nice.
[/QUOTE]
No cloth simulation in 4.23. Same as used on the skirt.
“Large amount” is rather subjective as I mention only vertices that are moved relative to the master target is recorded so even if you have thousand of shapes the actual asset impact is rather low as compared to other necessary elements where performance issues are actually inherited. Complex shaders and draw calls can impact performance much more than an object with 100’s of targets. It’s just magic and mirrors as well as a bad rap that at face value morph targets represent an unacceptable performance loss. As to impact once again it’s all about context as to practical use versus the ideals of what morphing can do as a raw asset.
I think this was further optimized when they started to allow alembic file imports.
The vertex calculations on those cache files seem to be even faster then morphs…
|As far as my notes on performance impact: as of the latest test with a finished human (not using the latest hair stuff). In a fished scene, with 30 active morph, I see the same stats as I do for 0 active morphs.
Substituting the mesh to one without morphs I get a performance increase of negligible amount. MS slightly less, no actual frame change.
The morphs are all GPU bound by default. I have not tried forcing them onto the CPU - don’t think there is any point.
A small update to this in 2021. This pertains!
(I have been meaning to give feedback to this for some time now)
Going to keep this info in bullet point so as to K.I.S.S. because I am stupid. This is really a difficult concept and has a lot of variables that only the team can plug together. My game is a simulation based mainly in space inside ships and stations and needs really solid fidelity with a flexible morph and extendable morph animation system to handle the small details.
Sorry…no TLDR for this one.
Preface:
I used to use DAZ G2 Female and Male and wanted to move on to G3 or G8 but in the end decided that I needed to be custom but still use DAZ Studio as a tool. So I/We ended up with a hybrid. The below information is what I found via lots of testing and trial and error.
(Applies in UE4.18+ and Unity 5.6+).
Even if you are using your own custom body & face solution DAZ Studio with G2 F/M and G3 F/M are very good sources for getting a good feeling and testing your own morph animation since there are a huge number of morphs for free included.
There is a HUGE difference between a Character Designer and a Character with Rigging and Morphs ready for play. The Character Designer could be rigged but morphs essentially need to be OBJ (clean and no bones) and transferred to the game rig. I did not understand the importance of this…5+ years later…now I do.
My base LOD0 models are running at ~32k tris. You can have a look here for the details of my Genesys (not DAZ Genesis ) models. These are the Fit body morph and from 2018 and in Unity 5.6. The skin has changed from shown (less cartoonish) but the body models are the same. I’ll paste a pic of what the Average (base) body and skin looks like now (2021 May).
Links are safe but for adult.
Genesys Female Base Model – Stand Sure Studio
Genesys Male Base Model – Stand Sure Studio
Morph Target Animation and Body Shaping (Blendshapes):
-
4.18 was a big improvement. Morph Targets worked prior but was not as speedy as these later versions. I see no reason to use skeletal/bones to do facial animation.
-
Make sure to set Morph Target Previewer to Use GPU for computing morph targets. This makes a huge difference in performance. Been available since 4.14 but really came to life 4.18+
-
Morph Target Shaping is really fast. Even for animation in visual scripting (BP).
-
UE4 can easily run 50 32k models in a properly LOD set fleshed out environment. Just use AC: Odyssey as a visual for comparison. If you have the game play it and pay attention to the number of visible NPCs and the LOD details. See material/texture details below.
-
Even though UE4 does a great job at this try not to mix too many Morph Target type animation and skeletal. Meaning…use morph targets in lieu of bones instead of running them in parallel. If you want to make a smile then don’t have bones that could also do some sort of facial animation. There can be some positional fighting when the game gets hammered by taking care of things. This is also crazy difficult to solve/troubleshoot.
Note: Below I have 4 body types that blend together with 5 enhancers…so 8 morphs. Clothing also uses these same morphs and uses the same values to ‘fit’ the clothing. Performance is excellent because I use a very limited number of morphs to get the job done. -
All work has been done/updated in Blender 2.83. This was a massive task and still not done. Rigging is using Auto-Rig Pro from the Blender Market. All morphs in this rig PRIOR to rigging with ARP. I have not added any morphs to this so I really don’t know if something will break or not. I sometimes use iClone7’s 3DXchange7 to pre-process animation re-targetting to the iClone7 bone format then export out then into Blender to ARP re-target. Works very well. This animation is for the BODY portion. Facial animation is handled via audio amplitude and morphs.
-
Specific note to the above. Morphs should be well thought out and taken care of during the modelling process PRIOR to rigging and animations. I was doing this in parallel for some time (since I had no animators except me…and I am terrible at it! ) and had lots of issues with fitting and updates. Ended up scrapping everything and start from scratch. Painful but I am so glad I/We did this. Hiring contract based animators and clothing modellers is soooooooo much easier now.
-
Keep your morph animations fairly straight forward and simple. Meaning try to use one morph instead of three for the same effect. Example: Happy…combine multiple morphs to make one ‘Happy’ morph and drive that via script (BP).
-
Try to make recipes of morphs for shaping. This is related to the above.
Example 1: make a variety of nose shapes and make each ‘Nose’ a morph. Drive that by script with a Nose Selector. Each facial feature should have a set. Not many sets at all. You will be amazed at how many heads you can make with 10 head shapes, 10 mouth shapes, and 20 noses.
Example 2: Make four body types and use a triangle selector to blend the three morphs over the the main body in the center. A few games do this. Saves a huge number of morphs.
Example 3: Use about 5 morph ‘enhancers’ to add on top of the body result. This is to make a body trim, fit, heavier…etc.
-
Try to limit your morph targets on your model to 100 max. From what I have experienced is that more than this starts to decay performance of the frame. 50 x 100 = 5,000 morphs analyzed on the GPU each frame. These have a CPU cost as well since they have to be relayed back and forth. Less is better of course.
-
Use data tables to drive the recipe data for the above so you can make hundreds and thousands of body combinations in Excel and import that into UE4 data table(s). This also works at runtime to make random NPCs via their spawn in script.
-
Lip Sync to Audio. Audio amplitude to morph via script works really well. Even when the camera is within a meter it is Okay. You can ADD expressions and make personality combinations to this while the audio is driving the jaw bone via script. Works amazingly well and is very much Good Enough.
-
Make sure clothing is skeletal (bone driven) and not overlapping any of the morph targets being driven by script. Think of clothing as a character. The obvious one here is the lip sync with morphs. Keep the bones to a minimum…like one jaw bone…and morph everything else with recipes.
-
Skin and Clothing try to use one or two textures per piece. Wait…how does this relate to animation? It does…heavily! It chews on memory and when this bogs down from processing the morphs have trouble working…as with lots of other things. Skin should be one face and one body then use alpha to hide skin where needed. You can add textures and use a material collection to change texture layers at runtime super easy. And STAY AWAY from 4k textures unless absolutely necessary. Use primarily 1k textures then 2k where needed for large objects or needing that extra detail. Massive performance improvement and 1k is perfectly suited for up to 1440p. Yeah…I know…artists LOVE 4k & 8k (Unreal Marketplace anyone? ) but those are NOT normal game ready. Fine for some things but very limited scope.
================================
I am sure I forgot something but mostly things are covered above. Bottom line is morph targets perform very well in UE4. The added benefit is there are tons of opportunity for runtime based animation and shape changing that ‘classic’ bone animation simply would be a massive amount of work to do.
Thanks for taking the time to read.
Cheers!
Olander
What the base model Bridget/Brighid looks like now.
Hey, sorry for bringing up an old post.
But were there any updates to the morph infrastructure since then?
I cannot find many resources on how to implement a clothing/armor system for modular characters using morph targets. Would be cool to see how a base system would look like.
Thanks!
Question to all: what is better performance (less draw calls or whatever):
If I have a clothing mesh like a jacket that is zipped up vs unzipped:
- Should I import 2 meshes for the 2 states? (2 meshes would load in the game, share same Mat.)
- Or in Blender should I add the unzipped mesh (verts) as a Shapekey to the main Zipped mesh; and in UE drive the open/closed with a Morph target? (1 mesh, 1 Mat would load, but extra morph target cost on the clothing + the body morphs.)
- Edit: I cant do #2 because Blender will not let me Join a Mesh as Shape key, if it has unequal verts. Gives an error. My unzipped mesh is too different.
To answer TRoman07:
I have a modular character with extra clothing meshes that go over the body.
So if your body is going to have a thick/thin body Morph, then you need to add that same Morph name to every clothing mesh, or else when Body changes shape, your modular Clothing will clip (overlap).
So in Blender, when you make the thick/thin body change (2 meshes > converted to Shape Key) - you also need to make 2 mesh versions of every clothing piece that will be affected by the body.
- Thus I think that you should NOT use Morphs for thick/thin bodies on modular characters (many extra clothing meshes).
- Instead you should scale a Bone (AnimBP change) that affects thickness on the Body verts/Weight paints (and thus matches on all clothes that share the same Skeleton) - if possible.
- Then you dont need to add shapekeys to every clothing that might be affected by a body shape change.
- But for small body changes that dont affect clothes, like Ears - then I think Morphs may be easier to setup. Not sure about performance.
Can you tell me which Cloth sim you used (what did UE4.1 call it); and was that game viable?
-
I went from UE2 to UE4.27, and now 5.3.2 is out (with a newer Cloth sim).
-
Thus I am unaware of what worked in game, if any. (I know that the 5.3 version works for previewing, but they said it is still too slow for games without a highend PC.)