Jonathan Coetzer has shared an extensive tutorial on some advanced tips and tricks for grooming in Houdini 19 and told about a simple method for Houdini to Unreal Engine workflow.
Thank you for checking out this tutorial, my name is Jonathan Coetzer. I am a CFX artist in the film and commercial industry. In this short tutorial, I will be going over some advanced tips and tricks for grooming in Houdini 19, specifically pertaining to curls and braids. I will also go over a simple method for Houdini to Unreal Engine workflow.
For the base geometry in this tutorial, we will use a MetaHuman from Unreal’s MetaHuman Creator. The base geometry of the head is exported from an Unreal Engine scene as an FBX export. The FBX can then be imported into Houdini using a simple File node. A few simple operations follow to prepare the geometry for the grooming process.
Firstly, a Transform to bring the geometry into the Houdini scale and a Delete to isolate the highest res LOD head mesh as the import will bring in all LODs from Unreal. A blast follows to clean up some problem areas such as the eyelashes and the eye lenses. Lastly, delete all the unnecessary attributes such as Cd(color) that are carried in from the import and close up the mesh to allow for an easier VDB process for the groom later on.
This could be done quickly with a Polyfill or as shown above by extruding out the base edge loop followed by a polyfill to create a solid volume.
Using the geometry we have prepared as the skin for our groom we will drop in the first Guide Groom. The basis of the grooming process in Houdini is the Guide Groom Object Node which constitutes the workspace for our guide setup and guide grooming process.
Start with assigning the Null output of our skin geometry to the SOP path of the Rest SKin Source. Next, change the override of the density to skin attribute and change the name to your requirement. In this case, I have left it as default density. Click on the icon next to the name. This will create an Attribute Create and Attribute paint Node above the node you assigned in the SOP path.
Using the attribute paint simply fill the geometry with a value of ‘0’ (Blue) and paint in the area of the head where you want the guides to be scattered with a ‘1’ value (Red). Also, adjust the density of the guides to a medium-density as shown in the image above.
After that return to Object level and go inside the Guide Groom. Create a guide process (set length) node. Change the mode to "multiply" and activate randomness, then adjust the min value to be slightly below the max. This will create a little more breakup in the length of hairs generated going forward.
Go back to Object level and place a Hair Gen object node. This is the node used to generate the hair curves around the guides created by the guide groom. To assign the guide groom as the groom object for the hair gen, simply drag the guide groom node to the parameter field of the hair gen node labeled Groom Object. The result should read "../guidegroom".
Assign the density attribute created earlier in the same fashion using the skin attribute override. Adjust density to the desired number and then repeat this process for thickness. This will grow hairs across the head and due to the nature of the attribute paint tool having a falloff, will make the hairs on the border of the density attribute thinner and allow a better-blended hairline.
Should you see gaps where the hair doesn’t grow evenly on the head, adjust the influence radius until full and use density for skin attribute override if required.
Going inside the Hairgen, place a clump node and connect the skin input. The clump node is a very powerful and versatile tool in Houdini's grooming kit. Using it you can achieve a wide range of effects and looks. In this case, we will be making use of the curling feature in an unintended way to simplify a usually complex process.
Using the clump node set the base parameters:
After the base parameters, we go to the curling tab. The basis of the technique used here is to overdrive the frequency, set the amplitude low and drive the frequency to a value in the range of 1000-1200. Feel free to play around with these values as you may discover some interesting results. By slowly adjusting the amplitude now you will see that it has begun to act like a size control for the tight curls generated.
As an added modifier add a set length guide process and, using a skin override, paint an attribute to decrease the length of the hairs near the hairline to make the groom feel more natural.
For the next step, we will be using a similar approach to create larger flowing curls for a large hairpiece for the character. Referencing back to our initial skin setup, create 2 spheres and elongate them with transform values. Then rotate it on the X-axis to give a tilt and do the inverse for the other. Merge the geometry and create a VDB with a VDB from Polygons node and adjust the voxel size lower to increase resolution. Next, convert back to a polygon with a VDB convert to create one smooth heart-shaped mesh. Add a Labs align and distribute or use an align SOP to bring the mesh to its origin.
Select a single point on the middle of the top of the character's head around the top rear of the scalp. Blast out the point select and input it into a copy to the points node. Place a transform node above the left input of the copy to points and adjust until the mesh is correctly positioned. Then add a normal node, clean node, and remesh node in a chain under the copy to points, this ensures the mesh is usable for the grooming process.
Now that the next skin object is set up, create a new guide groom node and repeat the steps we used in the base curls process except for the density override and add a set length guide process with randomness for the breakup. Inside the guide groom object node, place a guide groom node and use it to delete the guides that intersect the scalp.
Make a new hair gen and place a clump node as we did before. And then set up the base parameters:
In the clumping tab, the values are slightly different than before setting up amplitude slightly higher to around 0.0123 and removing the first point on the amplitude ramp modifier will create uniform amplitude along the curve of the guide resulting in a large voluminous curl. Then overdrive the frequency value to 1200 as before. Again feel free to experiment with these values for different results.
Add the same guide process (set length) as before to make the tips of the curls feel more natural. An important note here is to leave the method on cut and extend as the scale would result in a breakup in the uniformity of the curl.
I have always found braids an interesting problem to solve when it comes to grooming. The multiple challenges associated with making a good realistic braid are often compounding only present themselves as you try further integration with conventional hair setups. It is my hope that the braid setup demonstrated here can prove useful in providing a basis to expand upon.
For the base curve which we'll use in the braid setup, do the following:
The primary approach in this technique for braid generation is creating a base curve shape that will be chained onto a path curve. Step by step instructions:
Place a for each connected piece loop, inside the loop place a poly frame, this can be used to force adjustment should need to arise, for this example un-tick all boxes.
As we can see, the final result is a full braid loop. You can apply the exact same shader to standard hair grooms. The system is flexible and can easily be made into a tool, one could add different base curve profiles for various braid types, to build the setup into a fully packed HDA to generate ropes and braid curves for various needs and requirements.
Feel free to add any other elements to the setup we have so far like eyebrows or accent curls, or even more braids using the techniques shown above.
The first step to exporting the hair setup from Houdini to Unreal is the caching process. Start by making a simple empty geo node on the object level labeled export, inside the object, merge in all of the outputs you wish to cache. Merge all of the outputs and under the merging place, attribute promote.
In the attribute promote, find the width attribute and promote it from a point class to a vertex class then change the new name to "groom_width" and select "delete original". This is so that Unreal Engine reads this as the hair width when it imports the alembic file. You can find a full list of other groom attributes that can be read natively by Unreal Engine here.
I have selected UE 4.27 for the purpose of easy MetaHuman workflow, however, the same would apply to UE5. Next place an Alembic ROP and using the default settings write out the static hair alembic to your desired file location.
The first thing to do in Unreal Engine is to search for the hair under Edit > Plugins. Enable the alembic groom importer. Unreal Engine will prompt to restart.
After the restart, simply take your alembic export and drag it into the content browser of the UE scene. A dialogue will be shown requesting the conversion settings for your groom, I prefer to do this post-import and clear the transforms after but should you know in advance feel free to execute those transforms here.
As shown above you can see the changes in the groom's transforms. Also, note that the width is correct when run through Houdini to Unreal scale conversion.
Lastly, to adjust the groom material, you can open the groom material found in the properties menu on the right of the Unreal viewport. Double clock the material to bring up its Blueprint and make any adjustments to your preference. In this example, I simply adjusted the color to more closely match what was present in Houdini.
Thank you for taking the time to check out this tutorial. I hope that it has proved useful.