SamuKata
colortwist
colortwist

patreon


Volumetric hair rigging and shoulder sliding

This is something I've been working on recently. I was really hoping to be in production by now with that image sequence I previously mentioned, but once again various technical limitations have crept up and gotten in the way.

This time it was the hair.

Long story short, my insistence on using actual 3D hair (rather than polygon strips with a hair texture applied to them) has finally swung around to bite me in the ass. I've always known that the systems involved were fairly inflexible when it came to hair rigging, and I just sorta accepted the fact that I'd have to modify my hair styles for each and every character pose depending on the scene and fetish mechanics at play.

While this kinda works, it also kinda doesn't.

Originally I was depending on the fact that I could have a default hair style setup inside my character files and modify those on a per-scene basis whenever required. The general idea was that by leveraging external references, I would only ever need a single copy of my character sticking around that I could import into a variety of different scenes. Any changes made to that character would then be automatically updated in each scene that referenced it, which is a massive boon if you're dealing with 20-30 comic panels and something needs to be fixed in all of them. At the same time, the xrefs should automatically save any changes I make to the character within their individual scenes- so things like posing or hair sculpting would only be saved within the scene they depend upon, rather than the actual T-posed character file itself.

This all works great except for the hair bit. For some reason utterly beyond me, C4D won't save modified hair guides under a xref object- probably because the hair object doesn't inherit from the same point object class that the polygon and spline objects do (which can both be manipulated and saved inside an xref just fine).

To say that put me in a bit of a pickle would be a huge understatement.

I've always had a workflow in place for doing *really* custom hair sculpting- specifically things where a character is horizontal or completely inverted, and the hair needs to flow down in the direction of gravity. However, this process is extremely time consuming to setup and rife with minesweeper style "gotcha, go start again!" bugs and glitches. It's not something that I'd want to do for each and every scene unless absolutely required.

However, xrefs won't save modified hair points- so I can't just modify the existing hair style to fit whatever basic pose I'm dealing with (where the head is cranked to one side but the character is still relatively vertical). Which means I'm pretty much screwed in that regard- either I'd have to do completely custom hair sculpts for each and every pose, or nothing at all.

Now, I should probably mention something else- hair inside most 3D applications tends to be very monolithic and somewhat inflexible. Normally you can't rig it or expect it to follow around with the character. Once you've sculpted the guides, that's it. They turn into rigid lines that track the surface they're rooted into, but only as a single solid object. Some programs do offer a dynamics option that will allow them to flap around in the breeze, but such systems are typically wildly unpredictable so maintaining a consistent look across scenes can become very difficult.

So the ultimate question is this: "How on earth do you rig hair (assuming you even can), and if you can, how do yo make it preserve a reasonably realistic appearance as the character moves around?".

Even if you could directly rig the hair guides to follow the character, it wouldn't look very realistic because the skinning doesn't take into consideration the elastic effects of a finite surface area. That is to say, character skinning in 3D will do whatever you tell it to do- even if that means stretching out something that shouldn't actually stretch.

Hair guides are one such thing. You don't want them moving around with a character and getting stretched out or compressed. The guides as a whole need to maintain a consistent length, which means the tips of the guides will always be moving up and down across the surface they lay against- in the case of a vertical character, that would typically be the back of the spine. As the character turns their head in one direction, the guides need to retreat up the opposite side of the back and extend down the other. If the character looks up, all the guides need to extend down the back of the spine, while if the character looks down, they all need to retreat up.

This is an extremely important aspect of hair realism, and exactly what I set out to solve.

I wanted to create a system that would allow me to volumetrically bind the hair guides to the character skeleton, but also preserve some important characteristics of the hair guides like their initial length and smooth natural curvature. The combination of all three things would naturally lead to a simulated effect of "hair sliding", where the movement of the character's head would ultimately drive the position of the hair guide tips, causing the hair as a whole to slide up or down and over the shoulders in a semi-realistic fashion.

This is a demo of the system I came up with.

It's still a prototype and I need to convert it to C++ (it's currently written in Python and really slow to evaluate), but it seems to work well enough and exposes enough flexibility that I should be able to fully rig the hair and while still maintaining a reasonably realistic appearance in a completely deterministic fashion. It's not perfect, but at the same time it doesn't really need to be- this is simply the system I'll be using by default if the character is vertical. For anything else I'll still have to custom sculpt the hair, but that shouldn't be so much of an issue if I only have to do that for 10-20% of the images I'm rendering.

The left pane in the video is what hair guides do by default in C4D (they just follow the scalp). The center pane shows the hair guides under control of my custom rigging solution, and the right pane shows a partial preview of the generated hairs as constrained by the (now fully rigged) hair guides. This system operates in realtime and requires no physics simulation or pre-rolling to operate, so you get live feedback as the character moves around in the viewport.

Volumetric hair rigging and shoulder sliding

More Creators