12.1 Surface Deformation II Hao Li http://cs621.hao-li.com 1 Last - - PowerPoint PPT Presentation

12 1 surface deformation ii
SMART_READER_LITE
LIVE PREVIEW

12.1 Surface Deformation II Hao Li http://cs621.hao-li.com 1 Last - - PowerPoint PPT Presentation

Spring 2019 CSCI 621: Digital Geometry Processing 12.1 Surface Deformation II Hao Li http://cs621.hao-li.com 1 Last Time Linear Surface Deformation Techniques Shell-Based Deformation Multiresolution Deformation Differential


slide-1
SLIDE 1

CSCI 621: Digital Geometry Processing

Hao Li

http://cs621.hao-li.com

1

Spring 2019

12.1 Surface Deformation II

slide-2
SLIDE 2

Last Time

2

  • Shell-Based Deformation
  • Multiresolution Deformation
  • Differential Coordinates

Linear Surface Deformation Techniques

slide-3
SLIDE 3

Nonlinear Surface Deformation

3

  • Nonlinear Optimization
  • Shell-Based Deformation
  • (Differential Coordinates)
slide-4
SLIDE 4

Nonlinear Optimization

4

  • Given a nonlinear deformation energy

find the displacement d(x) that minimizes E(d), while satisfying the modeling constraints.

  • Typically E(d) stays the same, but the modeling

constraints change each frame.

E(d) = E(d1, . . . , dn)

slide-5
SLIDE 5

Gradient Descent

5

  • Start with initial guess d0
  • Iterate until convergence

– Find descent direction h = -∇E(d) – Find step size λ – Update d = d + λh

  • Properties

+ Easy to implement, guaranteed convergence – Slow convergence

slide-6
SLIDE 6

Newton’s Method

6

  • Start with initial guess d0
  • Iterate until convergence

– Find descent direction as H(d) h = -∇E(d) – Find step size λ – Update d = d + λh

  • Properties

+ Fast convergence if close to minimum – Needs pos. def. H, needs 2nd derivatives for H

slide-7
SLIDE 7

Nonlinear Least Squares

7

Given a nonlinear vector-valued error function find the displacement d(x) that minimizes the nonlinear least squares error

e(d1, . . . , dn) =    e1(d1, . . . , dn) . . . em(d1, . . . , dn)    E(d1, . . . , dn) = 1 2 e(d1, . . . , dn)2

slide-8
SLIDE 8

1st order Taylor Approximation

8

E(d1, . . . , dn) = 1 2 e(d1, . . . , dn)2 ke(dk+1)k2 ⇡ ke(dk) + Je(dk+1 dk)k2 ke(dk+1)k2 ⇡ ke(dk) + Je∆dkk2 ∆dk

min = arg min ∆dk kek2

h = arg min

∆dk kek2

J>

e Jeh = −J> e e(dk)

Taylor Approx Gauss-Newton

slide-9
SLIDE 9

Gauss-Newton Method

9

  • Start with initial guess d0
  • Iterate until convergence

– Find descent direction as (J(d)T J(d)) h = -J(d)T e – Find step size λ – Update d = d + λh

  • Properties

+ Fast convergence if close to minimum – Needs full-rank J(d), needs 1st derivatives for J(d)

slide-10
SLIDE 10

Nonlinear Optimization

10

  • Has to solve a linear system each frame

– Matrix changes in each iteration! – Factorize matrix each time

  • Numerically more complex

– No guaranteed convergence – Might need several iterations – Converges to closest local minimum

➡ Spend more time on fancy solvers...

slide-11
SLIDE 11

Nonlinear Surface Deformation

11

  • Nonlinear Optimization
  • Shell-Based Deformation
  • (Differential Coordinates)
slide-12
SLIDE 12

Shell-Based Deformation

12

  • Discrete Shells

[Grinspun et al, SCA 2003]

  • Rigid Cells

