Hair - Computer Graphics

Peter HU, Nov 2024.

Dataset

Codebase

others: Embodied Hands (MANO) & Body (SMPL)

Representation

TODO: more recent papers, relationship with renderer, conversion between reps.

Geometric based

reps curve surface cylinder trigonal
prism
ex line segment
sine waves
B-spline
Catmull-Rom
N-U R B-Spline
(strips)
generalized
cylinder
wisp based
pros realistic fewer geometry by cluster
cons large size unrealistic

poly line: a set of connected line segments

To reduce the large number, key/guide hairs + population

Single Strand Interpolation creates hair strands around each explicitly modeled curve based on the shape of the curve. Wisps and generalized cylinder based techniques use this approach for generating a complete hair model.

Multi Strand Interpolation creates hair strands in-between a number of explicitly modeled curves by interpolating their shapes.

cons: limited hairstyles, lack details

curve

curve + thickness, e.g. sine waves, B-spline, Catmull-Rom spline

It ignores the details of the tubular shape of hair fibers, which is often unimportant, because, in most cases, the projected thickness of a hair strand is less than the size of a pixel on the screen.

Rendering (line segment and cylinder)

reference: Rendering fur with three dimensional textures, J. T. Kajiya, 1989

the first shading model for hair rendering, widely cited.

u-shaped strips

reference: An Enhanced Framework for Real-time Hair Animation, W. Liang et al., 2003.

Real-time conversion that project each vertex onto the scalp (spheres) and connect the vertices with their projections.

thin shell volume

reference: A Thin Shell Volume for Modeling Human Hair, T. Kim et al., 2000.

surface + cylinder + particles (under constraints for hair-hair interaction)

Rendering

wisp

reference: A system of 3D hair style synthesis based on the wisp model, L. Chen et al., 1999.

cylinder or trigonal prism

Rendering

The illumination is given by ambient, diffuse and specular terms, θ\theta is the angle between incoming light and normal, ϕ\phi is the angle between normal and view point,

Ch=LaKa+iLi[Kdcosθ+Kssinn(θ+ϕπ)]C_h = L_a K_a + \sum_i L_i [K_d \cos\theta + K_s \sin^n(\theta+\phi-\pi)]

Modified shadow Z-buffering method (shadow mask).

Artificial objects (e.g. hair pins, hair bands, ponytails, and braids)

generalized cylinder

reference: Interactive Multiresolution Hair Modeling and Editing T. Kim et al., 2002

With a space curve C(t)\mathbf{C}(t) and series of contours R(θ,t)\mathbf{R}(\theta, t) along the curve, GC defines the boundary of a hair cluster when r=1r=1,

(r,θ,t)=C(t)+rR(θ,t)[N(t)cosθ+B(t)sinθ]\mathbf(r, \theta, t) = \mathbf{C}(t) + r \mathbf{R}(\theta, t) [\mathbf{N}(t) \cos\theta + \mathbf{B}(t) \sin\theta]

, where we define coordinate frame of the curve T(t)T(t) to be the tangent vector, N(t)N(t) to be the principal normal vector, and B(t)B(t) to be the bi-normal vector. θ\theta as the angle around the tangent vector TT, starting from the principal normal NN.

R(θ,t)[sNN(t)cosθ^+sBB(t)sinθ^]\mathbf{R}(\theta, t) [ s_N \cdot \mathbf{N}(t) \cos\hat{\theta} + s_B \cdot \mathbf{B}(t) \sin\hat{\theta} ]

When t=0t=0, the hair strand is on the scalp (head model). Catmull-Rom spline curve for smoothness.

multi-resolution: after GC, he/she subdivides each hair cluster, adding more detail until the desired appearance is achieved.

Rendering:

mesh

reference: Hair mesh, C. Yuksel et al, 2009

Layers of polygonal meshes set k=0NFk\sum_{k=0}^N F^{k}, which typically contain quadrilateral or triangular faces, with no restrictions on the types of polygons used. Layer at kk has one-to-one correspondence to a face at k+1k+1.

