SlideShare a Scribd company logo
1 of 42
Position Based Fluids
SIGGRAPH 2013
2013/06/11
ked
Authors
 Miles Macklin, Matthias Muller
Overview
Smoothed particle
hydrodynamics (SPH)
Scalar density constraint
Position based
dynamics (PBD)
Artificial pressure &
Vorticity confinement
Position based
fluids
Overview
Smoothed particle
hydrodynamics (SPH)
Scalar density constraint
Position based
dynamics (PBD)
Artificial pressure &
Vorticity confinement
Position based
fluids
Smoothed particle hydrodynamics
 “Particle-Based Fluid Simulation for
Interactive Applications”
 M. Muller, D. Charypar, M. Gross
 Symposium on Computer Animation 2003
Kernel functions
Surface tracking
 Marching cubes
 Point splatting
 upsampling
Overview
Smoothed particle
hydrodynamics (SPH)
Scalar density constraint
Position based
dynamics (PBD)
Artificial pressure &
Vorticity confinement
Position based
fluids
Traditional approaches to simulation
1. All forces are accumulated
2. Using the density, the forces are
transformed into accelerations
3. Compute velocities from the accelerations
and then positions from the velocities
Differential equation
t
v
Euler’s method
Problems of Euler’s method
Stability
 “Position Based Dynamics”
 M. Muller, B. Heideberger, M. Hennix, J. Ratcliff
 Workshop in Virtual Reality Interactions and
PHYsical Simulation (VRIPHYS) 2006
Framework
Framework
Implicit / explicit
 “The integration does not fall clearly into the
category of implicit or explicit schemes.”
 1 iteration: explicit
 More iteration: implicit
Advantages
 “The scheme is unconditionally stable.”
 Steps (13) and (14) do not extrapolate blindly into
the future as traditional explicit schemes do
Numerical computing
 The same as “Position Based Fluids”
Overview
Smoothed particle
hydrodynamics (SPH)
Scalar density constraint
Position based
dynamics (PBD)
Artificial pressure &
Vorticity confinement
Position based
fluids
Density constraint

 : target density
 “Constraint Fluids”
 K. Bodin, C. Lacoursiere, M. Servin
 TVCG 2011
Comparison
Overview
Smoothed particle
hydrodynamics (SPH)
Scalar density constraint
Position based
dynamics (PBD)
Artificial pressure &
Vorticity confinement
Position based
fluids
Density constraint

 : : target density

Taylor approximation


Newton steps



Final equation

Results – convergence
Results – performance
 Frame time = 16ms
Surface tracking
 Anisotropic kernel
 “Reconstructing Surfaces of Particle-Based Fluids
Using Anisotropic Kernels”
 J. Yu, G. Truk
 TOG 2013
Overview
Smoothed particle
hydrodynamics (SPH)
Scalar density constraint
Position based
dynamics (PBD)
Artificial pressure &
Vorticity confinement
Position based
fluids
Artificial pressure

Vorticity confinement

Demo
 128k particles,
 2 steps/frame,
 3 iters/step
Thx.

More Related Content

Viewers also liked

スクラムマスター3ヶ月生がチームの自己組織化に挑戦して
スクラムマスター3ヶ月生がチームの自己組織化に挑戦してスクラムマスター3ヶ月生がチームの自己組織化に挑戦して
スクラムマスター3ヶ月生がチームの自己組織化に挑戦して
Kouki Kawagoi
 

Viewers also liked (16)

心のリミッター外す方法
心のリミッター外す方法心のリミッター外す方法
心のリミッター外す方法
 
Rights and duties of agents
Rights and duties of agentsRights and duties of agents
Rights and duties of agents
 
2013年度博物館教育論第2回
2013年度博物館教育論第2回2013年度博物館教育論第2回
2013年度博物館教育論第2回
 
シンポジウムイントロダクション
シンポジウムイントロダクションシンポジウムイントロダクション
シンポジウムイントロダクション
 
E procurement webinar - Buying made easy (3/3)
E procurement webinar - Buying made easy (3/3)E procurement webinar - Buying made easy (3/3)
E procurement webinar - Buying made easy (3/3)
 
Do Supportive Policies to Female-Headed Households Increase the Income Inequa...
Do Supportive Policies to Female-Headed Households Increase the Income Inequa...Do Supportive Policies to Female-Headed Households Increase the Income Inequa...
Do Supportive Policies to Female-Headed Households Increase the Income Inequa...
 
