Bodyfit armor

Started by
6 comments, last by Kwizatz 11 years, 4 months ago
Hi.

In my current project I want to implement clothes and armor that can fit to different body sizes and shapes. I have an rough idea of how i might achive it but I want to know what the best way is incase im way off.

Lets take chest armor as an example.

  • Im asuming il need to define a set of points on all character models chest, back and shoulder area and then a matching set of points on all pieces of chest armor.
  • When moddeling the chest armor every one of these points could be a bone and the vertices will be weight painted to these bones.
  • When moddeling the characters il create extra bones (one for each of these "points") that extend from the existing bones in the character. These bones will likely end on the surface of the characters skin.


for rendering

  • If a character then has a piece of chest armor equiped il connect the bones of the chest armor to the special armor connecting bones of the character.
  • Il then transform the bones in the chest armor by the difference between them and the ones in the character. Il define a "center" bone on both the charcter model and the chest armor. the armors center point will be placed on the characters "chest armor center point".
  • Might make sense to make an simple algorithm that first scales the armor as a whole to the extent where as little as possible transformation needs to take place in the above mentioned point.


Does this sound about right? if not what should I be doing.

Thnx in Advance!
Advertisement
Why not use vertex morphs? That way you don't need any extra bones and you could give more detail to your clothing/armor.

Basically you could have a vertex morph for the skinniest character body and one for the heaviest, and interpolate in between, you could have morphs between male and female, musculature, etc, then you assign a weight for each morph per character to be applied to the armor.
Might end up needing quite a bit of morphs. Especially if my game contains multiple humanoid races each with slightly different body shapes. And if I add a new humanoid race it will mean id have to go back to all existing items and create more morphs. Would my approach be inherently bad or limiting?

IMO, Its not bad per se, but it is limiting.

For example, the amount/size of uniforms in a vertex shader is somewhat limited, if you want to do skeletal animation on the GPU, you'll find out that you will be constrained to use between 50 and ~64 bones, a humanoid character can easily take that amount depending on how many fingers it has, nodes for the spine, etc. if you have to add bones for armor the amount of bones goes up, which means either do the animation on the CPU or adjust the skeleton (removing non escencial bones from the body) to fit the uniform limitation.

Also, what you'll be doing is pretty much the same as a morph, but using a bone to move several vertices at once instead of one at a time, this could limit how well the clothing would envelope the body, whereas with a morph, you'd have a finer control on how the armor envelops and folds on each character type. I may be wrong, but it would seem to me that about the same amount of work would go into tweaking bone values as it would go toward scaling and stretching the armor for a morph, I don't see where you would be getting something for free (IE: done with one piece of armour, done with all of them kind of thing).

About the bones. I would probably draw the naked character model in one call and all pieces of armor in their own calls (using only the bones applicable to the armor) so I dont see why uniform limit would be an issue. The "connection bones" in the character model wont be sent to shaders for rendering the naked body since no vertices are connected to them.

The reason I think going the bone route would be less work in my case is because when I have alot of different items (possibly 100's) and I decide to add another slightly differently shaped humanoid model to the game the morph approach should (in my mind) force me to create extra morphs for all existing items whereas with the bone approach I would not need to modify existing item models when a new humanoid model gets created.

With the morph approach i need to modify potentionaly 100's of items each time i make a new humanoid model

With the bone approach i need to only define the extra bones in each character model. no need to modify any existing models.

Is my logic flawed somewhere?

Il find it an acceptable tradeoff to loose some flexibility if I can save alot of time moddeling. The game is cell shaded and models dont have a terrible amount of detail so as long as it works and it actualy saves time il be happy. I have allready thought of a couple of ways to hide small pieces of the characters body that will inevitably stick through the armor using the bones approach :D

Well, why not generate the morphs from the bones offline? you add a new character, adjust the armor bones in your favorite 3d modeling package, and then run some script over the existing armor library to generate the morphs for the new guy offline.

I guess the way you're thinking it is fine if you don't mind about the extra runtime computations and the state changes when switching from body skeleton to armor skeleton.

Its not the way I'll do it, but I am the guy who tries to do as much as posible offline to squeze the most performance during runtime, I am the type of guy who sets the compiler for speed rather than size smile.png, your approach won't bring the computer to its knees, and aside from the limitations I mentioned I can't think of any other that stands out, usually you are in the middle of the implementation when they come out, so you'll never know until you start programming.

Ah. I didnt think about generating the morphs like that offline. Im going to go ahead and implement it like I was thinking and then when (and if) I get an acceptable implementation Il consider (depending on how it preforms) to generate the morphs offline instead with a script.

If some unforseen reason why this wont work crops up Il just have to revert to moddeling all the morphs by hand.. wont be terrible I might just severly lessen the amount of races in my game or elves humans and orcs will all use the same base mesh :D

Thnx a lot!

Sure, No problem! have fun

This topic is closed to new replies.

Advertisement