Hair Clustering Modifier 


Hair clustering with 10 clusters (left) and 100 clusters (right)

Clustering is often required to quickly simulate realistic hair in both short and long form. In nature clustering is caused by external forces such as static charges between hair strands and synthetic forces caused by gel and hairspray.

To accomplish this task, hair has to be separated into groups which are then pulled together to form clusters. Each group is represented by one of the hair strands thats forming it, and it is usually the central strand. The user has full control over how each group does its clustering. This control consists of a set of cluster knots which determine the amount and direction of clustering at each point on a strand.


Hair clustered with 500 clusters, using a noise map for clustering amount

For very quick results clustering can be controlled on a global scale. Clusters can be randomly generated and spread evenly throughout the surface. Then one knot structure, presented on the main panel, controls all of the clusters.
A special threshold parameter controls how close a strand has to be to a particular cluster to get affected. You can control threshold with a global value and through a global texmap. In experience this value can be well controlled by a noise map with high contrast in upper and lower limits.

 

Parameters  

  • Strand Groups
    Allows you to isolate the effect of this operator by selecting a particular Strand Group created in the Edit Guides operator.
  • Num. Clumps
    Determines the total number of clusters to be generate. The amount and shape of the clusters will be generated in real-time if Dynamic Update is ON.
  • Remember Clusters
    When on, render hair clusters are cached and stored in the scene. Use this option after setting up parameters to ensure consistent results across render nodes.
  • Shape
    Use the curve graph to as a visual guide to determine the shape of the clusters.
  • Dynamic Update
    When on, changing parameters will be reflected in viewport in real-time. Otherwise the viewport updates will only happen when parameters are finished changing.
  • Use UV Coordinates
    When on, texture coordinate space instead of world space will be used to determine hair distances to clusters. This should be used to create more predictable results if your mesh has well-defined normalized UV coordinates.
  • Threshold
    If a specific root is further away from the cluster than this threshold, it will not get clustered.
  • Maps
    Use maps to control the clustering and cluster threshold parameters.
 

C++ SDK Access 

Hair Clustering modifier is accessible via Ornatrix C++ SDK. You need to get an instance of HairClusteringModifierFPInterface which exposes numerous methods:

#include "Public\HairClusteringModifierFPInterface.h" 

// Get "Ground Strands" interface:
auto hairClusteringInstance = HairClusteringModifierFPInterface::GetInterface( myModifier );
 

MaxScript Access 

You can access Hair Clustering modifier via its MaxScript interface. For example:

-- Get MaxScript interface
hairClusteringInstance = $MyHairObject.modifiers[#Ox_Hair_Clustering]

You can call the following functions on this interface to manipulate Hair Clustering programatically:

-- Removes all currently generated clusters. The modifier must be active in the modify panel for this to work.
hairClusteringInstance.ClearClusters()

-- Re-generates clusters used by this modifier from current input hairs and parameters. The modifier must be active in the modify panel for this to work.
groundStrandsInstance.GenerateClusters()

You may also use standard properties exposed by showProperties myModifier to access and change this modifier.