Introduction to Houdini 19+ Groom [3/5] (Patreon)
Downloads
Some files exceed the archive size limit and weren't saved: 5 files. Please note these limits are in place to keep this site running long term, without costing a fortune. You can favorite the creator though, certain milestones increase the limit.
Content
Groom Updates in Houdini 19
Prior to version 19, Houdini had a very different groom toolset. It was excellent overall and is still useable if you want to download an older version of Houdini. The main issues were that it was somewhat slow and lacked some modern, artist-friendly features.
Houdini 19 introduced a significant overhaul to the groom workflow, bringing in brand new tools focused on interactivity. There are several core Houdini nodes used for creating a complete groom: Guide Groom, Hair Generate, Guide Process and Hair Clump.
In this article we'll learn how to use each to create a basic hairstyle, plus some bonus VEX scripting!
Workspace Setup
There are a number of setup steps I recommend before actually starting your groom.
1. I like adding a keybind to Accept (default enter) in the Hotkey Manager (under Edit > Hotkeys...). I set Q as the alternate key. We’ll be pressing 4 and enter a lot and they’re far apart on the keyboard. 4 and Q is more convenient.
2. You can hide most of the Houdini interface by pressing Alt-Ctrl-S. This helps since we’ll just be focused on grooming and there won’t be any chance of accidently clicking something else in the interface.
3. Create two top-level /obj Geometry nodes and rename them skin and groom.
4. Create a Hair Shader in the /mat context using any root and tip colors you like. I brightened up the defaults to make them pop more on screen.
5. On our newly-created groom node in /obj, assign hairshader1 and check Shade Open Curves in Viewport. This will give us a nice preview of our hair in the Houdini viewport.
6. From now on I'll be using a custom workspace called Groom. I prefer this layout to the default ones that come with Houdini. You can use whatever you feel comfortable with, or you can download mine (Groom.desk) at the end of this article. Simply place it in your houdini<version>/desktop folder, restart Houdini if necessary and select the workspace from the dropdown list.
Your interface should look something like this. Note that I also use the grey background theme. You can change this by pressing D to access Display Options and opening the Background tab.
Having done all this you’ll be ready to roll with an easy to use setup that makes for smooth interactivity and clear visualization. Let's get started!
Getting Started with Guide Groom
First off, download the attached head model. It has UVs and is a good mesh resolution for when we paint density maps later on. Dive into /obj/skin that we created earlier, drop down a File node and point it to the head mesh. Press F to fit the viewport to the geometry.
Jump back up to top level /obj and go into the groom network we created, /obj/groom. Create an Object Merge node and bring in /obj/skin. Connect a Guide Groom node to the skin (note that the middle connector is for the skin) and we can start creating guides.
When working with Guide Groom you can either choose tools via the dropdown menu in the parameter interface, or you can use the Groom radial menu set. The latter is more efficient and I recommend it. You can activate it by selecting it from the dropdown at the top of screen:
To use the radial menu, hold C, drag your mouse to your selection and release C. Each item on the menu opens up a new radial submenu with more options. After making your selection, the onscreen display will update to show the currently active tool.
Going back to the guide groom parameter window, open up the Width section and set it to 0.1 so we can clearly see our guides.
Click the Tool dropdown to see all the tools available to us.
Let's start out by using the Plant tool to create individual guides that outline the long hairs on top of the head. Set the Mode to Single to plant guides one by one with a single click and set Default Length to 5. Turn on Mirror Brush to create symmetry on the left to right axis.
Not happy with the position of some guides? In Houdini it's super easy to make corrections using the Move tool (aka the greatest thing ever invented). Just click and drag!
Let’s use the Sculpt tool to get our guides into the shape we want. Note that the Ray Bias setting controls collision distance with the skin. Set this to 0.1 to match the scale of the scene and give us a little "air" between the guides and skin.
If you want to focus on only a single guide, or a small group, you can press 4 to enable the Select Primitives tool. Then, either click or drag to make your selection and press enter (Q if you added the binding earlier) to return to grooming. Use the mouse wheel to change brush size.
To create guides for the short hair on the sides of the head, set the plant tool to Scatter mode. Set the density very low to start, 0.5-1, the initial length to 1 and uncheck Interpolate Guides since we don't want our new short guides to try to match the ones on the top of the head. Paint over the skin to create the guides. Finally, switch back to move mode to tidy up the edges.
Switch back to the sculpt tool and brush the short hairs into the desired position.
We should now have something like this:
Before we move on, note that Guide Groom is NOT non-destructive. It's difficult to modify any geometry or settings upstream from a Guide Groom. There are workarounds in some situations, but generally you want your guides to be the very first element in the chain. It’s acceptable to put a Guide Groom at the very end of the groom as well for some final tidying up, but keep in mind that anything changed upstream will not propagate to the Guide Groom. You’ll need to make a brand new Guide Groom and redo your work.
Hair Generate
Now that we’ve got our guides ready to go, it’s time to create some hair! The node used for this is Hair Generate. Connect it to our Guide Groom and right away you’ll notice it has a LOT of settings. The main ones we’ll focus on are Density and Influence Radius.
Uncheck Grow Unguided Hair since this will cover the entire head with hair, not just near our guides.
Go to the Attributes & Appearance tab on top and set Thickness to 0.05 to help with visualization. Also, if you plan on using textures to color your hair you should add the value uv to Source Attribute Transfer/Vertex Attributes.
Going back to the main settings tab, let's set the density low to start, around 25.
Increase the influence radius until the entire scalp is covered. Influence radius controls how far away hairs are created from each guide. In the following demo scene, we have one guide every two units. As you can see, hairs only start picking up influence from neighboring guides when we set the radius above 1, when their influence begins to "overlap."
The second parameter shown in the clip, Influence Decay, controls how much falloff there is within the influence radius. Generally it's fine to leave this at the default, but in some cases you may want to play with it a bit.
Back to our project: we've got a problem right off the bat, excessive ear hair!
To define the edges of our hair more accurately, we'll create a Skin Attribute density map. It’s important to note that you’ll want a fairly high resolution mesh for this purpose. Houdini paints vertex attributes, not a texture map, so it depends heavily on mesh resolution. In theory you can use painted maps, but you have to use a separate app such as Substance Painter make them. It's much more convenient to use vertex paint within Houdini.
Next to density, click the dropdown and select Skin Attribute, then click the Paint Density Attrib icon.
Houdini will set up the required nodes and put you into painting mode.
Red indicates max density and blue is zero. To quickly paint zero values hold down ctrl while painting. Let's paint the outline we want for our hairstyle. Just like with the guide brushes you can use the mouse wheel to control the paint brush size. I also checked Symmetry/Enable Mirroring to speed up painting since both sides of the head are the same.
Guide Process
Now we’ve got a hairstyle! Next up is Guide Process. This is the node we use to create Frizz, among other details. Note that what we’re doing here is non-destructive. We can even make changes to the original Guide Groom and everything following it will update accordingly.
Here's how our groom looks with a Guide Process connected and a small amount of frizz added.
When adding frizz it’s sometimes useful to use Masking/Curve Mask to control which part of the hair is displaced. You don’t necessarily want frizz up to the very tip. Here's a example showing what the frizz parameters do and what the mask graph editor does.
Hair Clump
Finally, let’s add some clumps by connecting a Hair Clump node. The only settings we'll need to change for this simple groom are Clump Size and Clump Profile.
Increase the clump size until you get a look you like. Let's decrease the pointiness of the clumps as well by increasing the value of the final control point in the graph editor.
Here's our almost done groom. Just one more step left to go!
Final Touches
Now that we've got the general shape of our groom, we can add another Guide Groom to create the final look. Keep in mind that this should be the absolute final step as you’ll have to redo your work if you make any changes upstream. You should finalize the groom as much as possible before doing this. Here we can add flyaway hairs and make small shape changes around the hairline, ears and more. I'll be mostly using the sculpt tool and quickly selecting hairs using 4 and pressing Q to return to grooming. I'll also use plant/scatter to increase the density.
If you want to decrease density you can use the Cull tool and set its density to the lower bound you want. Choose the Delete tool to completely remove hair.
Here's the result, ready to render!
And a quick test render in Solaris with Karma. We'll cover rendering in both Houdini and Maya in the next installment in this series.
Bonus Advanced Tip
I like to put a final width/taper control at the very end of the node tree. This makes it easy to make quick adjustments when doing look development and reinstates any taper that Guide Groom might have removed.
Here's how to do it! It's just two nodes and a little bit of VEX.
First, put down a Resample node. We don't necessarily want to resample the curves (although it would be fine to do so), we just need to create a curveu attribute which sets ordered point numbers from root to tip. Uncheck Maximum Segment Length (this disables resampling the curves) and check Curve U Attribute to create the new attribute.
In this sample, each curve has 9 points and in the geometry spreadsheet we can see that all points have been assigned a curveu value from zero to one, root to tip.
Next, put down a Point Wrangle and paste the following code:
@width=chf("Width");@width*=chramp("Taper",@curveu);
Click the Create Spare Parameters... icon.
This will create a float slider (chf) named Width to set the width attribute and a ramp widget (chramp) called Taper to control the curve taper using a graph editor.
That's all there is to it! you can use this to easily control the overall width of hairs in a groom and set custom taper. For example, a final render setting on a groom might look like this:
You can pack this up into a Houdini Digital Asset to reuse in any project.
Exporting
Houdini is a powerhouse when it comes to exporting. If your cache is to be used in Houdini only you could use the native BGEO format. To share your groom you’ll want an interchange format such as Alembic or USD. Houdini provides a node for both (ROP Alembic Output and USD Export), so it’s simply a matter of connecting one to your groom, naming the file and exporting. It wouldn't be Houdini without an overwhelming number of settings to dig into if you want, but generally the defaults should get the job done.
One thing you might want to consider is using an Attribute Delete node to remove attributes that aren’t needed any more. If you open your geometry spreadsheet you’ll see that the groom nodes added a bunch of specialized attributes. Many of these will be useless outside of Houdini or for rendering, so you can delete them before exporting to save some file size. Removing what I show here reduced the BGEO file size from 31.4 megabytes to 15.8.
Closing Words
Well done! We learned a lot about how grooming is done in Houdini and picked up many useful workflow tips. This is just scratching the surface, so feel free to explore on your own and have fun.
Next up, texturing our groom!