This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

I have low poly 3D character with dress. But as it animates, some faces of body comes out through the dress. Is there a way I can hide the poly behind the dress mesh whenever the character is wearing a dress?

in Engine by (13 points)

1 Answer

+2 votes

You've entered an exciting world of multilayered meshes. This topic is kinda complex but there are several solutions.

  1. Fix the animation of clothes in Blender (or Maya/Max/whatever). This involves a lot of fiddling with weight painting and it can take a lot of time. The idea is that you have the body mesh under the clothes but the animation is clean without clipping.

  2. Select in Blender every face which is under the clothes and put them to one vertex group. At the export time, select the group and delete the faces. It's not the best solution because you can accidentally save file with deleted faces. And some faces still will be partially under clothes so some clipping can occure.

  3. Create a custom shader for clothes. Multiply a vertex in vertex shader by value between 0 and 1 (VERTEX = VERTEX * 0.05). Play with lower values first. This will push vertices closer to the camera which means less clipping. Or try the opposite. Multiply the vertex by value higher than one in shader for body.

  4. Simulate clothes in Blender and bake the simulation. It will be hard to get results you want but I think it should be possible. Godot right now doesn't have cloth simulation but you could bake the animation elsewhere. This should prevent clipping too.

  5. Create the occlusion map and use it to hide body faces. I can't provide you with concrete implementation because I didn't try this solution yet so I will leave you with this blog post:

by (836 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.