【大學報PM2.5專題六】解決空污需多管齊下 檢討能源政策才能治本
【大學報PM2.5專題六】解決空污需多管齊下 檢討能源政策才能治本【大學報PM2.5專題六】解決空污需多管齊下 檢討能源政策才能治本
【大學報PM2.5專題六】解決空污需多管齊下 檢討能源政策才能治本
 
スクラムマスター3ヶ月生がチームの自己組織化に挑戦して
スクラムマスター3ヶ月生がチームの自己組織化に挑戦してスクラムマスター3ヶ月生がチームの自己組織化に挑戦して
スクラムマスター3ヶ月生がチームの自己組織化に挑戦して
 
[2015年度] 看護文献の探し方(オーダーメイド講習会:看護研究Ⅰ)
[2015年度] 看護文献の探し方(オーダーメイド講習会:看護研究Ⅰ)[2015年度] 看護文献の探し方(オーダーメイド講習会:看護研究Ⅰ)
[2015年度] 看護文献の探し方(オーダーメイド講習会:看護研究Ⅰ)
 
Financial Services in the Cloud
Financial Services in the CloudFinancial Services in the Cloud
Financial Services in the Cloud
 
Panel Data Models
Panel Data ModelsPanel Data Models
Panel Data Models
 
科学技術コミュニケーションの原点と座標軸20150517(本編)
科学技術コミュニケーションの原点と座標軸20150517(本編)科学技術コミュニケーションの原点と座標軸20150517(本編)
科学技術コミュニケーションの原点と座標軸20150517(本編)
 
【第13回RxTStudy勉強会】Redmine BacklogsプラグインでScrum開発! ~Redmineでアジャイルに開発しよう
【第13回RxTStudy勉強会】Redmine BacklogsプラグインでScrum開発!~Redmineでアジャイルに開発しよう【第13回RxTStudy勉強会】Redmine BacklogsプラグインでScrum開発!~Redmineでアジャイルに開発しよう
【第13回RxTStudy勉強会】Redmine BacklogsプラグインでScrum開発! ~Redmineでアジャイルに開発しよう
 
俺も!「老害」 公開版
俺も!「老害」 公開版俺も!「老害」 公開版
俺も!「老害」 公開版
 
Symantec: 2016 Security Predictions - Infographic
Symantec: 2016 Security Predictions - InfographicSymantec: 2016 Security Predictions - Infographic
Symantec: 2016 Security Predictions - Infographic
 
Digital Assurance: Develop a Comprehensive Testing Strategy for Digital Trans...
Digital Assurance: Develop a Comprehensive Testing Strategy for Digital Trans...Digital Assurance: Develop a Comprehensive Testing Strategy for Digital Trans...
Digital Assurance: Develop a Comprehensive Testing Strategy for Digital Trans...
 

More from Su Yan-Jen

Captain america painting competition -- 12
Captain america painting competition -- 12Captain america painting competition -- 12
Captain america painting competition -- 12
Su Yan-Jen
 
Captain america painting competition -- 11
Captain america painting competition -- 11Captain america painting competition -- 11
Captain america painting competition -- 11
Su Yan-Jen
 
Captain america painting competition 10
Captain america painting competition 10Captain america painting competition 10
Captain america painting competition 10
Su Yan-Jen
 
Captain america painting competition 9
Captain america painting competition 9Captain america painting competition 9
Captain america painting competition 9
Su Yan-Jen
 
Captain america painting competition 8
 Captain america painting competition 8 Captain america painting competition 8
Captain america painting competition 8
Su Yan-Jen
 
Captain america painting competition 7
 Captain america painting competition 7 Captain america painting competition 7
Captain america painting competition 7
Su Yan-Jen
 
Captain america painting competition 6
 Captain america painting competition 6 Captain america painting competition 6
Captain america painting competition 6
Su Yan-Jen
 
Captain america painting competition 5
Captain america painting competition 5Captain america painting competition 5
Captain america painting competition 5
Su Yan-Jen
 
Captain america painting competition 4
Captain america  painting competition 4Captain america  painting competition 4
Captain america painting competition 4
Su Yan-Jen
 
Captain america painting competition 3
Captain america painting competition 3Captain america painting competition 3
Captain america painting competition 3
Su Yan-Jen
 
Captain america painting competition 2
Captain america painting competition 2Captain america painting competition 2
Captain america painting competition 2
Su Yan-Jen
 

More from Su Yan-Jen (20)

Captain america painting competition -- 12
Captain america painting competition -- 12Captain america painting competition -- 12
Captain america painting competition -- 12
 
Captain america painting competition -- 11
Captain america painting competition -- 11Captain america painting competition -- 11
Captain america painting competition -- 11
 
Captain america painting competition 10
Captain america painting competition 10Captain america painting competition 10
Captain america painting competition 10
 
