Writing a Hair Dynamics Solver - PowerPoint PPT Presentation

About This Presentation
Title:

Writing a Hair Dynamics Solver

Description:

Title: PowerPoint Presentation Author: Tae-Yong Kim Last modified by: Tae-Yong Kim Created Date: 11/4/2004 3:22:17 AM Document presentation format – PowerPoint PPT presentation

Number of Views:82
Avg rating:3.0/5.0
Slides: 60
Provided by: Tae81
Category:

less

Transcript and Presenter's Notes

Title: Writing a Hair Dynamics Solver


1
Writing a Hair Dynamics Solver
  • Tae-Yong Kim
  • Rhythm Hues Studios
  • tae_at_rhythm.com

2
Hair Simulation Overview
  • Understanding the Problem
  • State of the Art
  • Mass-Spring for Hair
  • Length Preservation
  • Angle Preservation
  • Numerical Integration
  • Advanced Issues

3
Uniqueness of Hair Dynamics
  • Hair does not stretch at all
  • But, (long) hair bends quite a lot
  • Upon extreme bending, hair becomes stiff

4
Uniqueness of Hair Dynamics
  • Hair does not stretch at all
  • Stiffness Issue in length
  • But, (long) hair bends quite a lot
  • Preservation of Angular Momentum
  • Upon extreme bending, hair becomes stiff
  • Stiffness issue in bending

5
State of the art
  • Rigid joint approach
  • Mass-Spring (Clumped Particle Model)
  • Continuum approach

6
Rigid Joints
  • Simulate hair as connected rigid joints
  • Developed in robotics field (e.g. Featherstones
    algorithm)
  • Reduced Coordinate Formulation (Hadap2001)
  • Generalized Serial Rigid Multi-body chain
    (Chang2002)

7
Rigid joints state of the art
  • Pros
  • Natural Model for Hair
  • Stiffness in stretch is avoided by formulation
  • Cons
  • Explicit integration only (Runge Kutta, etc.)
  • Another stiffness problem in angles
  • Collision response difficult (IK required)
  • Hair tip touching shoulder problem
  • Fails on stiff hair, fast collision

8
Mass Spring
  • Simulate hair as connected particle mass
  • Early work on hair simulation
  • Mass-spring-hinge model
  • Explicit integrators

9
Mass Spring state of the art
  • Pros
  • Well understood in other field (e.g. cloth)
  • No restriction in collision handling
  • More stable integrator available (implicit)
  • Cons
  • Stiffness issue in explicit integrator
  • Angles difficult to deal with in implicit one

10
Hair is a non-linear problem
  • Rigid Joint (linear in angles)
  • Non-linear constraints
  • Mass Spring (linear in position)
  • Non-linear in angles

11
Our choice - Mass Spring
  • Friendly for production environment
  • Robust Collision Response
  • Efficient
  • Challenges
  • Standard mass spring integrator fails for a
    non-linear problem
  • Implicit integrator helps, but not fully.

12
Basic Mass Spring System
xi
xj
13
Basic Mass Spring System
xi
xj
L
14
Basic Mass Spring System
xi
xj
Fj
15
Basic Mass Spring System
xi
xj
Fj
16
Basic Mass Spring System
17
How large is k ?
18
k
?
  • Hair does not stretch at all
  • k is close to infinity

19
k
?
n
  • Explicit integrator diverges on
  • Large dt (smaller dt? slow!)
  • Large k (smaller k? looks bad!)

20
k
?
  • Implicit integrator adds stability
  • Large dt (OK)
  • Large k (OK)

21
k
?
? implicit integration?
n1
22
Implicit integration a closer look
23
Implicit integration a closer look
Damping
Filter
  • Implicit integrator adds stability thru
  • Wider filtering of velocity
  • Artificial Damping

24
Implicit integration as a filter
Damping
Filter


Velocity Field
25
As k becomes larger, Implicit filter widens
Smaller k


larger k
26
As K??, implicit filter makes things move together
Smaller k
k??

  • Stability gain good for cloth, not quite for hair
  • Too large k results in excessive smoothing
  • ?Loss of angular momentum
  • Too small k results in stretching of hair

27
Implicit integration as a damping force
  • Artificial damping is automatically added
  • Damping term depends on k and dt
  • ?Increase in stability, but loss of accuracy
  • ?too much damping as k approaches ?

