Hair and boo.. *ahem* other body parts physics

tobaccomonk

09-10-2007 10:04:30

I wonder how the simulation of hair, clothes and other body parts are done in games like Virtua fighter, Dead or Alive... etc.

Probably an orthodox cloth simulation would kill the framerate, so is there a work-around to implement the same effects using NxOgre?

betajaen

09-10-2007 11:01:34

I dunno. You could mimic hair with cloth; not for every single strand of hair, but clumps of hair (with a hair texture). As long as it's not an insane amount per human hair, and has a low amount of vertices; say 3-4, with 16 vertices each should be pretty fast.

I saw a video a few months ago using a physics engine (I think it was Havok) that used ragdoll's which had to had full motion; walking, running, etc. Not only that it reacted with collisions such walls falling onto parts of the body, or an arm hitting on a wall.

tobaccomonk

09-10-2007 11:19:53

Definitely a cloth-per-strand would be hell on earth :D
I think the low vertices hair clumps is a feasible idea, thanks.

But did you do any kind of testing on the relation between the number of cloth vertices (in general) and degradation in framerate?

I've seen a similar video (Havok + Euphoria), and it's pretty impressive!
http://www.youtube.com/watch?v=3bKphYfUk-M

betajaen

09-10-2007 11:37:32

I've had good framerate with cloth; I've averaged 60 FPS (with Vsync on) with about 32 cloths with a reasonable amount of vertices. I think a few cloths with less than 64 vertices per head would be pretty fine and okay on the frame rate.

That isn't the video I was thinking about, but it's a good one. Poor Indy. ;)

tobaccomonk

09-10-2007 12:18:50

Hmm.. this is off-topic, but I'm interested to know whether it's better to have vsync on or off. To be more specific, I'm coding a game that shall run on 60 fps, so would it be better to set vsync on?

Now back to topic. I will be experimenting a bit with different cloth qualities and hopefully will be able to report some testing results.

On the other hand, could a free-moving (ragdoll?) physical entity (has a mass) be attached to a bone in a skeleton (where that bone is used in rigging a non-physical mesh). For example, think of a character's "dead" arm, where the arm movements are not controlled by the skeletal animations, but rather by the physics (gravity, torque, external forces... etc).

And yeah, poor Indy. Life isn't fair, but at least he tried his best :wink:

betajaen

09-10-2007 12:23:52

I've always said leave it on. Most monitors run at 60 hertz, so rendering at 120 FPS, you loose 1/2. So it's a waste.

As for that stray limb, I don't see why not.

NickM

09-10-2007 16:25:03

From memory I thought hair was done via a shader?

tobaccomonk

09-10-2007 21:39:32

From memory I thought hair was done via a shader?

Could you explain a bit further or give/show examples? I can imagine that the hair itself could be done using a shader, but what about its dynamic motion, especially when in a force field (gravity and wind for instace)?

betajaen

09-10-2007 22:15:07

I don't think it's really possible, well without at least a some collision and basic physics code in there.

tobaccomonk

04-04-2008 04:30:58

Oh well, it's been a while.
I'm back with some more questions, or rather... I don't know, maybe some stuff to ponder upon?

All right, so here we go. In the video game Virtua Fighter 5, Sega's developers were reported to implement their own "homebrew" physics engine; but it was mainly used for aesthetic stuff, like clothes and hair simulation.

I came across those screenshots from the Japanese website of Softimage's XSI (customers' showcase) and they show that Sega's developers have used some bones for the hair, the gi top (karate suit) and the obi (belt) for their Akira character.





As far as I understood, those bones rig the meshes of the hair and clothes, and are used in the physics simulation.

Now the problem is, given that the animation of the character is not a smooth transition all the time, attaching physics bodies to the bones won't be the best idea as it's quite possible to have huge translations/rotations from one frame to the next, which would create unrealistic effects (as if the hair/clothes have moved with enormous velocity all of a sudden).

A workaround that I could think of is to have predefined (dis)locations of the hair/clothes bones at the start of each animation and disabling the physics between animation transitions. As an example, let's assume the character has a ponytail (cute :P ) and has 1) standing, 2) running, 3) jumping and 4) crouching animations. In the begining of the standing animation, ponytail bones are reset, in the beginning of the running animation they will be slightly tilted upwards; jumping -> slightly downwards; crouching -> upwards.

Sure of the initial conditions of given bones at the start of each animation are well defined, then one can also add the initial velocity and acceleration, but assuming one would stick to the simple initial position perturbation, do you think it would produce "good" results - both frame-rate wise and perceptually?