Abstract
Meshes are an indispensable representation in many graphics applications because they provide conformal spatial discretizations. However, mesh-based operations are often slow due to unstructured memory access patterns. We propose MeshTaichi, a novel mesh compiler that provides an intuitive programming model for efficient mesh-based operations. Our programming model hides the complex indexing system from users and allows users to write mesh-based operations using reference-style neighborhood queries. Our compiler achieves its high performance by exploiting data locality. We partition input meshes and prepare the wanted relations by inspecting users' code during compile time. During run time, we further utilize on-chip memory (shared memory on GPU and L1 cache on CPU) to access the wanted attributes of mesh elements efficiently. Our compiler decouples low-level optimization options with computations, so that users can explore different localized data attributes and different memory orderings without changing their computation code. As a result, users can write concise code using our programming model to generate efficient mesh-based computations on both CPU and GPU backends. We test MeshTaichi on a variety of physically-based simulation and geometry processing applications with both triangle and tetrahedron meshes. MeshTaichi achieves a consistent speedup ranging from 1.4× to 6×, compared to state-of-the-art mesh data structures and compilers.
Supplemental Material
- David Baraff and Andrew Witkin. 1998. Large steps in cloth simulation. In Proceedings of the 25th annual conference on Computer graphics and interactive techniques. 43--54.Google ScholarDigital Library
- Bruce G Baumgart. 1972. Winged edge polyhedron representation. Technical Report. STANFORD UNIV CA DEPT OF COMPUTER SCIENCE.Google Scholar
- Gilbert Louis Bernstein and Fredrik Kjolstad. 2016. Perspectives: Why New Programming Languages for Simulation? ACM Transactions on Graphics (TOG) 35, 2 (2016), 1--3.Google ScholarDigital Library
- Gilbert Louis Bernstein, Chinmayee Shah, Crystal Lemire, Zachary Devito, Matthew Fisher, Philip Levis, and Pat Hanrahan. 2016. Ebb: A DSL for physical simulation on CPUs and GPUs. ACM Trans. Graph. 35, 2 (2016), 21:1--21:12.Google ScholarDigital Library
- Volker Blanz and Thomas Vetter. 1999. A morphable model for the synthesis of 3D faces. In Proceedings of the 26th annual conference on Computer graphics and interactive techniques. 187--194.Google ScholarDigital Library
- Mario Botsch, Stephan Steinberg, Stephan Bischoff, and Leif Kobbelt. 2002. Openmesh-a generic and efficient polygon mesh data structure. (2002).Google Scholar
- Sofien Bouaziz, Sebastian Martin, Tiantian Liu, Ladislav Kavan, and Mark Pauly. 2014. Projective dynamics: Fusing constraint projections for fast simulation. ACM transactions on graphics (TOG) 33, 4 (2014), 1--11.Google ScholarDigital Library
- Ajay Brahmakshatriya, Emily Furst, Victor A Ying, Claire Hsu, Changwan Hong, Max Ruttenberg, Yunming Zhang, Dai Cheol Jung, Dustin Richmond, Michael B Taylor, et al. 2021. Taming the Zoo: The unified GraphIt compiler framework for novel architectures. In 2021 ACM/IEEE 48th Annual International Symposium on Computer Architecture (ISCA). IEEE, 429--442.Google ScholarDigital Library
- Luciano A Romero Calla, Lizeth J Fuentes Perez, and Anselmo A Montenegro. 2019. A minimalistic approach for fast computation of geodesic distances on triangular meshes. Computers & Graphics 84 (2019), 77--92.Google ScholarDigital Library
- Swen Campagna, Leif Kobbelt, and Hans-Peter Seidel. 1998. Directed edges---a scalable representation for triangle meshes. Journal of Graphics tools 3, 4 (1998), 1--11.Google ScholarDigital Library
- He Chen, Hyojoon Park, Kutay Macit, and Ladislav Kavan. 2021. Capturing Detailed Deformations of Moving Human Bodies. arXiv preprint arXiv:2102.07343 (2021).Google Scholar
- Mathieu Desbrun, Mark Meyer, Peter Schröder, and Alan H Barr. 1999. Implicit fairing of irregular meshes using diffusion and curvature flow. In Proceedings of the 26th annual conference on Computer graphics and interactive techniques. 317--324.Google ScholarDigital Library
- Zach DeVito, Niels Joubert, Francisco Palacios, Stephen Oakley, Montserrat Medina, Mike Barrientos, Erich Elsen, Frank Ham, Alex Aiken, Karthik Duraisamy, Eric Darve, Juan Alonso, and Pat Hanrahan. 2011. Liszt: A Domain Specific Language for Building Portable Mesh-based PDE Solvers. Proceedings of 2011 SC - International Conference for High Performance Computing, Networking, Storage and Analysis 3, 9.Google ScholarDigital Library
- Antonio DiCarlo, Alberto Paoluzzi, and Vadim Shapiro. 2014. Linear algebraic representation for topological structures. Computer-Aided Design 46 (2014), 269--274.Google ScholarDigital Library
- Yu Fang, Minchen Li, Ming Gao, and Chenfanfu Jiang. 2019. Silly rubber: an implicit material point method for simulating non-equilibrated viscoelastic and elastoplastic solids. ACM Transactions on Graphics (TOG) 38, 4 (2019), 1--13.Google ScholarDigital Library
- Ming Gao, Xinlei Wang, Kui Wu, Andre Pradhana-Tampubolon, Eftychios Sifakis, Yuksel Cem, and Chenfanfu Jiang. 2018. GPU Optimization of Material Point Methods. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 32, 4 (2018), 102.Google Scholar
- Leonidas Guibas and Jorge Stolfi. 1985. Primitives for the manipulation of general subdivisions and the computation of Voronoi. ACM transactions on graphics (TOG) 4, 2 (1985), 74--123.Google Scholar
- Yuanming Hu, Luke Anderson, Tzu-Mao Li, Qi Sun, Nathan Carr, Jonathan Ragan-Kelley, and Frédo Durand. 2020. DiffTaichi: Differentiable Programming for Physical Simulation. ICLR (2020).Google Scholar
- Yuanming Hu, Yu Fang, Ziheng Ge, Ziyin Qu, Yixin Zhu, Andre Pradhana, and Chenfanfu Jiang. 2018a. A moving least squares material point method with displacement discontinuity and two-way rigid body coupling. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 37, 4 (2018), 150.Google ScholarDigital Library
- Yuanming Hu, Tzu-Mao Li, Luke Anderson, Jonathan Ragan-Kelley, and Frédo Durand. 2019. Taichi: a language for high-performance computation on spatially sparse data structures. ACM Transactions on Graphics (TOG) 38, 6 (2019), 201.Google ScholarDigital Library
- Yuanming Hu, Jiafeng Liu, Xuanda Yang, Mingkuan Xu, Ye Kuang, Weiwei Xu, Qiang Dai, William T. Freeman, and Frédo Durand. 2021. QuanTaichi: A Compiler for Quantized Simulations. ACM Trans. Graph. 40, 4, Article 182 (July 2021), 16 pages.Google ScholarDigital Library
- Yixin Hu, Qingnan Zhou, Xifeng Gao, Alec Jacobson, Denis Zorin, and Daniele Panozzo. 2018b. Tetrahedral meshing in the wild. ACM Trans. Graph. 37, 4 (2018), 60--1.Google ScholarDigital Library
- Markus Ihmsen, Nadir Akinci, Markus Becker, and Matthias Teschner. 2011. A parallel SPH implementation on multi-core CPUs. In Computer Graphics Forum, Vol. 30. Wiley Online Library, 99--112.Google Scholar
- Chenfanfu Jiang, Theodore Gast, and Joseph Teran. 2017. Anisotropic elastoplasticity for cloth, knit and hair frictional contact. ACM Transactions on Graphics (TOG) 36, 4 (2017), 1--14.Google ScholarDigital Library
- Chenfanfu Jiang, Craig Schroeder, Andrew Selle, Joseph Teran, and Alexey Stomakhin. 2015. The affine particle-in-cell method. ACM Transactions on Graphics (TOG) 34, 4 (2015), 1--10.Google ScholarDigital Library
- Petr Kadleček, Alexandru-Eugen Ichim, Tiantian Liu, Jaroslav Křivánek, and Ladislav Kavan. 2016. Reconstructing personalized anatomical models for physics-based body animation. ACM Transactions on Graphics (TOG) 35, 6 (2016), 1--13.Google ScholarDigital Library
- Lutz Kettner and Fernando Cacciola. 2006. Halfedge data structures. CGAL User and Reference Manual 3 (2006).Google Scholar
- Fredrik Kjolstad, Shoaib Kamil, Jonathan Ragan-Kelley, David I. W. Levin, Shinjiro Sueda, Desai Chen, Etienne Vouga, Danny M. Kaufman, Gurtej Kanwar, Wojciech Matusik, and Saman Amarasinghe. 2016. Simit: A language for physical simulation. ACM Trans. Graph. 35, 2 (2016), 20:1--20:21.Google ScholarDigital Library
- Fredrik Berg Kjolstad and Marc Snir. 2010. Ghost cell pattern. In Proceedings of the 2010 Workshop on Parallel Programming Patterns. 1--9.Google ScholarDigital Library
- Chris Lattner and Vikram Adve. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. In Code Generation and Optimization.Google Scholar
- Tiantian Liu, Adam W Bargteil, James F O'Brien, and Ladislav Kavan. 2013. Fast simulation of mass-spring systems. ACM Transactions on Graphics (TOG) 32, 6 (2013), 1--7.Google ScholarDigital Library
- Miles Macklin, Matthias Müller, and Nuttapong Chentanez. 2016. XPBD: position-based simulation of compliant constrained dynamics. In Proceedings of the 9th International Conference on Motion in Games. 49--54.Google ScholarDigital Library
- Ahmed H. Mahmoud, Serban D. Porumbescu, and John D. Owens. 2021. RXMesh: A GPU Mesh Data Structure. ACM Trans. Graph. 40, 4, Article 104 (July 2021), 16 pages.Google ScholarDigital Library
- Martti Mäntylä. 1987. An introduction to solid modeling. Computer Science Press, Inc.Google Scholar
- Nelson L. Max. 1999. Weights for Computing Vertex Normals from Facet Normals. J. Graphics, GPU, & Game Tools 4 (1999), 1--6.Google Scholar
- Matthias Müller, Bruno Heidelberger, Marcus Hennix, and John Ratcliff. 2007. Position based dynamics. Journal of Visual Communication and Image Representation 18, 2 (2007), 109--118.Google ScholarDigital Library
- Ken Museth, Jeff Lait, John Johanson, Jeff Budsberg, Ron Henderson, Mihai Alden, Peter Cucka, David Hill, and Andrew Pearce. 2013. OpenVDB: an open-source data structure and toolkit for high-resolution volumes. In Acm siggraph 2013 courses. 1--1.Google Scholar
- Rahul Narain, Matthew Overby, and George E Brown. 2016. ADMM⊇ projective dynamics: fast simulation of general constitutive models.. In Symposium on Computer Animation, Vol. 1. 2016.Google Scholar
- Hang Si. 2015. TetGen, a Delaunay-Based Quality Tetrahedral Mesh Generator. ACM Trans. Math. Softw. 41, 2, Article 11 (feb 2015), 36 pages.Google ScholarDigital Library
- Eftychios Sifakis and Jernej Barbic. 2012. FEM simulation of 3D deformable solids: a practitioner's guide to theory, discretization and model reduction. In Acm siggraph 2012 courses. 1--50.Google Scholar
- Demetri Terzopoulos, John Platt, Alan Barr, and Kurt Fleischer. 1987. Elastically deformable models. In Proceedings of the 14th annual conference on Computer graphics and interactive techniques. 205--214.Google ScholarDigital Library
- Zangyueyang Xian, Xin Tong, and Tiantian Liu. 2019. A scalable galerkin multigrid method for real-time simulation of deformable objects. ACM Transactions on Graphics (TOG) 38, 6 (2019), 1--13.Google ScholarDigital Library
- Cem Yuksel, Scott Schaefer, and John Keyser. 2009. Hair meshes. ACM Transactions on Graphics (TOG) 28, 5 (2009), 1--7.Google ScholarDigital Library
- Yunming Zhang, Mengjiao Yang, Riyadh Baghdadi, Shoaib Kamil, Julian Shun, and Saman Amarasinghe. 2018. GraphIt: A high-performance graph DSL. Proceedings of the ACM on Programming Languages 2, OOPSLA (2018), 121.Google ScholarDigital Library
- Yili Zhao and Jernej Barbič. 2013. Interactive authoring of simulation-ready plants. ACM Transactions on Graphics (TOG) 32, 4 (2013), 1--12.Google ScholarDigital Library
- Qingnan Zhou and Alec Jacobson. 2016. Thingi10K: A Dataset of 10,000 3D-Printing Models. arXiv preprint arXiv:1605.04797 (2016).Google Scholar
Index Terms
- MeshTaichi: A Compiler for Efficient Mesh-Based Operations
Recommendations
Adaptive mesh coarsening for quadrilateral and hexahedral meshes
Mesh adaptation methods can improve the efficiency and accuracy of solutions to computational modeling problems. In many applications involving quadrilateral and hexahedral meshes, local modifications which maintain the original element type are ...
Localized coarsening of conforming all-hexahedral meshes
Finite element mesh adaptation methods can be used to improve the efficiency and accuracy of solutions to computational modeling problems. In many applications involving hexahedral meshes, localized modifications which preserve a conforming all-...
Subdivision templates for converting a non-conformal hex-dominant mesh to a conformal hex-dominant mesh without pyramid elements
This paper presents a computational method for converting a non-conformal hex-dominant mesh to a conformal hex-dominant mesh without help of pyramid elements. During the conversion, the proposed method subdivides a non-conformal element by applying a ...
Comments