Volumetric based

basic element: voxels grid or bounding box.

pros: efficient spatial-aware intermediate representation to encode hair, for all sorts of downstream tasks.

cons: when hair animates, such volumes should be updated for every frame, making pre-filtering inefficient.

reference: Hair-GAN: Recovering 3D hair structure from a single image..., M. Zhang, 2019, etc. [full lists at PERM (2024) §2. related work.]

3D volumetric field, grid of shape nx×ny×nz=128×192×128n_x \times n_y \times n_z= 128 \times 192 \times 128, aligned each hair model to a unified bust model within a volumetric bounding box.

Vector field (points)

For each grid vertex vi\mathbf{v_i}, Laplace operator Δ(vi)=jN(i)(tjti)\Delta(\mathbf{v_i}) = \sum_{j \in N(i)} (\mathbf{t_j}-\mathbf{t_i}) is adopted in mesh editing for smooth deformation. Minimize with constraint index set CC,

E(t1,...,tn)=iΔ(ti)2+ωiCtici2E(\mathbf{t_1}, ..., \mathbf{t_n}) = \sum_i || \Delta (\mathbf{t_i}) ||^2 + \omega \sum_{i \in C} || \mathbf{t_i} - \mathbf{c_i} ||^2

reference: Example-Based Hair Geometry Synthesis, L. Wang, 2009

Volume density function

reference: Hypertexture, K. Perlin, 1989.

Rendering

Volume rendering with

Hypertexture=fn(....f2(f1(f0(D(x)))))\text{Hypertexture} = f_n ( . . . . f_2 (f_1 (f_0 (D(x)))))

Pros: a significant reduction of storage requirements + naturalness of the transparent property of hair regions.

Cons: relatively slow rendering performance O(n3)O(n^3), typically a few hours as originally reported (1999); despite its power, one does not have an explicit control over its shape, but

reference: The Cluster Hair Model, X. Yang et al., 2000.

Embed a volume density model into a generalized cylinder.

Complex fluid flow

reference: Interactive Hair Styler based on Fluid Flow, S. Hadap et al., 2000, P87.

explicit control + reduce complexity + volumetric

Ideal flow with elements: stream + source / vortex

Laplace equation (PDE) 2ϕ=0\nabla^2 \phi = 0, where potential ϕ\phi and velocity V=ϕ\vec{V} = \nabla \phi.

Rendering

volume rendering / visualization techniques

Texture based

Texture mapping the surfaces with hair images and using alpha mapping to create fake illusion of hair strands.

Conversion

reference: Single-view hair modeling using a hairstyle database, Hu et al., 2015

Pose transformation (fixed standard head model) via translating, rotating and/or scaling. (flipping symmetrically in the end)

Mesh ---- uniform sampling -----> hair strands ----> 3D orientation field -----> hair strands

Each strand is represented as a set of equally spaced sample points. Guided by the diffused 3D orientation field, smoothly diffuse the field into the entire 3D volume as proposed by Paris et al. [2008].

reference: Hair-GAN: Recovering 3D hair structure from a single image..., M. Zhang, 2019

polygon-strips --------> dense 3D orientation volume

Low-quality hair

Renderer

High-quality hair

Rendering techniques

Blender conversion steps

  1. Verify the Converted Hair

    After converting hair (via Object > Convert > Mesh or similar), inspect the result in Edit Mode. You will see vertices along the strands but no faces or thickness.

  2. Convert to Curve

    Select the hair mesh in Object Mode. Go to the Object menu: Object > Convert To > Curve from Mesh/Text. This converts the vertex strands into curves, making them easier to manipulate.

  3. Add Thickness to the Curves

    Go to the Object Data Properties (the green curve icon in the Properties Panel). Under the Geometry section, locate the Bevel subsection. Adjust the Depth value to add thickness to the strands. Use the Resolution slider to refine the shape.

  4. Convert Back to Mesh (Optional)

    Once the curves have the desired thickness, convert them back to a mesh: Object > Convert To > Mesh from Curve/Meta/Surf/Text.