Position Based Dynamics
A fast yet physically plausible method for deformable body simulation
Tiantian Liu GAMES Webinar 03/28/2019
Position Based Dynamics A fast yet physically plausible method for - - PowerPoint PPT Presentation
Position Based Dynamics A fast yet physically plausible method for deformable body simulation Tiantian Liu GAMES Webinar 03/28/2019 Position Based Dynamics A fast yet physically plausible method for deformable body simulation Tiantian Liu
A fast yet physically plausible method for deformable body simulation
Tiantian Liu GAMES Webinar 03/28/2019
A fast yet physically plausible method for deformable body simulation
Tiantian Liu GAMES Webinar 03/28/2019
3
[Müller et al. 2007] [Macklin et al. 2016] [Goldenthal et al. 2007] [Tournier et al. 2015]
4
1986 2017
5
Game Movie/Animation AR/VR
6
Game Movie/Animation AR/VR
7
Game Movie/Animation AR/VR
8
9
[Liu et al. 2017]
10
11
𝐹 𝒚1, 𝒚2 = 1 2 𝑙 𝒚1 − 𝒚2 − 𝑚0 2
𝑌1 𝑌2 𝑦1 𝑦2 𝑚0
12
Ψ 𝐆(𝒚) = 𝜈 𝛝(𝐆) 𝐺
2 + 1
2 𝜇𝑢𝑠2(𝛝(𝐆))
13
Deformation Gradient Strain Tensor Energy Density
Rest Pose 𝐹 𝒚 = 0 Deformed Pose 𝐹 𝒚 > 0 𝐹 𝒚 ↓
14
ℎ 𝑦0 𝑦𝑜 𝑦𝑜+1
15
t𝑜 t𝑜+ℎ 𝑤 𝑢 𝑒𝑢
t𝑜 t𝑜+ℎ 𝑁−1 𝑔 𝑗𝑜𝑢 𝑦 𝑢
+ 𝑔
𝑓𝑦𝑢 𝑒𝑢
𝑏(𝑢)
16
𝑗𝑜𝑢 𝑦𝑜+1 + 𝑔 𝑓𝑦𝑢
𝑓𝑦𝑢 + ℎ2𝑁−1𝑔 𝑗𝑜𝑢(𝑦𝑜+1)
𝑧
17
1 2ℎ2 𝑦 − 𝑧 𝑁 + 𝐹(𝑦)
inertia elasticity
18
[Liu et al. 2017]
19
NVIDIA FleX
[Video courtesy of NVIDIA]
20
Maya nDynamics
[Video courtesy of Pixclue Studios]
21
22
𝑑 𝒚1, 𝒚2 = 𝑦1 − 𝑦2 𝑚0 − 1
𝑌1 𝑌2 𝑦1 𝑦2 𝑚0
Goal: 𝑑 𝒚1, 𝒚2 = 0
23
Init: 𝑦𝑜+1 = 𝑦𝑜 + ℎ𝑤𝑜 + ℎ2𝑁−1𝑔
𝑓𝑦𝑢
Project: Move 𝑦𝑜+1 to satisfy each constraint
24
𝑦𝑜 𝑦𝑜+1 = 𝑧
Projection
𝑦𝑜+1
25
26
𝑘 −1∇𝑑 𝑘 𝑈𝜀𝜇𝑘
𝑘 𝑦 + 𝛼𝑑 𝑘𝜀𝑦𝑘 = 0
𝑑𝑘 𝛼𝑑𝑘𝑁𝑘
−1𝛼𝑑𝑘 𝑈
𝜀𝑦𝑘 = −𝑁
𝑘 −1∇𝑑 𝑘 𝑈𝜀𝜇𝑘
27
𝑦1 𝑦2 𝑚0 𝜀𝑦1 𝜀𝑦2
𝑑 = 𝑦1 − 𝑦2 𝑚0 − 1 ∇𝑑 = 1 𝑚0 𝑦1 − 𝑦2 𝑈 𝑦1 − 𝑦2 , − 1 𝑚0 𝑦1 − 𝑦2 𝑈 𝑦1 − 𝑦2 𝐍 = 𝑛1 𝑛2 ⨂𝐉 𝜀𝜇 = 𝑑 ∇𝑑𝐍−1𝛼𝑑 = 𝑚0 𝑛1
−1 + 𝑛2 −1 ( 𝑦1 − 𝑦2 − 𝑚0)
28
𝑦1 𝑦2 𝑚0 𝜀𝑦1 𝜀𝑦2 𝜀𝑦1 = − 𝑚0 𝑛1
−1 + 𝑛2 −1
𝑦1 − 𝑦2 − 𝑚0 𝑛1
−1
𝑚0 𝑦1 − 𝑦2 𝑦1 − 𝑦2 𝜀𝑦2 = − 𝑚0 𝑛1
−1 + 𝑛2 −1
𝑦1 − 𝑦2 − 𝑚0 𝑛2
−1
𝑚0 − 𝑦1 − 𝑦2 𝑦1 − 𝑦2 𝜀𝑦 = −𝐍−1∇𝑑𝑈𝜀𝜇
29
𝑦1 𝑦2 𝑚0 𝜀𝑦1 𝜀𝑦2 𝜀𝑦1 = − 𝑛1
−1
𝑛1
−1 + 𝑛2 −1
𝑦1 − 𝑦2 − 𝑚0 𝑦1 − 𝑦2 𝑦1 − 𝑦2 𝜀𝑦2 = + 𝑛2
−1
𝑛1
−1 + 𝑛2 −1
𝑦1 − 𝑦2 − 𝑚0 𝑦1 − 𝑦2 𝑦1 − 𝑦2
30
Project: Move 𝑦𝑜+1 to satisfy each constraint
31
32
33
34
35
36
37
38
+ Converges faster
+ Easy to parallelize
<-- Colored GS [Fratarcangeli et al. 2016] <-- Symmetric GS <-- Chebyshev Acceleration [Wang 2015] <-- Under Relaxation
39
40
[Liu et al. 2013]
41
1 2ℎ2 𝑦 − 𝑧 𝑁 + 𝐹(𝑦)
inertia elasticity
42
𝑦 1 2ℎ2 𝑦 − 𝑧 𝑁 2 𝑡. 𝑢. 𝑑 𝑦 = 0
𝑌1 𝑌2 𝑦1 𝑦2 𝑚0 𝑑 𝑦1, 𝑦2 = 𝑦1 − 𝑦2 𝑚0 − 1 = 0
43
𝑦 1 2ℎ2 𝑦 − 𝑧 𝑁 2 𝑡. 𝑢. 𝑑 𝑦 = 0
ℎ2 𝑦 − 𝑧 + 𝛼 𝑦𝑑 𝑦 𝑈𝜇 = 0
44
1 2 𝑑 𝑦 𝑈𝐋𝑑(𝑦)
𝐋 = 𝜷−1
Stiffness Matrix Compliance Matrix
= 1 2 𝑑 𝑦 𝑈𝜷−𝟐𝑑(𝑦)
45
𝑦 1 2ℎ2 𝑦 − 𝑧 𝑁 2 + 1 2 𝑑 𝑦 𝑈𝜷−𝟐𝑑(𝑦)
ℎ2 𝑦 − 𝑧 + 𝛼 𝑦𝑑 𝑦 𝑈𝜷−1𝑑 𝑦 = 0
ℎ2 𝑦 − 𝑧 + 𝛼 𝑦𝑑 𝑦 𝑈𝜇 = 0
46
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
47
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
𝑁 ℎ2 𝑦(𝑙) − 𝑧 + 𝛼
𝑦𝑑𝑈𝜇(𝑙)
48
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0 𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 = 0 min
𝑦
1 2ℎ2 𝑦 − 𝑧 𝑁
2
𝑡. 𝑢. 𝑑 𝑦 = 0
49
𝑑 𝑦 = 0 𝑧 𝑦∗
min
𝑦
1 2ℎ2 𝑦 − 𝑧 𝑁
2
𝑡. 𝑢. 𝑑 𝑦 = 0
50
𝑑 𝑦 = 0 𝑧 𝑦∗ 𝑑 𝑦 = 0 𝑧 𝑦(2) 𝑦(3)
51
52
𝑑 𝑦 = 0 𝑧 𝑑 𝑦 = 0 𝑧
𝑦𝑙+1 = min
𝑦
1 2ℎ2 𝑦 − 𝑦(𝑙)
𝑁 2
𝑡. 𝑢. 𝑑 𝑦(𝑙) + 𝛼
𝑦𝑑(𝑦 𝑙 )(𝑦 − 𝑦(𝑙)) = 0
min
𝑦
1 2ℎ2 𝑦 − 𝑧 𝑁
2
𝑡. 𝑢. 𝑑 𝑦 = 0
53
𝑁 ℎ2 𝑦 − 𝑦(𝑙) + 𝛼
𝑦𝑑 𝑦(𝑙) 𝑈𝜇 = 0
𝑑 𝑦(𝑙) + 𝛼
𝑦𝑑(𝑦 𝑙 )(𝑦 − 𝑦(𝑙)) = 0
Initialize 𝑦(𝑙+1) and 𝜇(𝑙+1) with 𝑦(𝑙) and 0
Schur Complement of 0: −𝛼𝑑 (𝑁/ℎ2)−1𝛼𝑑𝑈 [−𝛼𝑑 𝑁/ℎ2)−1𝛼𝑑𝑈 𝜀𝜇 = −𝑑(𝑦 𝑙 )
54
𝑁 ℎ2 𝑦 − 𝑦(𝑙) + 𝛼
𝑦𝑑 𝑦(𝑙) 𝑈𝜇 = 0
𝑑 𝑦(𝑙) + 𝛼
𝑦𝑑(𝑦 𝑙 )(𝑦 − 𝑦(𝑙)) = 0
Initialize 𝑦(𝑙+1) and 𝜇(𝑙+1) with 𝑦(𝑙) and 0
55
𝑑 𝑦 = 0 𝑧 𝑦∗ 𝑑 𝑦 = 0 𝑧 𝑦(2) 𝑦(3)
56
57
𝑑𝑘 𝛼𝑑𝑘 𝑁𝑘
−1𝛼𝑑𝑘 𝑈
𝑘 −1𝛼𝑑 𝑘 𝑈𝜀𝜇j
1 ℎ2 𝛼𝑑 𝑁−1𝛼𝑑𝑈 −1𝑑
PBD (G-S) SAP
𝑑 𝑦 = 0 𝑧 𝑦∗
Ground Truth
𝑑 𝑦 = 0 𝑧 𝑦(2) 𝑦(3)
SAP
𝑑 𝑦 = 0 𝑧
PBD
58
𝑑 𝑦 = 0 𝑧
PBD
59
𝑓𝑦𝑢
𝑑 𝑦 = 0 𝑧
PBD
60
𝑦 1 2ℎ2 𝑦 − 𝑧 𝑁 2
𝑑 𝑦 = 0 𝑧
PBD
61
1 2 𝒅𝑈𝜷−1𝒅
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
62
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
1 2 𝒅𝑈𝜷−1𝒅
𝐹 𝒚1, 𝒚2 = 1 2 𝑙 𝒚1 − 𝒚2 − 𝑚0 2
𝑌1 𝑌2 𝑦1 𝑦2 𝑚0
𝑑 𝒚1, 𝒚2 =
𝒚1−𝒚2 𝑚0
− 1 𝑙 = 2𝜈𝐵 𝑚0 𝛽 = 2𝜈𝐵𝑚0 −1 = 𝑙𝑚0
2 −1
63
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
1 2 𝒅𝑈𝜷−1𝒅
𝒅 = 𝜗𝑦 𝜗𝑧 𝜗𝑨 𝜗𝑦𝑧 𝜗𝑦𝑨 𝜗𝑧𝑨 𝑈
𝐋 = 𝑊 𝜇 + 2𝜈 𝜇 𝜇 𝜇 𝜇 + 2𝜈 𝜇 𝜇 𝜇 𝜇 + 2𝜈 𝜈 𝜈 𝜈
𝜷 = 𝐋−1
𝐹 𝐆(𝒚) = 𝑊(𝜈 𝛝 𝐺
2 + 1
2 𝜇𝑢𝑠2 𝛝 ) 𝛝 = 𝜗𝑦 0.5𝜗𝑦𝑧 0.5𝜗𝑦𝑨 0.5𝜗𝑦𝑧 𝜗𝑧 0.5𝜗𝑧𝑨 0.5𝜗𝑦𝑨 0.5𝜗𝑧𝑨 𝜗𝑨
64
𝐹 = 1 2 𝒅T𝐋𝒅
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
𝑁 ℎ2 𝑦(𝑙) − 𝑧 + ∇𝑑𝑈𝜇(𝑙)
SAP Assumption: 𝑧 → 𝑦 𝑙 ∇2𝑑 = 0 SAP Initialization: 𝑦 ← 𝑦 𝑙
𝑧 𝑦(2) 𝑦(3)
65
∇𝑑𝑈𝜇(𝑙)
−1 𝑑 𝑦 𝑙
66
∇𝑑𝑈𝜇(𝑙)
Compute: 𝜀𝜇𝑘 =
1 ℎ2 𝛼𝑑 𝑘 𝑁 𝑘 −1𝛼𝑑 𝑘 𝑈 + ℎ2𝜷𝑘 −1 𝑑 𝑘 𝑦 𝑙
− 𝜷𝑘𝜇𝑘
(𝑙)
Commit: 𝜇𝑘
(𝑙+1) = 𝜇𝑘 (𝑙) + 𝜀𝜇𝑘
Compute: 𝜀𝑦𝑘 = −ℎ2𝑁
𝑘 −1𝛼𝑑 𝑘 𝑈𝜇𝑘 (𝑙+1)
Commit: 𝑦𝑘
(𝑙+1) = 𝑦𝑘 (𝑙+1) + 𝜀𝑦𝑘
67
1 ℎ2 𝑑𝑘 𝛼𝑑𝑘 𝑁𝑘
−1𝛼𝑑𝑘 𝑈
𝑘 −1𝛼𝑑 𝑘 𝑈𝜇𝑘
PBD (G-S) XPBD (G-S)
1 ℎ2 𝑑𝑘−𝛽𝑘𝜇𝑘 𝛼𝑑𝑘 𝑁𝑘
−1𝛼𝑑𝑘 𝑈+ℎ2𝛽𝑘
𝑘 −1𝛼𝑑 𝑘 𝑈𝜇𝑘
68
[Macklin et al. 2016]
69
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
𝑁 ℎ2 𝑦(𝑙) − 𝑧 + ∇𝑑𝑈𝜇(𝑙)
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
70
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
𝑁 ℎ2 𝑦(𝑙) − 𝑧 + ∇𝑑𝑈𝜇(𝑙)
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
71
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
𝑁 ℎ2 𝑦(𝑙) − 𝑧 + ∇𝑑𝑈𝜇(𝑙)
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
72
73
𝑌1 𝑌2 𝑦1 𝑦2 𝑚0 𝑑 = 𝑦1 − 𝑦2 𝑚0 − 1 𝐹 = 1 2 𝛽−1𝑑2
𝑦1,𝑦1 2
𝑦1,𝑦1 2
Geometric Stiffness 𝜇
74
𝑘=1 𝑛
(𝑙)𝛼2𝑑 𝑘
𝑁 ℎ2 𝑦(𝑙) − 𝑧 + ∇𝑑𝑈𝜇(𝑙)
75
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
constraint #iterations/frame per-iteration cost [Goldenthal et al. 2007] hard medium medium [Müller et al. 2007] hard high low [Tournier et al. 2015] compliant
high [Macklin et al. 2016] compliant high low
76
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
constraint #iterations/frame per-iteration cost [Goldenthal et al. 2007] hard medium medium [Müller et al. 2007] hard high low [Tournier et al. 2015] compliant
high [Macklin et al. 2016] compliant high low
77
78
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
constraint #iterations/frame per-iteration cost [Goldenthal et al. 2007] hard medium medium [Müller et al. 2007] hard high low [Tournier et al. 2015] compliant
high [Macklin et al. 2016] compliant high low
79
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
constraint #iterations/frame per-iteration cost [Goldenthal et al. 2007] hard medium medium [Müller et al. 2007] hard high low [Tournier et al. 2015] compliant
high [Macklin et al. 2016] compliant high low
80
𝑁 ℎ2 𝑦 − 𝑧 + 𝛼
𝑦𝑑 𝑦 𝑈𝜇 = 0
𝑑 𝑦 − 𝜷𝜇 = 0
𝑑 𝑦 = 0 𝑧 𝑦∗
Ground Truth
𝑑 𝑦 = 0 𝑧
PBD
A fast yet physically plausible method for deformable body simulation
Tiantian Liu GAMES Webinar 03/28/2019