I know unity doesn’t have anything like morph targets or anything by default, so what’s a good way to make customization for body shapes(muscles/fat, height…) and face.
Either in some alternate way or with a plugin maybe.
Using armatures if you can…
or http://forum.unity3d.com/threads/15424-Morph-Target-Script
Armatures? Tell me more.
Armature might be a term specific to Blender I’m not sure… I’m talking about using bones and the SkinnedMeshRenderer component… the same way you animate a character’s limbs for example. Something simple like blinking, mouth opening etc. can be done with this method.
Depends on your particular need.
I’ll address the static ‘model creation’ technique that I’ve employed before. Create model A and model B with the same number of vertices. This is fairly easy for humanoid shapes. Say, create a fat human and a skinny human. Then, in Unity, you can pull in both meshes, take them apart and establish a correlation between skinny vertex position, lets call it v_s and fat vertex position, v_f. Then we have an array of vertices, v_f[ ] and v_s[ ]. Then its a simple matter of just creating a new vertex, and interpolating the position using Vector3.Lerp…
So v_new = Vector3.Lerp(v_f, v_s, 0.25f) would effectively create a slightly fat human…
I’ve actually done this before, and was quite pleased with the results.
Sounds ok, but wouldn’t that kill performance a lot, because you load 3 meshes in total?
Once the new mesh is created, you can unload the other two. The generation of the model would obviously take time, but even on mobile devices, processing ~3000 vertices isn’t a whole lot.
Yeah except 3k vertices is very little actually. My main character at max quality is almost 30k
Then you (likely) aren’t on a mobile device and 30k vertices is nothing to most modern desktops. Especially for a static build.
Okay Ill try your method, but how could I blend multiple morphs? For example one for face and one for body. Wouldn’t loading second mesh nullify the results of first one?
No, suppose you model 3 different body types.
Fat, Skinny and Muscular.
To generate a particular body, you need to calculate the weighted vertex position…
v_final = v_fat * fatWeight + v_skinny * skinnyWeight + v_muscular * muscularWeight
realize that fatWeight + skinnyWeight + muscularWeight === 1, which means they are 3 components of a normalized Vector. You could have an infinite amount of source bodies.
Hmm very interesting, thanks for the info.
I assume height would be about the same? Hmm