Captain america painting competition 9
Captain america painting competition 9Captain america painting competition 9
Captain america painting competition 9
 
Captain america painting competition 8
 Captain america painting competition 8 Captain america painting competition 8
Captain america painting competition 8
 
Captain america painting competition 7
 Captain america painting competition 7 Captain america painting competition 7
Captain america painting competition 7
 
Captain america painting competition 6
 Captain america painting competition 6 Captain america painting competition 6
Captain america painting competition 6
 
Captain america painting competition 5
Captain america painting competition 5Captain america painting competition 5
Captain america painting competition 5
 
Captain america painting competition 4
Captain america  painting competition 4Captain america  painting competition 4
Captain america painting competition 4
 
Captain america painting competition 3
Captain america painting competition 3Captain america painting competition 3
Captain america painting competition 3
 
Captain america painting competition 2
Captain america painting competition 2Captain america painting competition 2
Captain america painting competition 2
 
Captain America painting competition
Captain America painting competitionCaptain America painting competition
Captain America painting competition
 
PM2.5 visualization
PM2.5 visualizationPM2.5 visualization
PM2.5 visualization
 
Transformer 3
Transformer 3Transformer 3
Transformer 3
 
Transformer 2
Transformer 2Transformer 2
Transformer 2
 
Transformer
TransformerTransformer
Transformer
 
Stereo matching
Stereo matchingStereo matching
Stereo matching
 
Face recognition
Face recognitionFace recognition
Face recognition
 
Data mining of commercial surveillance
Data mining of commercial surveillanceData mining of commercial surveillance
Data mining of commercial surveillance
 
Fundamental matrix
Fundamental matrixFundamental matrix
Fundamental matrix
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Position based fluids

