Handling Clothing

Started by
18 comments, last by Hilbily001 17 years, 5 months ago
Even then it would require me to set a skeleton for the clothing mesh.

I meant copying the animation as in loading the animation set for this particular character and playing it for both the clothing and the character.
Dave G.http://www.higstudios.comProjects:Project BU - Fast action pvp MOG
Advertisement
you still need to get the skinning weights from somewhere. On load you could find the closet "body vertex" for each "cloth vertex" and copy the weights into the vertex struct. May not look that great but it works. I would suggest what MidgardSerpent said and weight your clothes to the same rig if you want to avoid any artifacts like verts swimming in weird directions.
You can't just set the clothing to use the same set of bones as the body?
Quote:Original post by JasonBlochowiak
That's not correct. Base PhysX runs on the CPU and doesn't require hardware acceleration. The hardware acceleration allows for more stuff and more advanced effects.


Sure, it runs if you want to make a demo or something. But if you are in an actual game engine that cloth simulation is probably eating up a ton of resources and that's just for one. But every character in the game needs clothing as well.

Plus I think most cloth simulations look like crap anyway.
I would create a flag for each vertex in your mesh that tells whether its static (to the bones) or cloth. You'll probably need additional parameters such as weights and cloth characteristics. Then animate your mesh as normal (influenced by your bones). Next, go back through and apply some cloth algorithm to all vertices marked cloth. I know I've seen relatively simple implementations using a grid of points and "springs" between them. The springs in your system would be the edges between vertices marked cloth.

The only way to avoid copy and pasting (or "total wasting" in your words) is to make the system data driven.

edit: You'll probably want to transform your mesh into world coordinates before updating the cloth. That way non-animation movements affect the cloth as well. Also, you can't be afraid of a lot of code or you won't succeed.
Quote:Original post by MidgardSerpent
Quote:Original post by JasonBlochowiak
That's not correct. Base PhysX runs on the CPU and doesn't require hardware acceleration. The hardware acceleration allows for more stuff and more advanced effects.


Sure, it runs if you want to make a demo or something. But if you are in an actual game engine that cloth simulation is probably eating up a ton of resources and that's just for one. But every character in the game needs clothing as well.

Plus I think most cloth simulations look like crap anyway.


Non-driving cloth simulation for little bits of cloth on characters isn't particularly CPU intensive.

Cloth tuning, like pretty much all physics tuning, is more of an art than a science, and lots of people don't get it right.
Quote:Original post by MidgardSerpent
You can't just set the clothing to use the same set of bones as the body?


the problem with simply doing this is the underlying skin punching through the clothes during some animations. even though the geometry is weighted to the same rig, the actual curvature is different. you could just add a material on the underlying parts that doesn't ever draw to get around it though. easily fixed.
Making the body geometry underneath the clothing nonrenderable is one solution but then you are still calculating all of the deformations of the body when it's not even visible which is also a waste. What you could do is cut your character model up into discrete pieces that get swapped out for each piece of clothing. Rather than one continuous model you have it in pieces. Torso, head, arms, legs, hands, feet, all as seperate meshes. Then when the player wants to put on a helmet you just unload the basic head mesh and load the helmet head mesh in it's place. Then you have one skeleton and set of animations that each different clothing mesh could be skinned to and you just swap them out when needed.

This technique is used in the game Farcry, which actually has three modes of character clothing customization. Non deforming rigid pieces are just placed at the correct point in the hierarchy, deforming skinned pieces that use the same skeleton as the character work as modular limbs to be swapped out when needed, and deforming attatchments that use their own skeletons (like long hair, or a cape) work as fully seperate and individually controllable models that are parented to the hierarchy of the controlling character.
I'm not too sure, but what I'm probably going to do is just render clothing on the models. My team having to remodel or even chop up the models after intensive rigging would just be a waste. From games I've seen that use the swapping technique have noticeable quality differences from those that use whole models. Code properly written could distinguish nonrederable faces from renderable faces.
Dave G.http://www.higstudios.comProjects:Project BU - Fast action pvp MOG
Sorry for making a late post, but I found this post in a search.

First thing I do is cut the polys of the main model to make the necessary clothing. Then I alter as needed using scale and move on vertices to make the clothing bigger then the actual skin model. I export that model into Ultimate Unwrap 3d, delete any unecessary bones and save it as a .b3d file for Blitz3d. In Blitz, with some help of course, I use a function to parent each bone of the clothing to its same-named counterpart of the main model mesh. This way, when you animate the main model, the clothing animates also.

I designed my Blitz3d method a while back and it worked great on a shirt, now, months later, I made some pants and no matter what I do the underlying mesh pops through. I looked at some vertice alpha code, but in Blitz3d it really jacks up the main model. I attempted using masked Clothing textures made from the original skin textures, but this method really restricts on the type of clothing you can make, evidenced really good in Dungeon Siege, the majority of the clothing is Textured from what I can tell, still looks good, but Im looking for actuall model clothing.

So in closing, Im still looking for a good idea or routine to load up some clothing for my models, hahahahaha!

This has been a great post for throwing ideas around, keep em comin!
Hilbily001Admin@HilBily-Works.comhttp://www.hilbily-works.com

This topic is closed to new replies.

Advertisement