- Home /
How to fix character mesh going through clothes?
I have a shirt with an armature. I have a script attach the armature of the shirt to the armature of the character. It works great, until the character's skin is showing through the shirt when the arm is bent. How could I fix this?
Here is a gif: https://giphy.com/gifs/3d-indie-gamedev-82YkdFc3Ul1alOpqQo
Hi @$$anonymous$$1010
You didn't explain much what you have done. Unless you did the skin weighting in Unity, you'll probably get better answers in Blender forum (I guess that is what you used...based on ter$$anonymous$$ology).
Oh, what I did is I have the character armature, then for the clothing, I have a separate armature. I then parent the bones to the corresponding bones of the character. I was wondering if there was something in unity that could prevent clipping. The clothing will be customizable so I cannot just erase vertices.
@$$anonymous$$1010 - Skinning is always a compromise, but in case of clothes, you'll also have to have exactly the same joint locations. Even then, if you do some sort of weight transfer to clothes from body mesh, you'll finally end having clipping mesh faces between body and clothes, as clothes are further away from joints. On thick clothes (farther away from body) it's less often, but skin tight clothes (t-shirt) it happens easily.
Of course you could use some sort of correction shapes and extra bones in clothes, but that is probably not suitable if you have various clothes.
Another thing could be offsetting clothes forward towards camera slightly using shader... this way you'd get render time extra "offset" to clothes, even if that didn't exist between body and clothes models.
Answer by LeeJBaxter · Sep 10, 2018 at 09:50 AM
This is perhaps a very "hacky" fix, but one way you could solve this issue is to make parts of your character's textures transparent (and obviously set up your material to use this transparency). Simply put, make the character's skin textures in the offending areas transparent using GIMP or a similar tool so that they don't show through the clothing. Again, I don't expect any votes for this answer (forgive me as I'm more of a coder than a character modeller), but it's a quick fix that I've used recently to solve this problem (note: it obviously won't work if the clothing over the offending areas has transparency that reveals the skin underneath).
I like this idea! Thank you! I will have to look into it. I don't think there will be any transparent clothing, but some skin will be exposed in different areas, depending on the clothing.
To be honest - this is a very good idea and one of only two I can think of. The other solution is to fix the skin weights so the arm pit vertex weights are stronger than the shirt vertex weights. This is a tedious process, but would be more optimal because the engine would not have to calculate a mask map when the shirt is applied to the character. However the mask map, to hide the areas that poke through is another option. $$anonymous$$ake sure the UVs of the mask match the existing UVs and the mask will solve the problem.
Okay, I will test weighting the shoulders on the shirt more, thanks!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Humanoid IK question. 1 Answer
How to import multiple UV Maps for a mesh into Unity? 0 Answers
Rendering a model inside a GUI rect 1 Answer