Editor's Notes

  1. 大家好,我是 ked , 我今天要介紹的是發表在 SIGGRAPH 2013 的論文, Position Based Fluids , 他們的方法大幅地提升了流體模擬的 time step , 使得 real-time 的流體模擬成為可能。
  2. 本文的作者都是 nVIDIA 的員工,負責開發 PhysX , 第一作者 Macklin 是 programmer ; 第二作者 Muller 則是他們的 research lead 。
  3. 這是我的 outline , 會依照歷史的順序來介紹 Position based fluids 的演化, 其中 SPH 和 PBD 都是 Muller 提出來的方法, 後來加入了 density constrain 才變成現在的結果。
  4. 我們先從 SPH 說起。
  5. 查字典 hydrodynamics 是流體力學的意思, 不過弔詭的是,雖然 SPH 在 1977 年就已經被提出, 但是一開始它是被應用在星球運行的模擬上, 然後是被運用在火、氣體、和軟性物體等等, 直到 2003 年, Muller 才針對流體在做處理。
  6. SPH 也是一種 particle system , 它把要模擬的 system 用大量的 particles 去逼近它, 每個 particle 有自己的特性,譬如質量、位置、速度、和生命周期等, system 的整體行為就可以由這些 particles 推斷出來。
  7. Particles 之間可以有互動,也可以沒有互動, 例如水花,因為 particles 之間沒有互動,所以可以做快速的模擬, 但是一般的流體它的 particles 是會互相牽制影響的, 這時候為了加速模擬,通常會給 particles 設定一個區域性, 區域以外就沒有影響力。
  8. SPH 是 particle system 的延伸, 就像剛剛講的,每一個 particle 的影響力是根據 kernel function 來決定。
  9. 這樣一來,這些 kernel function 就可以內插出一個 smooth 的 field , 相對於 particle 的質量,我們將這個 field 稱為 density 。
  10. 有了 density 之後,各個位置的 attribute 都可以內插求得; 另外 attributes 的 gradient 也可以內插得到, 不過不同的是,這次是內插 kernel function 的微分。
  11. 接著就要利用這些內插得到的 attributes 求解 Navier-Stokes equation 。 上面這個式子是不可壓縮流的 Navier-Stokes equation , 因為 particles 都隨著流體在動,所以式子左邊的對流項可以忽略掉, 然後改寫成 dv/dt ,也就是加速度 a 。 式子的右邊則是各種力的描述, Pg 是重力;第二項是壓力;最後一項是黏滯力。 所以整個 Navier-stokes equation 用 SPH 來求解, 就會退化到我們熟悉的牛頓第二定理 f = ma , 這裡的 m 就是 density 。 先用 SPH 求得 f 和 density 之後,可以算出 a ; 用 a 更新 SPH ,然後再算出 f 和 density , 如此疊代下去。
  12. 各個力都可以用 SPH 求出, 因為他們要求 particles 之間的作用力是對稱的, 所以壓力的內插方式如中間的式子所示。 而壓力和密度成正比, 所以 pi = k pi 。
  13. 重力不需要改寫; 黏滯力則如同壓力的形式。
  14. 用 SPH 模擬之後,還是要把 surface 畫出來, 他們提到了 2 個可行的方法, 分別是 marching cubes 和 splatting , 各有各的優缺點,結果如圖所示。
  15. 接下來要介紹 PBD 。
  16. 如同之前的投影片所說的, 傳統模擬的計算方式大概都是這幾個步驟: 首先先算出所有外部和內部的力; 然後用受力推算出加速度; 最後再由加速度反推回速度,再由速度得到最後的位置。
  17. 由加速度得到速度,或由速度得到位置,其實都是對時間的積分。 假設要由速度積分位置, 如果把時間和速度當成座標軸,那就會形成一個向量場, 而向量場中的路徑就會是速度積分的結果。
  18. 以前的方法遇到的問題就是, 積分的結果受到 time step 很大的影響, 如圖所示,不同的 time step 會產生不同的路徑。
  19. 這樣的影響可以歸納成兩大類, 第一種是,積分的結果是錯的; 第二種則是,積分的結果不穩定,像圖這樣亂跳。
  20. Muller 2006 年發表在 VRIPHYS 的文章就是要解決不穩定的問題, 事後來看,這一篇文章其實很重要, 它對所有的動態系統提供個一個計算上的 framework , 也詳細說明了可行的最佳化方式, Position Based Fluids ,用的其實就是它的計算方法。
  21. 這就是它提出的 framework 。
  22. 他們主要的想法就是, 將原本外插的動作改變成: 先做最佳化的預測,然後再做內插。
  23. 做模擬的人時常會問的一個問題是, algorithm 是 implicit method 還是 explicit method , 一般來說 implicit method 因為考慮了現在與下一個 time step , 所以 time step 可以拉大,模擬也會比較準。 那他們的方法是屬於 implicit 還是 explicit 呢, 根據作者的說法, solver iteration 如果只有一次,就越接近 explicit function ; 如果越多,就越接近 implicit function 。
  24. 就像剛剛講的, 這個方法改善了傳統方法的穩定性, 但是並不能保證模擬的正確性, 不過穩定性這個因素已經讓它在遊戲界和動畫界成為受歡迎的方法。
  25. 至於他們的計算方式, 我把它留到介紹 Position Based Fluids 的時候再來說明。
  26. Muller 雖然在 PBD 提出了計算的 framework , 不過不同的物體用到的 constraint 也必須跟著改變, 他在文章中雖然有說明如衣服和鋼體的模擬, 卻沒有提到流體, 這一部分到了 density constraint 才將它補足。
  27. 2011 年 Bodin 在 TVCG 發表了一篇名為 Constraint Fluids 的文章, Bodin 在文章中首次提到以固定的 density 作為流體模擬的 constraint , 並且完全取代了 Navier-Stoke equation 。
  28. 這是他們跟 SPH 的比較, 流體的 density 應該是固定的, SPH 模擬的結果,越深的地方 density 卻會越來越大; 而他們的方法卻可以維持一致性。
  29. 在這裡我先講 Position Based Fluids 在計算上所做的改進, 然後再講其他加入的因素。
  30. Position Based Fluids 就是以固定的 density 作為 constraint , 計算上則是沿用 PBD 的方式。 P1 到 Pn 是 particles 的位置; C 則是它的 constraint , density 為常數, 所以當 particle 在適當的位置時,相減等於 0 。
  31. 這個 constraint 可以用一次的泰勒展開去逼近。
  32. 然後再用牛頓法來求解 delta p 。 牛頓法是沿著方程式的 gradient 去找最佳解, 所以 delta p 可以用 C 的一次微分乘上一個常數項取代。 C 的一次微分可以用 SPH 的方法計算, 因此可以得到 particles 的位移常數如下所示。
  33. 最後做一個總結, 他們 particles 位置的計算其實很簡單, 得到位移常數 s 之後, 再兩兩計算 particles 之間的改變量,就可以得到最後的結果。
  34. 另為值得一提的是, 模擬後 surface 的繪製,他們是用 anisotropic 的 kernel 來重建。
  35. 純粹 Position Based Fluids 的計算結果還有一些可以改進的地方, 他們使用 artificial pressure 和 vorticity confinement 來修正。
  36. Artificial pressure 是在改善 particle 過於稀疏的時候所發生估算不正確的問題,加入這個 term 之後會加強 surface tension 的效果,如圖所示。