[Botsch et al, SGP 2006]

  • As-Rigid-As-Possible Modeling

[Sorkine & Alexa, SGP 2007]

slide-13
SLIDE 13

Discrete Shells

13

  • Main idea

– Don’t discretize continuous energy – Define discrete energy instead – Leads to simpler (still nonlinear) formulation

  • Discrete energy

– How to measure stretching on meshes? – How to measure bending on meshes?

slide-14
SLIDE 14

Discrete Shell Energy

14

  • Stretching: Change of edge lengths
  • Stretching: Change of triangle areas
  • Bending: Change of dihedral angles

xi xj xk xl eij fijk filj

eij∈E

µij

  • θij − ¯

θij ⇥2

  • eij∈E

λij (|eij| −| ¯ eij|)2 ⌅

fijk∈F

λijk

  • |fijk| −

⇤ ⇤ ¯ fijk ⇤ ⇤⇥2

slide-15
SLIDE 15

Discrete Shell Energy

15

slide-16
SLIDE 16

Realistic Facial Animation

16

Linear model Nonlinear model

slide-17
SLIDE 17

Discrete Energy Gradients

17

  • Gradients of edge length

xi xj xk xl n1 n2 e |eij| = ⇤xj xi⇤ ∂ |eij| ∂xi = e ⇤e⇤ ∂ |eij| ∂xj = e ⇤e⇤

slide-18
SLIDE 18

Discrete Energy Gradients

18

  • Gradients of triangle area

xi xj xk xl n1 n2 e

|fijk| = 1 2 ⌅n1⌅ ∂|fijk| ∂xi = n1 ⇥(xk xj) 2 ⌅n1⌅ ∂|fijk| ∂xj = n1 ⇥(xi xk) 2 ⌅n1⌅ ∂|fijk| ∂xk = n1 ⇥(xj xi) 2 ⌅n1⌅

slide-19
SLIDE 19

Discrete Energy Gradients

19

  • Gradients of dihedral angle

xi xj xk xl n1 n2 e

θ = atan sin θ cos θ ⇥ = atan ⇤ (n1 ⇤ n2)T e nT

1 n2 · ⌅e⌅

⌅ ∂θ ∂xi = (xk xj)T e ⌅e⌅ · n1 ⌅n1⌅2 + (xl xj)T e ⌅e⌅ · n2 ⌅n2⌅2 ∂θ ∂xj = (xi xk)T e ⌅e⌅ · n1 ⌅n1⌅2 + (xi xl)T e ⌅e⌅ · n2 ⌅n2⌅2 ∂θ ∂xk = ⌅e⌅ · n1 ⌅n1⌅2 ∂θ ∂xl = ⌅e⌅ · n2 ⌅n2⌅2

slide-20
SLIDE 20

Discrete Shell Editing

20

  • Problems with large deformation

– Bad initial state causes numerical problems

slide-21
SLIDE 21

Shell-Based Deformation

21

  • Discrete Shells

[Grinspun et al, SCA 2003]

  • Rigid Cells

[Botsch et al, SGP 2006]

  • As-Rigid-As-Possible Modeling

[Sorkine & Alexa, SGP 2007]

slide-22
SLIDE 22

Nonlinear Shape Deformation

22

  • Nonlinear editing too unstable?
  • Physically plausible vs. physically correct

➡ Trade physical correctness for

– Computational efficiency – Numerical robustness

slide-23
SLIDE 23

Elastically Connected Rigid Cells

23

  • Qualitatively emulate thin-shell behavior
  • Thin volumetric layer around center surface
  • Extrude polygonal cell Ci per mesh face
slide-24
SLIDE 24

Elastically Connected Rigid Cells

24

  • Aim for robustness

– Prevent cells from degenerating ➡ Keep cells rigid

slide-25
SLIDE 25

Elastically Connected Rigid Cells

25

  • Connect cells along their faces

– Nonlinear elastic energy – Measures bending, stretching, twisting, ...

