Hello everybody ! I'm new here , however i reading forum for a long time . And i have a question about cloth animation in real time , i have a character who's dressing a big apron (like butchers or so ) . I gonna rig him , but i wanna that apron can be animated then , at least a back and forth moving , don't remember many games with that stuff , but if you remember that cloak in Soul Reaver series , how it moving , it was done with bones ? . I've searched here on forums and in other places , but didn't find any lessons . I know nothing about cloth simulation in games , so can someone explain the whole idea how it going ? Thank you all !
Replies
There are a few tutorials floating around that have bones follow cloth dynamics you set up and run in the 3D app of your choice, but they still relay on well placed bones.
For a butcher's apron on a one-off character, I would just use bones. Depending on what you're doing with him, you could either animate it by hand or potentially create a sim or simple delay of some kind and then bake that to the apron bones.
Works pretty well on everything I've seen in game.
Rockstar Table Tennis on the360 used real time cloth for the players clothing (and POSSIBLY the net), but anecdotally I've heard that used an entire core for processing.
I recommend bones as well but make sure you speak with your animation programmers. You don't want to require a static pose between each animation. So you'll require some good animation coding. A combination of physics + bones = win
I think that Havok's latest update includes in-game cloth animation for animated characters.
Why not simulate your cloth motion in your 3d app, then bake that into the geometry using a point cache solution. Then export that motion into your game engine?
Has anyone tried this, or can you think of a reason not to do it?
However, in my experience, rigging cloth to bones is no trivial exercise. Its really labor intensive in fact, unless Im just doing it wrong. Do you know of an efficient method of rigging cloth with bones? A dress, for example, I'd hang a chain of bones in front of and behind each leg, and one off to each side, with a spline IK controller running a cloth sim on the spline. Envelopes almost never give me the results I need, so I usually end up weighting each vert by hand, hence the labor!
For this game we're working on, I'm not interested in real time dynamics or interactions with anything, I just want the cloth to have convincing motion, and I've never seen a rigged solution look better than a cloth sim. Obviously, if its too expensive, i just have to look at some other option, but I'm really hoping I can make the clothes look natural.
It's not just the file size of the point cache you have to worry about but the ammount of data it has recorded and now has to be streamed in and updated. Point cache files actually compress pretty well so their file size shouldn't be the deciding factor. The more dense the verts the more data needs to be updated, especailly if very vert is moving. Point cache might work on something like a head band tail, or a small portion of a coat or maybe a cape, a dress might be too much.
Using the point cache is the right idea, but instead of recording the placement of every vert per frame, you record the postion of a handful of bones and the influance they have over surounding verts. Same idea, less intensive, much more friendly to real time.
I think the part that is hanging you up, is that you're using bone rotation instead of bone position. But that really depends on the engine. It also depends on the style of the dress and the engine you're using as to how you should rig it up. It also depends on what app you're using... I'll try to keep things theoritical and generic.
Normally you get your cloth sim working great with a pretty high poly piece of cloth. Then place free floating bones around the cloth. The bones aren't linked in a chain but linked to the pelvis. These act as "listeners" and are constrained to follow one vert (or average across a few verts) on the cloth sim object. It depends on the engine as to how many bones you can have. You also need to be mindful of how many bones influance a given vert.
If the cloth is really important and it covers the legs, you can start hacking out bones, maybe use 1-2 spine bones instead of 3-4, wack out fingers, toes ect... to free up enough bones for your cloth. Make sure you're only applying cloth to moving parts. Think back to Max Payne's coat, only the ends had a cloth like effect the rest of the jacket was ridgid.
Then there is another copy of your cloth object that is skinned to these bones but does not contain the sim, sometimes much more low poly. This piece is the final output and what people will see in game.
So bascailly your bones are following and recording the cloth sim and translating it to bone position data. If you're using UE3 there is a setting when you import the character to use free floating bones (I forget what its called, but its a check box).
It sounds like a good middle-ground solution, and I'll work it into my tests. Im sidetracked on another project at the moment, but I'm going to switch back over to the cloth thing, probably next week.
Thanks Again!
[ame]http://www.youtube.com/watch?v=SGBuw8t6JFg[/ame]
lil'bit O' Necromancy going on... but some good info added
I figured it was better than starting a new thread... you know.. keep the information in one place. For searches and stuff.
Nice, now make the dress go down to the floor, then wrap it in a long trenchcoat with wizardy sleeves, and you'd be getting close to the designs I'm having to deal with! ; )
24 bones for just the cloth...
Yes but do your characters have to ALSO flip and move like Jedi?