[Bf-committers] Durian/Hair Troubles

Brecht Van Lommel brecht at blender.org
Wed May 19 01:24:48 CEST 2010


Hi Jens,

On Tue, May 18, 2010 at 11:45 PM, bjornmose <bjornmose at gmx.net> wrote:
> I don't know too much about Daniels implementation of the ODE solver.
> But in general:
> GC  is known to find a local minimum if:
>
> <snip>
>
> I hope i could give some hints.
> If I was not clear enough, don't hesitate to ask.
> Some times I assume 'simple facts' to be known, ignoring it took me 20+
> years to sort it out :)

I looked for larger distances, but on the instable frames, the forces
were no bigger than other frames, and the initial residual (Ax - b)
wasn't bigger either. So investigating the other values you suggested
may be a good idea.  But at this point I'm happy the sim is now stable
for the scenes I've tested, and I'm hoping that I can just leave the
integrator code and focus on other problems.


There's two problems that I'm looking into, but would also appreciate
any ideas or help on these.

Currently the scene Campbell posted seems to be simulating stable
without collision, and the hairs are going through her face. Collision
is reportedly problematic but I haven't tested it yet, is first thing
I will do tomorrow. Getting a smooth collision response is important
here, we don't need the hair to be right on the head, if it stays some
small distance that's fine, but no jittering.

The second problem, that is actually multiple problems, is that we
can't get the forces right so that the hair is both moving enough when
it supposed to while still preserving the original shape when it's
hardly moving. To preserve the original shape we need to push up
pin/goal stiffness, damping, etc, which kills all the interesting
motion. If we don't the hair starts losing shape, which is clearly
weird for a nearly still shot. For more dynamic sequences when we
lower those parameters, when the hair comes to rest again it has lost
it's shape and is just hanging down straight along the z-axis (also
visible in the trailer when the little dragon is grabbed).

It's simple to test, just run the sim with sintel in armature rest
pose, in the provided scene, her hair starts losing to gravity.
Tweaking hair weights and parameters can give acceptable results for
different scenes, and this is what we may end up doing (and are
already doing), but I would like to get it to do the right thing more
often.

One way to look at it is that the hair shape sintel has now is
actually not the right rest pose, but is what we want as the
equilibrium when gravity is acting on it. So here the rest pose for
the sim should be such that when we run the sim her hair starts
falling down into the shape that was specified. Not sure if we can
actually do anything in practice with that insight, or if that
mismatch is really at the core of the issue. Another idea is to make
the pin/goal forces work a bit different, so that they get activated
more when the hair is moving less or nearer to the rest shape.

Also, bending forces are really not working well, the extra springs
between every other hair vertex have multiple solutions and can push
the hair into incorrect shapes once it flips. Ideally angular springs
would be used, but they seem too complicated to implement in a
reasonable time. I guess the goal forces will just have to compensate
for them, or perhaps there's some tweaks possible to get them a bit
better.

Thanks,
Brecht.


More information about the Bf-committers mailing list