slide-26
SLIDE 26

Notion of Prism Elements

26

slide-27
SLIDE 27

Nonlinear Minimization

27

  • Find rigid motion Ti per cell Ci
  • Generalized global shape matching problem

– Robust geometric optimization – Nonlinear Newton-type minimization – Hierarchical multi-grid solver min

{Ti}

{i,j}

wij ⇧

[0,1]2

⇤ ⇤Ti

  • f i→j(u)

⇥ − Tj

  • f j→i(u)

⇥⇤ ⇤2 du

slide-28
SLIDE 28

Newton-Type Iteration

28

  • 1. Linearization of rigid motions
  • 2. Quadratic optimization of velocities
  • 3. Project Ai onto rigid motion manifold

➡ Local shape matching

min

{vi, ωi}

{i,j}

wij ⇧

[0,1]2

⇤ ⇤Ai

  • f i→j(u)

⇥ − Aj

  • f j→i(u)

⇥⇤ ⇤2 du

Pi

Ri Pi + ti Ai(Pi)

Ri x + ti ≈ x + (ωi × x) + vi =: Ai x

slide-29
SLIDE 29

Robustness

29

slide-30
SLIDE 30

Character Posing

30

slide-31
SLIDE 31

Goblin Posing

31

  • Intuitive large scale deformations
  • Whole session < 5 min
slide-32
SLIDE 32

Shell-Based Deformation

32

  • Discrete Shells

[Grinspun et al, SCA 2003]

  • Rigid Cells

[Botsch et al, SGP 2006]

  • As-Rigid-As-Possible Modeling

[Sorkine & Alexa, SGP 2007]

slide-33
SLIDE 33

Surface Deformation

33

  • Smooth large scale deformation
  • Local as-rigid-as-possible behavior

– Preserves small-scale details

slide-34
SLIDE 34

Cell Deformation Energy

34

  • Vertex neighborhoods should deform rigidly

j⇥N(i)

⇤ ⇤ p

j − p i

⇥ − Ri (pj − pi) ⇤ ⇤2 → min

pi pj

slide-35
SLIDE 35

Cell Deformation Energy

35

  • If p, p′ are known then Ri is uniquely defined
  • Shape matching problem

– Build covariance matrix S = PP′T – SVD: S = UΣWT – Extract rotation Ri = UWT

pi pj p

j

p

i

Ri

slide-36
SLIDE 36

Total Deformation Energy

36

  • Sum over all vertex
  • Treat p′ and Ri as separate variables
  • Allows for alternating optimization

– Fix p′, find Ri : Local shape matching per cell – Fix Ri, find p′ : Solve Laplacian system min

p n

i=1

j⇥N(i)

⇤ ⇤ p

j − p i

⇥ − Ri (pj − pi) ⇤ ⇤2

slide-37
SLIDE 37

As-Rigid-As-Possible Modeling

37

  • Start from naïve Laplacian editing as initial guess

initial guess 1 iteration 2 iterations 1 iterations 4 iterations initial guess

slide-38
SLIDE 38

As-Rigid-As-Possible Modeling

38

slide-39
SLIDE 39

Shell-Based Deformation

39

  • Discrete Shells

[Grinspun et al, SCA 2003]

  • Rigid Cells

[Botsch et al, SGP 2006]

  • As-Rigid-As-Possible Modeling

[Sorkine & Alexa, SGP 2007]

slide-40
SLIDE 40

Nonlinear Surface Deformation

40

  • Limitations of Linear Methods
  • Shell-Based Deformation
  • (Differential Coordinates)
slide-41
SLIDE 41

Subspace Gradient Deformation

41

  • Nonlinear Laplacian coordinates
  • Least squares solution on coarse cage subspace

[Huang et al, SIGGRAPH 06]

slide-42
SLIDE 42

Mesh Puppetry

42

  • Skeletons and Laplacian coordinates
  • Cascading optimization

[Shi et al, SIGGRAPH 07]

