I am beginning to work on a standard clothing and character customization system for my game (similar to the clothing systems in most RPGs like wow, darksouls, skyrim, etc) where players can mix and match any combination of armor/clothing pieces.
So far I have two base character models that were created with MakeHuman, so the player can choose a male or female, and then scale the bones to alter height and size, and also choose from a few different hair styles/colors, etc etc… The clothing and armor is created with the MakeHuman models in Blender by using the shrink wrap modifier, so that it fits the model well and shares the correct vertex groups so the clothing is properly is animated when attached to the base model.
But now I am struggling to determine what is the best way to set things up so that every piece of armor can share a material and be batched into a single geometry.
I had two ideas so far, but I am not quite sure the first solution would work, and I’m not sure if the second solution may be making things more difficult than they need to be
-
Put every piece of armor/clothing and every cosmetic option into a single texture atlas, so that any combination of clothing can be batched easily at run time when the player model is initiated.
This seems like the obvious and best solution, but I will be frequently adding new armor and cosmetics options, so I think that would then require manually altering the texture atlas, as well as the texture coordinates for every piece of clothing using that texture atlas anytime I want to create a new piece of armor. -
I could try to make some utility that compiles a collection of textures into a single texture atlas automatically, and then modifies every model’s texture coordinates to match the new texture atlas. Then I could run that utility anytime I create a new piece of clothing/armor that needs added to the texture atlas.
The second option seems like it would be the best so far, but I think that could also be a somewhat time intensive task to create such a utility, and I am not sure if I may be overlooking a simpler solution, or if such a utility may already exist - so I thought I would ask for some input here before I start coding. Any advice or ideas would be greatly appreciated