28
k
?
? implicit integration?
n1
  • Implicit integrator adds stability
  • Loss of angular momentum
  • Good Jacobian (filter) very important

29
k
Is infinity!
  • Well, how do we preserve length then?
  • ? use non-linear correction

30
non-linear post correction
31
non-linear post correction
32
non-linear post correction
33
non-linear post correction
  • Post solve correction
  • Successive relaxation until convergence
  • Guaranteed length preservation
  • Cheap simulation of k?infinity

34
non-linear post correction
  • How to implement?
  • Cloth simulation literatures
  • Provot 1995 (position only)
  • Bridson 2002 (impulse)
  • Hair-specific relaxation possible

35
non-linear post correction
  • Provot1995
  • Simulates biphasic spring
  • Apply correction until convergence (or time
    limited)
  • Non-linear, Non-dynamic inverse kinematic
    procedure

36
non-linear post correction
  • Bridson2002
  • Momentum preserving impulse
  • Non-linear Jacobi vs Gauss-Seidel

37
k
?
Recap
  • Large k not good
  • Explicit integrator blows up
  • Loss of angular momentum in implicit solvers

38
k
?
Recap
  • Use post-step relaxation
  • Very small k ok
  • Explicit integrators ok

39
Angle preservation
  • Length preservation isnt enough
  • Hair tends to go back to original shape

40
Angle preservation
41
Angle preservation
  • Flexion spring?
  • Linear spring between distant nodes.

42
Flexion spring (x)
  • Linear Spring ? Loss of angular momentum
  • Ambiguity in direction for angles gt 180?
  • Unwanted wrinkles in hair shape

43
Angle preservation
  • Derivation on angles
  • Two angles suffice (no torsion)
  • Energy derived from changes in angles

44
Angle preservation
?0
F
?
45
Angle preservation
  • Derivation on angles
  • Additional anchor point needed at the root

46
Angle preservation
  • Derivation on angles
  • Full angle required (360 ?)
  • Axis generation an issue

47
Angle preservation
  • Implicit integration used on angles
  • Non-linear problem again
  • Jacobian treatment needed

48
Predictor-corrector scheme
  • Implicit integration as a predictor for angles
  • Non-linear corrector for length
  • Two-pass implicit filtering with non-linear
    corrector in the middle of integration
  • Linearized Implicit integrator augmented with a
    non-linear optimizer

49
Predictor-corrector scheme
  • Implicit Filter (Predictor)
  • Sharpener (Corrector)
  • Implicit Filter (Predictor)

50
1.First pass-implicit integration
  • First implicit solve to get new velocity

51
2.First pass-implicit integration
  • Advance position with the predicted mid-step
    velocity

52
3.Non-linear Correction
  • Apply non-linear corrector to get position
    (length) right

53
4.Impulse
  • Change velocity due to length preservation
  • Velocity may be out of sync after impulse

54
5.Second implicit integration
  • Filters out velocity field
  • Velocity field in sync again

55
Recap - Simulating Hair with Mass Spring System
  • Hair dynamics is a non-linear numerical
    integration problem
  • Standard mass spring integrator fails
  • Implicit integrator helps, but not enough.
  • Predictor-corrector scheme

56
Numerical integration
  • Hair system is a banded system
  • Block-tridiagonal (3 bands, length only)
  • Block-diagonal (5 bands including angles)
  • non-iterative, fast solver exists
  • blockwise cholesky, LU decomposition
  • 10-20x faster than Conjugate Gradient

57
Advanced Issues
  • Collision handling
  • Standard particle-based collision handler works
    seamlessly
  • Flexibility in collision response
  • Projection Invariant in implicit integration
    (Baraff-Witkin Style)
  • Direct position alternation (corrector term)

58
Advanced Issues
  • Hair-hair interaction
  • Many ideas from existing simulation literature
    such as
  • Proximity-based spring forces
  • Continuous collision
  • Rigid body like interaction
  • Fluid-like interaction
  • .

59
Movies and QA
  • Hair without bending force
  • Hair with bending force
  • Non-straight rest shape
  • Collision of stiff hair
  • Hair hair interaction type I
  • Hair hair interaction type II
Write a Comment
User Comments (0)
About PowerShow.com