(SIG 2020) GPU-based Cloth Self Collisions论文摘要
本文禁止转载
B站:Heskey0
A Safe and Fast Repulsion Method for GPU-based Cloth Self Collisions
Our solution is to convert continuous constraints into three types of constraints:
- discrete edge length constraints
- discrete vertex distance constraints
- vertex displacement constraints
The experiment shows that it runs at least one order of magnitude faster than existing simulators.
Chapter 1. Introduction
technical contributions:
-
Constraint enforcement: we formulate our collision handling process as two phases:
-
a soft phase that takes a small computational time to satisfy constraints most of the time
-
a hard phase that enforces constraints strictly at the cost of more computational time and/or less accuracy
-
-
Dynamics-collision integration: integrate collision handling with any cloth dynamics solver:
- Our solution is a splitting method that treats cloth dynamics and collision handling as two independent yet coupled processes.
-
Uniform mesh sampling: To minimize the difference of edge lengths in both the reference configuration and the deformed configuration, we present:
- a uniform mesh sampling scheme for the reference configuration
- an adaptive mesh resampling scheme for the deformed configuration
Since it treats cloth dynamics and collision handling as two independent processes, we can conveniently replace the current dynamics solver by others in the future.
Chapter 2. Related Work
Cloth collision handling:
- the large time step is the common foe to most of the collision handling algorithms. As pointed out by Harmon and colleagues [2009], it is fundamentally the large vertex displacement happening within one time step that causes all of the problems. To make collision handling safe and robust, we should find a way to limit the vertex displacement.
Collision culling:
-
Collision culling techniques can be roughly grouped into two categories:
- spatial partitioning
- bounding volume hierarchy [Schvartzman et al. 2010; Tang et al. 2010, 2011; Zheng and James 2012].
-
GPU-based implementations of both categories have been investigated [Lauterbach et al. 2010; Pabst et al. 2010; Tang et al. 2018a,b] previously, although grid-based spatial partitioning on a GPU is slightly more popular in our opinion, thanks to its simplicity and fast memory access.
Dynamics-collision integration:
- When the time step is small, e.g. when using explicit time integration, simulators can simply perform collision handling after cloth dynamics as post-processing at the end of every time step.
- When the time step is large, especially when we use modern cloth dynamics solvers, simulators must use many sub-steps if we still want to post-process collisions.
- A relatively unpopular idea of avoiding troubles in the integration of cloth dynamics and collision handling is to use two state vectors, one for cloth dynamics and one for collision handling.
Chapter 3. Distance Conditions for Self Intersections
3.1 Vertex-triangle intersection
Let
- \(x_i\): the position of vertex \(i\).
- \(x_jx_kx_l\): the vertex position of triangle \(jkl\).
- \(x_{ij}=x_i-x_j\).
When they are in intersection, we define the distance from vertex to the closest triangle corner:
相交时,其上界:
则不相交时,为其否定
3.2 Edge-edge intersection
Let
- \(x_ix_j\) and \(x_kx_l\) be the vertex positions of two intersecting edges
相交时,其上界:
则不相交时,为其否定
Chapter 4. Constraint Formulation and Enforcement
4.1 Continuous and Discrete Constraints
Since:
- \(B_{i,jkl},B_{ij,kl}\) are functions of edge lengths varying over time
- \(B_{i,jkl},B_{ij,kl}\) are increasing functions of edge lengths
we propose a constant upper bound \(L\) on all of the edge lengths. we treat \(B=\max(B_{i,jkl},B_{ij,kl})=\max(L/\sqrt3,L/\sqrt2)=L/\sqrt2\) as the global lower bound on the distance between any two non-adjacent vertices within a mesh.
The intersection-free constraints:
we typically assume that the trajectory between two consecutive updates is linear. 使用 \(t\) 作为插值系数,则上式等价于:(continuous constraints)
for any \(t\in(0,1]\).
discrete constraints:
and \(||x_i^{[k+1]}-x_i^{[k]}||^2\le(B+B^{tight})^2-B^2\) for every vertex \(i\).
we use a small constant \(B^{tight}\) to tighten every vertex distance constraint
4.2 Constraint Enforcement
how can we achieve the satisfaction of continuous constraints and discrete constraints, without even addressing vertex displacement constraints?
Under a small initial displacement assumption, we aim at making most of the soft phase cases successful. But if the soft phase does fail, we switch to run a failsafe method in the hard phase, which can be safely terminated within a limited computational time thanks to novel step size conditions.
Let:
- \(x^{[k]}\): the latest state vector.
- \(x^{init}\): the initial vertex state vector for the next update
Our goal is to find the next update \(x^{[k+1]}\), which is the closest to \(x^{init}\) and satisfies continuous constraints.
we formulate the constraint enforcement problem as:
4.2.1 The soft phase
We convert the original constrained optimization problem into the following unconstrained one:
in which
- \(ρ\): is a penalty strength constant
- \(\epsilon^{slack}\): a positive slack constant
- each constraint penalty term is active when \(x\) violates its corresponding discrete constraint: \(c_{ij}(x)\ge\epsilon^{slack}\)
4.2.2 The hard phase
The main purpose of the hard phase is to guarantee the safe termination of the collision handling process within a limited computational time.
we model constraints as log barriers and apply the interior point method:
where:
\(\mu\): a log barrier constant
\(f(x,\epsilon)\): a piecewise function:
\[f(x,\epsilon)=\left\{ \begin{aligned} &x&if\,x\le0\\ &a_3x^3+a_2x^2+a_1x+a_0&if\,0<x\le \epsilon\\ &\epsilon&if\,\epsilon\le x \end{aligned} \right. \]in which the coefficients are calculated for \(C^0\) and \(C^1\) continuity:
\[\pmatrix{ &0&0&0&1\\ &\epsilon^3&\epsilon^2&\epsilon&1\\ &0&0&1&0\\ &3\epsilon^2&2\epsilon&1&0 } \pmatrix{ a_3\\a_2\\a_1\\a_0 }= \pmatrix{ 0\\\epsilon\\1\\0 } \]
Proximity search:(Tang et al. 2018b)
our simulator uses grid-based spatial partitioning to accelerate this proximity search. Let the grid cell size be equal to \(\sqrt{(B+B^{tight})^2+\epsilon^{slack}}\).
Chapter 5. Dynamics-Constraint integration
Original cloth simulation problem:
we split the vertex state vector into two:
- \(x\) for collision handling
- \(y\) for cloth dynamics
We then formulate the original cloth simulation problem into:
we set \(\sigma=80,000s^{-2}\).
Next we divide it into two sub-problems:
since constraints do exist in a collision step, we initialize vertex \(i\) for the collision handling process using an initial displacement limit \(D\):
we set \(D=0.25\) mm.
in the collision step, we solve the second sub-problem by the proposed collision handling process with a displacement limit
Algorithm:(A GPU-based cloth simulator)
- Input: \(x^t,y^t,v^t,\sigma,\Delta t\).
- output: \(x^{t+\Delta t}\).
Pipeline: