Thread Hair Animation based on wind Direction for Godot Engine

Hair Animation based on wind Direction for Godot Engine by @antourenein

Very interesting twitter thread with an overview on how to perform Hair Animation based on wind Direction for Godot Engine.

Original Thread Hair Animation based on wind Direction for Godot Engine

Edited Thread Hair Animation based on wind Direction for Godot Engine

Some people seemed interested in a breakdown of this little system, so here’s a thread on how it works. 🧵

#GodotEngine #gamedev #indiedev

There is some preparation needed on the hair mesh for the in-engine hair shader, so, first I vertex painted the tips of the strands that come out of the solid base in white, while leaving the rest black.

https://video.twimg.com/ext_tw_video/1565165560245227521/pu/vid/998x720/cz_5-wiD9fGyFG7W.mp4?tag=12

Then I unwrapped a second set of UVs, with a small cut on a part of the surface that is usually hidden. It looks really messy and distorted, but it’s fine for this purpose.

I also have a rig for the hair, along with the character rig, so I posed the extremes of each wind direction in one frame and made them into separate animations.

After this, I animated a bit of wind intensity by hand in blender. This will later be blended with a more randomized vertex shader animation.

https://video.twimg.com/ext_tw_video/1565167245994692609/pu/vid/720x720/5DRPUOoyquSmmonh.mp4?tag=12

In Godot, I created a vertex shader that runs a noise texture through the UV2 and multiplies its influence by the vertex colors, so it only offsets the tip vertices.

Then it was just a matter of creating an AnimationTree and blend a BlendSpace2D containing the direction animations with the intensity animation and adjust the shader material values.

Note: remember to filter the animation blending to the hair bones only!

And there you have it! An interestingly functional solid hair mesh.

For those who are curious, this is Claire, a character from an original game I am creating. Her design is not final right now, but if you are interested in seeing more, please leave a follow!

https://video.twimg.com/ext_tw_video/1565168177507700736/pu/vid/836x720/BBwz_2NsMlEWorGK.mp4?tag=12

Originally tweeted by antourenein 🍇 (@antourenein) on September 1, 2022.

For More twitter threads Click below

Leave a Comment

Your email address will not be published. Required fields are marked *

Exit mobile version