Hair Rendering and Simulation Quick Start

A guide to getting started using hair rendering and simulation with characters in your project.

Windows
MacOS
Linux

The focus of the Hair Rendering and Simulation guide is to walk you through the basics of working with your hair grooms on skinned meshes in Unreal Engine 4 (UE4).

After going through this tutorial, you'll know:

  • How to set up a project for hair rendering and simulation.

  • How to set up a Groom for use with an animated Skeletal Mesh.

  • How to set up a simple "Hair" Material.

  • How to use Niagara to simulate and control hair physics.

1 - Required Setup

  1. Create a new project using the Unreal Project Browser and create a ThirdPerson template project.

  2. In the Editor, go to the main menu and select Edit > Project Settings to open the Project Settings window.

    1_1_ProjectSettings.png

    Enable the following settings:

    • Rendering > Optimizations enable Support Compute Skincache

    • Animation > Performance disable Tick Animation on Skeletal Mesh Init

    You can ignore the "Restart Now" button that pops up in the bottom right corner of the Editor window since the next step will require an Editor restart, too.

  3. Next, go to the main menu again and this time select Edit > Plugins to open the Plugins browser window.

    1_2_Plugins_a.png

    Use the search bar to search the term "Groom," or use the left panel to select the Geometry category, and enable the following plugins:

    • Alembic Groom Importer

    • Groom

  4. Restart the Editor for changes to the Project Settings and Plugins to take effect.

    1_3_Restart.png

2 - Creating and Importing your Groom

Grooms for a character—even a simple one—can contain different types of hair, such as that for heads, beards, brows, and more. Each of these types of hair may have its own Material and physics settings. There are also types of hair within each group such as hairs that are to be used during simulation. This information can be defined during grooming in your DCC and UE4 looks at this information to define guides.

  1. In your preferred DCC application, create your Groom and then export it to Alembic (.abc) file format.

    Use the Alembic for Grooms Specification to prepare your Groom for UE4 with proper naming conventions.

  2. In the Content Browser, click the Import button to import your Alembic file with your groom.

    2_2_ImportGroom.png

  3. In the Groom Import Options window, click Import.

    2_3_GroomImportOptions.png

During the import process, the Groom system will look for attributes and groups that follow the Alembic naming conventions outlined in the Alembic for Grooms specifications page, and import them to a new Groom Asset.

3 - Setting Up Your Groom with a Skeletal Mesh

For this part of the guide, we'll use the SK_Mannequin found in the ThirdPerson template. If you do not have this, you can add it to your project from the Content Browser by clicking Add New > Add Feature or Content Pack and selecting the ThirdPerson template.

Also, note that this is a basic setup that can be also be used with Blueprint and its components.

  1. In the Content Browser, locate the SK_Mannequin Skeletal Mesh and drag it into your scene. You can find it in the Mannequin > Character > Mesh folder.

  2. Next, locate your Groom Asset in the Content Browser. Then, drag it into your scene and position it to your character.

    3_2_DragGroomIntoScene.png

  3. In the World Outliner, drag the Groom Asset onto the SK_Mannequin so that it's a child of the Skeletal Mesh. When you do this, a dropdown list of available Bones to attach to will be listed. Select head from the list.

    3_3_WorldOutlinerHierarchy.png

  4. Select your Groom Asset in the World Outliner and from the Details panel, enable Bind Groom to Skeletal Mesh. This setting enables skinning information to be transferred from the target Skeletal Mesh onto the Groom.

    3_4_BindGroomToSkelMesh.png

    This setting requires that the following Project Settings be set:

    • Support Compute Skincache enabled.

    • Tick Animation on Skeletal Mesh init disabled.

4 - Setting Up Your Hair Material

By Default, UE4 contains a simple Hair Material with HairDefaultMaterial.

The steps below are optional for this guide since UE4 includes a default "hair" material. However, if you've not set one up before, the steps below will guide you through the properties and setting required to do so.

  1. In the Content Browser, click the Add New button, and select Material from the dropdown menu, and give the Asset a name.

    4_1_AddNewMaterial.png

  2. In the Material Editor, use the Details panel to set the following:

    4_2_MatShadingModel1.png

    • Shading Model: Hair

    You also need to enable Use with Hair Strands. When the material is applied to a groom component, this checkbox should automatically enable itself and recompile the material. If it doesn't, you can enable it from the Usage category of the Details panel in the Material Editor.

  3. In the Material Graph, use the following node setup for a basic hair material:

    4_3_MatGraphSetup.png

    Use a Constant4Vector for the Base Color and a Constant to control the Roughness.

    If you're setting up more complex hair materials, use the HairAttribute expression in the Material Graph to access the hair attributes such as UV, Dimensions, RootUV, Seed, and more.

  4. Save and close the Material Editor.

  5. You can apply your hair material in one of two ways; directly on the Groom Asset component through its Details panel in the Level or Blueprint, or by opening the Groom Asset from the Content Browser. Assign your hair material to the Material element slot.

    4_5b_MatGroomActor.png

    4_5a_MatGroomActor.png

    Groom Asset Actor (Details panel)

    Groom Asset (Content Browser)

5 - Setting Up Hair Physics

In this next step, we'll add physics simulation using Niagara.

  1. In the World Outliner, select your Groom Asset and from the Details panel select Add Component and choose a Niagara Particle System component.

    5_1_AddNiagaraComponent.png

    It's important that the Niagara system be a child of the Groom Asset for it to function properly. Keep this in mind when setting up any Blueprints or other characters in your project.

  2. Next, we'll setup the Niagara Particle System using the Details panel of the Groom Actor. Perform the following steps:

    5_2_AssignNiagaraGroomAsset.png

    1. Select the Niagara component that is a child of the Groom Component.

    2. Use the assignment box to select a Niagara emitter to assign.

    3. Select the GroomAssetSystem from the dropdown list of Niagara systems.

    If you do not see the Niagara GroomAssetSystem system listed, use the View Options to enable Show Plugin Content.

    5_2_ViewOptionsNote.png

Once enabled, the Details panel will automatically populate the Override Parameters list of properties you can use to control the physics properties of your hair.

5_0_NiagaraOverrideParameters.png

See the Hair Rendering and Simulation Settings reference page for more information on these Niagara emitter properties.

When you Play-in-Editor (PIE) or Simulate, you should see hair physics applied and working for your Groom.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback