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 

  • Gen. count
    Total number of clusters to generate. Only after hitting the 'generate' button the clusters will be generated. Hitting 'Clear all' will remove all hair clusters.
  • Use UV coordinates
    By default hair will be clustered together based on the distance of hair roots to each cluster. If this option is on UVW coordinates of clusters will be used instead. Note that for this to work you hair needs to inherit surface dependance.
  • Threshold
    If a specific root is further away from the cluster than this threshold, it will not get clustered.
 

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.

Missing Something? Let us know if this page needs more information about the topic.