slide-43
SLIDE 43

Nonlinear Surface Deformation

43

  • Limitations of Linear Methods
  • Shell-Based Deformation
  • (Differential Coordinates)
slide-44
SLIDE 44

Linear Approaches

44

Nonlinear Energy Quadratic Energy Linear PDE Linear Equations

Linearization

Variational Calculus Discretization

slide-45
SLIDE 45

Linear Approaches

45

  • Resulting linear systems

– Shell-based – Gradient-based – Laplacian-based

  • Properties

– Highly sparse – Symmetric, positive definite (SPD) – Solve for new RHS each frame! ∆2d = 0 ∆2p = ∆ T(l) ∆p = ⇥ · T(g)

slide-46
SLIDE 46

Linear SPD Solvers

46

  • Dense Cholesky factorization

– Cubic complexity – High memory consumption (doesn’t exploit sparsity)

  • Iterative conjugate gradients

– Quadratic complexity – Need sophisticated preconditioning

  • Multigrid solvers

– Linear complexity – But rather complicated to develop (and to use)

  • Sparse Cholesky factorization

– Linear complexity – Easy to use

slide-47
SLIDE 47

Dense Cholesky Factorization

47

  • 1. Cholesky factorization
  • 2. Solve system

A = LLT y = L−1b, x = L−T y

Ax = b Solve

slide-48
SLIDE 48

Dense Cholesky Factorization

48

L

36k non-zeros

Cholesky Factorization A=LLT

500×500 matrix 3500 non-zeros

slide-49
SLIDE 49

Sparse Cholesky Factorization

49

PTAP Reordering

14k non-zeros

L

36k non-zeros

Cholesky Factorization A=LLT

500×500 matrix 3500 non-zeros

7k non-zeros

slide-50
SLIDE 50

Sparse Cholesky Factorization

50

Per-frame computation Pre-computation

  • 1. Matrix re-ordering
  • 2. Cholesky factorization
  • 3. Solve system

˜ A = PT AP ˜ A = LLT y = L−1PT b, x = PL−T y

Ax = b Solve

slide-51
SLIDE 51

Bi-Laplace System

51

0s 5s 9s 14s 18s 10k 20k 30k 40k 50k

Conjugate Gradients Multigrid Sparse Cholesky

3 Solutions (per frame costs)

slide-52
SLIDE 52

Linear vs. Non-Linear

52

Gradient Shell Nonlinear

slide-53
SLIDE 53

Linear Approaches

53

Nonlinear Energy Quadratic Energy Linear PDE Linear Equations

Linearization

Variational Calculus Discretization

causes artifacts

slide-54
SLIDE 54

Linearizations / Simplifications

54

  • Shell-based deformation

ks

  • I − I

2 + kb

  • I

I − I I 2 dudv

ks

  • du2 + dv2⇥

+ kb

  • duu2 + 2 duv2 + dvv2⇥

dudv

slide-55
SLIDE 55

Linearizations / Simplifications

55

  • Gradient-based editing

T(x) = A

slide-56
SLIDE 56

Linearizations / Simplifications

56

  • Laplacian surface editing

Rx ≈ x + (r × x) =   1 −r3 r2 r3 1 −r1 −r2 r1 1   x Ti =   s −r3 r2 r3 s −r1 −r2 r1 s  

slide-57
SLIDE 57

Linear vs. Non-Linear

57

  • Analyze existing methods

– Some work for translations – Some work for rotations – No method works for both

Nonlinear Shell Gradient Laplace

slide-58
SLIDE 58

Linear vs. Non-Linear

58

  • Linear approaches

– Solve linear system each frame – Small deformations – Dense constraints

  • Nonlinear approaches

– Solve nonlinear problem each frame – Large deformations – Sparse constraints

slide-59
SLIDE 59

Next Time

59

Spatial Deformation

slide-60
SLIDE 60

http://cs621.hao-li.com

Thanks!

60