图学学报 ›› 2025, Vol. 46 ›› Issue (3): 642-654.DOI: 10.11996/JG.j.2095-302X.2025030642
收稿日期:
2024-08-23
接受日期:
2025-01-13
出版日期:
2025-06-30
发布日期:
2025-06-13
通讯作者:
何小伟(1985-),男,研究员,博士。主要研究方向为计算机图形学与物理仿真。E-mail:xiaowei@iscas.ac.cn第一作者:
梁睿凯(2001-),男,硕士研究生。主要研究方向为基于物理的仿真、刚体动力学仿真。E-mail:liangruikai23@mails.ucas.ac.cn
基金资助:
LIANG Ruikai(), LUO Xukun, GUO Yuzhong, HE Xiaowei(
)
Received:
2024-08-23
Accepted:
2025-01-13
Published:
2025-06-30
Online:
2025-06-13
Contact:
HE Xiaowei (1985-), researcher, Ph.D. His main research interests cover computer graphics and physical simulation. E-mail:xiaowei@iscas.ac.cnFirst author:
LIANG Ruikai (2001-), master student. His main research interests cover physics-based simulation and rigid body dynamics simulation. E-mail:liangruikai23@mails.ucas.ac.cn
Supported by:
摘要:
包含刚体和约束的多体动力学模拟在物理仿真中占有重要地位,广泛应用于工程分析、虚拟现实以及游戏动画等领域。传统的刚体物理引擎主要依赖于CPU进行计算,而在现代计算机图形学和实时物理模拟中,GPU的并行计算能力被证明能够显著提高计算性能。为此,研究探索了5种基于雅可比方法的约束求解器在GPU上的实现并对其进行了性能与稳定性分析。具体包括:投影雅可比求解器(PJ)、结合投影雅可比与非线性雅可比的求解器(PJNJ)、投影雅可比与软约束求解器(PJSoft)、基于子步骤策略的雅可比求解器(TJ)和结合子步骤策略的雅可比与软约束求解器(TJSoft)。在基准测试中,软约束方法展现出平滑的约束冲量响应,且子步骤策略在处理高质量比和复杂场景时提供了更为稳定的解决方案。本研究为评估多体模拟中基于GPU的约束求解方案提供了新的视角,对实时物理模拟和交互式计算机图形学具有重要参考价值。
中图分类号:
梁睿凯, 罗旭锟, 郭煜中, 何小伟. 基于GPU的刚体动力学并行求解性能分析[J]. 图学学报, 2025, 46(3): 642-654.
LIANG Ruikai, LUO Xukun, GUO Yuzhong, HE Xiaowei. Performance analysis of GPU-based parallel solvers for rigid body dynamics[J]. Journal of Graphics, 2025, 46(3): 642-654.
算法求解器 | 步长 | 数值稳定性 | 数值精度 | 性能表现 | 应用场景 |
---|---|---|---|---|---|
PJ | ★★ | ★★ | ★★ | ★★★ | 性能优先的实时场景 |
PJSoft | ★★ | ★★★ | ★★ | ★★★ | 性能优先且需要更高稳定性的实时场景 |
TJ | ★★★ | ★★★★ | ★★★ | ★★ | 高精度大步长的实时场景 |
TJSoft | ★★★ | ★★★★★ | ★★★ | ★★ | 高精度大步长且需要更高稳定性的实时场景 |
PJNJ | ★★ | ★★ | ★★ | ★ | 单帧位置误差限度要求较高的场景 |
表1 求解器评估结果
Table 1 Solver evaluation results
算法求解器 | 步长 | 数值稳定性 | 数值精度 | 性能表现 | 应用场景 |
---|---|---|---|---|---|
PJ | ★★ | ★★ | ★★ | ★★★ | 性能优先的实时场景 |
PJSoft | ★★ | ★★★ | ★★ | ★★★ | 性能优先且需要更高稳定性的实时场景 |
TJ | ★★★ | ★★★★ | ★★★ | ★★ | 高精度大步长的实时场景 |
TJSoft | ★★★ | ★★★★★ | ★★★ | ★★ | 高精度大步长且需要更高稳定性的实时场景 |
PJNJ | ★★ | ★★ | ★★ | ★ | 单帧位置误差限度要求较高的场景 |
图5 方块堆叠场景((a) Box stack场景表现;(b)求解前后系统能量变化量;(c)约束误差变化曲线)
Fig. 5 Box stack scene ((a) Box stacking scene performance; (b) System energy change before and after solving; (c) Constraint error variation curve)
图6 锁链和球场景((a) Ball and Chain场景表现;(b)求解前后系统能量变化量;(c)约束误差变化曲线)
Fig. 6 Chain and ball scene ((a) Ball and chain scene performance; (b) System energy change before and after solving; (c) Constraint error variation curve)
图7 穿透场景((a) Overlap场景表现;(b)求解前后系统能量变化量;(c)约束误差变化曲线)
Fig. 7 Overlap scene ((a) Overlap scene performance; (b) System energy change before and after solving; (c) Constraint error variation curve)
算法 | 场景 | ||
---|---|---|---|
Box stack | Ball and chain | Overlap | |
PJ | 7.093 2 | 7.212 8 | 6.804 4 |
PJNJ | 54.825 1 | 53.645 8 | 45.276 9 |
PJSoft | 7.652 4 | 7.376 4 | 6.419 0 |
TJ | 10.338 9 | 9.641 3 | 8.920 8 |
TJSoft | 10.503 3 | 9.326 5 | 7.833 7 |
表2 时间开销对比/ms
Table 2 Time consumption comparison/ms
算法 | 场景 | ||
---|---|---|---|
Box stack | Ball and chain | Overlap | |
PJ | 7.093 2 | 7.212 8 | 6.804 4 |
PJNJ | 54.825 1 | 53.645 8 | 45.276 9 |
PJSoft | 7.652 4 | 7.376 4 | 6.419 0 |
TJ | 10.338 9 | 9.641 3 | 8.920 8 |
TJSoft | 10.503 3 | 9.326 5 | 7.833 7 |
图10 不同求解器在复杂场景——车过吊桥的表现
Fig. 10 Performance of different solvers in complex scenarios—cars crossing suspension bridges ((a) PJ; (b) PJNJ; (c) PJSoft; (d) TJ; (e) TJSoft)
图11 不同求解器在复杂场景——风车转动撞击堆积块的表现
Fig. 11 Performance of different solvers in complex scenarios—windmill rotation impacting stacked blocks ((a) PJ; (b) PJNJ; (c) PJSoft; (d) TJ; (e) TJSoft)
[1] | PARBERRY I. Introduction to game physics with Box2D[M]. Boca Raton: CRC Press, 2017: 51-78. |
[2] | BARAFF D. Coping with friction for non-penetrating rigid body simulation[J]. ACM SIGGRAPH Computer Graphics, 1991, 25(4): 31-41. |
[3] | TASORA A, NEGRUT D, ANITESCU M. A GPU-based implementation of a cone convex complementarity approach for simulating rigid body dynamics with frictional contact[C]// ASME 2008 International Mechanical Engineering Congress and Exposition. New York: ASME, 2008: 107-118. |
[4] | STEWART D E, TRINKLE J C. An implicit time‐stepping scheme for rigid body dynamics with inelastic collisions and coulomb friction[J]. International Journal for Numerical Methods in Engineering, 1996, 39(15): 2673-2691. |
[5] | ANITESCU M, POTRA F A. Formulating dynamic multi-rigid-body contact problems with friction as solvable linear complementarity problems[J]. Nonlinear Dynamics, 1997, 14(3): 231-247. |
[6] | CLINE M B, PAI D K. Post-stabilization for rigid body simulation with contact and constraints[C]// 2003 IEEE International Conference on Robotics and Automation. New York: IEEE Press, 2003: 3744-3751. |
[7] | CATTO E. Iterative dynamics with temporal coherence[EB/OL]. [2024-06-23]https://box2d.org/files/ErinCatto_IterativeDynamics_GDC2005.pdf. |
[8] | ERLEBEN K. Stable, robust, and versatile multibody dynamics animation[D]. Copenhagen: University of Copenhagen, 2004. |
[9] | MURTY K G, YU V F. Linear complementarity, linear and nonlinear programming[M]. Berlin : Heldermann , 1988: 1-11. |
[10] | HARADA T. Parallelizing the physics pipeline: physics simulations on the GPU[EB/OL]. [2024-06-23]https://ubm-twvide001.s3.amazonaws.com/01/vault/gdc10/slides/Harada_Takahiro_PhysicsForProgvammers_GPUPhysics.pdf. |
[11] | TONGE R, WYATT B, NICHOLSON N. Physx GPU rigid bodies in batman: Arkham asylum[J]. Game Programming Gems, 2010, 8: 590-601. |
[12] | CATTO E. Modeling and solving constraints[EB/OL]. [2024-06-23]https://box2d.org/files/ErinCatto_ModelingAndSolvingConstraints_GDC2009.pdf. |
[13] | COTTLE R W, PANG J S, STONE R E. The linear complementarity problem[M]. Philadelphia: Society for Industrial and Applied Mathematics, 2009: 1-10. |
[14] | COUMANS E. Bullet physics simulation[C]// ACM SIGGRAPH 2015 Courses. New York: ACM, 2015: 7. |
[15] | HARADA T. A parallel constraint solver for a rigid body simulation[C]// SIGGRAPH Asia 2011 Sketches. New York: ACM, 2011: 22. |
[16] | TONGE R, BENEVOLENSKI F, VOROSHILOV A. Mass splitting for jitter-free parallel rigid body simulation[J]. ACM Transactions on Graphics, 2012, 31(4): 105. |
[17] | MACKLIN M, ERLEBEN K, MÜLLER M, et al. Non-smooth newton methods for deformable multi-body dynamics[J]. ACM Transactions on Graphics, 2019, 38(5): 140. |
[18] | CROMER A. Stable solutions using the Euler approximation[J]. American Journal of Physics, 1981, 49(5): 455-459. |
[19] | CHAPPUIS D. Constraints derivation for rigid body simulation in 3D[EB/OL]. (2013-11-13). [2024-06-23]https://danielchappuis.ch/download/ConstraintsDerivationRigidBody3D.pdf. |
[20] | BAUMGARTE J. Stabilization of constraints and integrals of motion in dynamical systems[J]. Computer Methods in Applied Mechanics and Engineering, 1972, 1(1): 1-16. |
[21] | CATTO E. Soft constraints: reinventing the spring[EB/OL]. [2024-06-23]https://box2d.org/files/ErinCatto_SoftConstraints_GDC2011.pdf. |
[22] | MÜLLER M, MACKLIN M, CHENTANEZ N, et al. Detailed rigid body simulation with extended position based dynamics[J]. Computer Graphics Forum, 2020, 39(8): 101-112. |
[23] | MACKLIN M, STOREY K, LU M, et al. Small steps in physics simulation[C]// The 18th Annual ACM SIGGRAPH/ Eurographics Symposium on Computer Animation. New York: ACM, 2019: 2. |
[1] | 雷玉林, 刘利刚. 基于深度强化学习的可缓冲的物体运输和装箱[J]. 图学学报, 2025, 46(3): 697-708. |
[2] | 胡昕洋, 王鹏飞, 曾琼, 蒋鹏, 辛士庆, 屠长河. 基于维诺图的三维钻孔建模算法[J]. 图学学报, 2025, 46(3): 676-685. |
[3] | 李默, 蔡晨曙, 陈俊诏, 王萍, 赵博, 曾龙, 李明, 方强. 基于二维图纸的机载线缆三维重建方法[J]. 图学学报, 2025, 46(3): 666-675. |
[4] | 胡悦, 孙智达, 黄惠. 面向无人机路径规划的可视分析系统[J]. 图学学报, 2025, 46(3): 655-665. |
[5] | 李晓丽, 张昆, 杜振龙, 陈东, 宋爽. 基于时序区间反转的隐式曲面动画渲染方法[J]. 图学学报, 2025, 46(3): 635-641. |
[6] | 于冰, 程广, 黄东晋, 丁友东. 基于双流网络融合的三维人体网格重建[J]. 图学学报, 2025, 46(3): 625-634. |
[7] | 王昶畅, 江坤, 姜凯, 张鹏, 苏智勇. 基于反馈的迭代采样高噪声点云去噪框架[J]. 图学学报, 2025, 46(3): 614-624. |
[8] | 刘鸿硕, 白静, 晏浩, 林淦. 面向三维点云的平衡泛化和特化的细粒度分类网络[J]. 图学学报, 2025, 46(3): 602-613. |
[9] | 马扬, 黄璐洁, 彭伟龙, 吴志泽, 唐可可, 方美娥. 基于CLIP语义偏移的三维点云可迁移攻击[J]. 图学学报, 2025, 46(3): 588-601. |
[10] | 崔丽莎, 宋志文, 姜晓恒, 马鑫, 陈恩庆, 徐明亮. 基于边界和语义感知的表面缺陷分割网络[J]. 图学学报, 2025, 46(3): 578-587. |
[11] | 王素琴, 杜雨洁, 石敏, 朱登明. 类别不均衡的少样本工业产品表观缺陷检测[J]. 图学学报, 2025, 46(3): 568-577. |
[12] | 孙浩, 谢滔, 何龙, 郭文忠, 虞永方, 吴其军, 王建伟, 东辉. 多模态文本视觉大模型机器人地形感知算法研究[J]. 图学学报, 2025, 46(3): 558-567. |
[13] | 周峥, 戴亚桥, 易任娇, 蓝龙, 朱晨阳. 基于RGB特征的下一个最优视图导航技术[J]. 图学学报, 2025, 46(3): 551-557. |
[14] | 刘鑫, 李洋, 冯胜杰, 吴晓群. 面向RGB-D数据的特征线提取和表示算法[J]. 图学学报, 2025, 46(3): 542-550. |
[15] | 张迪, 张文安, 姜智德, 吴爱霞, 孔浩, 郭显, 陈为. TCPColor:基于文本到图像生成模型的中国画配色方案推荐系统[J]. 图学学报, 2025, 46(3): 520-531. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||