Presentation is loading. Please wait.

Presentation is loading. Please wait.

Physics of Hair Maxim Bovykin.

Similar presentations


Presentation on theme: "Physics of Hair Maxim Bovykin."— Presentation transcript:

1 Physics of Hair Maxim Bovykin

2 Hair Dynamics Used for fur, long hair, grass…
Started with short hair / fur Evolved into longer, human hair Proprietary Algorithms

3 Writing hair simulator
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 Hair is a non-linear problem
Rigid Joint (linear in angles) Non-linear constraints Mass Spring (linear in position) Non-linear in angles

6 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.

7 Basic Mass Spring System
xi xj

8 Basic Mass Spring System
xi xj L

9 Basic Mass Spring System
xi xj Fj

10 Basic Mass Spring System
xi xj Fj

11 Basic Mass Spring System

12 How large is k ?

13 k =  Hair does not stretch at all k is close to infinity

14 k =  Explicit integrator diverges on Large dt (smaller dt slow!)
Large k (smaller k looks bad!)

15 k =   implicit integration? Implicit integrator adds stability
Large dt (OK) Large k (OK)

16 k =   implicit integration? n+1

17 Implicit integration – a closer look
Filter Damping

18 Implicit integration – a closer look
Damping Filter Implicit integrator adds stability through Wider filtering of velocity Artificial Damping

19 = * Implicit integration as a filter Damping Filter Filter
Velocity Field

20 = * = * As k becomes larger, Implicit filter widens Damping Filter
Smaller k * = larger k

21 = * = * As K, implicit filter makes things move together Smaller 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

22 Implicit integration as a damping force
Filter Damping 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 

23 k =   implicit integration? Implicit integrator adds stability
Loss of angular momentum ‘Good’ Jacobian (filter) very important

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

25 non-linear post correction

26 non-linear post correction

27 non-linear post correction

28 non-linear post correction
Post solve correction Successive relaxation until convergence Guaranteed length preservation Cheap simulation of kinfinity

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

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

31 non-linear post correction
Bridson2002 Momentum preserving velocity filter Non-linear Jacobi vs Gauss-Seidel

32 k =  Recap Large k not good Explicit integrator blows up
Loss of angular momentum in implicit solvers

33 k =  Recap Use post-step relaxation Very small k ok
Explicit integrators ok

34 Angle preservation Length preservation isn’t enough
Hair tends to go back to original shape

35 Angle preservation

36 Angle preservation Flexion spring?
Linear spring between distant nodes.

37 Flexion spring (x) Linear Spring  Loss of angular momentum
Ambiguity in direction for angles > 180 Unwanted wrinkles in hair shape

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

39 Angle preservation 0 F

40 Angle preservation Derivation on angles
Additional anchor point needed at the root

41 Angle preservation Derivation on angles Full angle required (360 )
=2/3 =4/3 ’= 2-  = 2/3 Derivation on angles Full angle required (360 ) Axis generation an issue

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

43 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

44 Predictor-corrector scheme
Implicit Filter (Predictor) Sharpener (Corrector) Implicit Filter (Predictor)

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

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

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

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

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

50 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

51 Hair Dynamics – Collision Detection
Simple collision detection algorithm: Calculate distance between core shapes (line or rectangle) Subtract appropriate offset (radius of each SSV)

52 Hair Dynamics – hair hair interaction

53 Hair Hierarchy

54 Subdivision of Hair

55 Subdivision of Hair

56 The End - Q & A


Download ppt "Physics of Hair Maxim Bovykin."

Similar presentations


Ads by Google