(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.

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:

\[D(x_i,x_jx_kx_l)=\min(||x_{ij}||,||x_{ik}||,||x_{il}||) \]

相交时,其上界:

\[D\le B_{i,jkl}=\left\{ \begin{aligned} &r_{jkl}=\frac{||x_{jk}||\cdot||x_{kl}||\cdot||x_{lj}||}{\sqrt{l_{jkl}(l_{jkl}-2||x_{jk}||)(l_{jkl}-2||x_{kl}||)(l_{jkl}-2||x_{lj}||)}} &if\, acute\\ &\frac12\max(||x_{jk}||,||x_{kl}||,||x_{lj}||)&,therwise \end{aligned} \right. \]

则不相交时,为其否定

3.2 Edge-edge intersection

Let

  • \(x_ix_j\) and \(x_kx_l\) be the vertex positions of two intersecting edges

\[D(x_ix_j,x_kx_l)=\min(||x_{ik}||,||x_{il}||,||x_{jk}||,||x_{jl}||) \]

相交时,其上界:

\[D\le B_{ij,kl}=\frac12\sqrt{||x_{ij}||^2+||x_{kl}||^2} \]

则不相交时,为其否定

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:

\[\left\{ \begin{aligned} &||x_{ij}(t)||^2\le L^2&if\,\{i,j\}is\quad edge\\ &||x_{ij}(t)||^2\ge B^2=L^2/2&otherwise \end{aligned} \right. \]

we typically assume that the trajectory between two consecutive updates is linear. 使用 \(t\) 作为插值系数,则上式等价于:(continuous constraints

\[\left\{ \begin{aligned} &||(1-t)x_{ij}^{[k]}+tx_{ij}^{[k]}||^2\le L^2&if\,\{i,j\}is\quad edge\\ &||(1-t)x_{ij}^{[k]}+tx_{ij}^{[k]}||^2\ge B^2=L^2/2&otherwise \end{aligned} \right. \]

for any \(t\in(0,1]\).

discrete constraints:

\[\left\{ \begin{aligned} &||x_{ij}^{[k+1]}||^2\le L^2&if\,\{i,j\}is\quad edge\\ &||x_{ij}^{[k+1]}||^2\ge (B+B^{tight})^2&otherwise \end{aligned} \right. \]

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:

\[x^{[k+1]}=\arg\min_x||x-x^{init}||^2,\quad s.t. c_{ij}(x)\ge0for\,\, any\{i,j\} \]

4.2.1 The soft phase

We convert the original constrained optimization problem into the following unconstrained one:

\[x^{[k+1]}=\arg\min_x\left\{ ||x-x^{init}||^2-\rho\sum_{i,j}\min(c_{ij}(x)-\epsilon^{slack},0) \right\} \]

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:

\[x^{[k+1]}=\arg\min_x\left\{ ||x-x^{init}||^2-\mu\sum_{i,j}\log(f(c_{ij}(x),\epsilon^{slack})) \right\} \]

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:

\[\{x^{t+\Delta t},y^{t+\Delta t}\}=\arg\min_{x,y}\left\{ E(y,y^t+\Delta tv^t)+\frac\sigma2||x-y||^2_M \right\}\\ s.t.\quad C_{ij}(x^t,x)\ge0\,and\,c_{ij}(x)\ge0,\, for\, any \{i,j\} \]

we set \(\sigma=80,000s^{-2}\).

Next we divide it into two sub-problems:

\[\left\{ \begin{aligned} &y^{[k+1]}=\arg\min_y\left\{ E(y,y^t+\Delta tv^t)+\frac\sigma2||x^{[k]}-y||^2_M \right\}\\ &x^{[k+1]}=\arg\min_x\frac\sigma2||x-y^{[k+1]}||^2_M\\ &s.t.\quad C_{ij}(x^t,x)\ge0\,and\,c_{ij}(x)\ge0,\, for\, any \{i,j\} \end{aligned} \right. \]

since constraints do exist in a collision step, we initialize vertex \(i\) for the collision handling process using an initial displacement limit \(D\):

\[x_i^{init}=x_i^{[k]}+\min\left(\frac{D}{||y_i^{[k+1]}-x_i^{[k]}||},1\right)(y_i^{[k+1]}-x_i^{[k]}) \]

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}\).

image

Pipeline:

image

posted @ 2022-08-08 15:37  Heskey0  阅读(273)  评论(0编辑  收藏  举报

载入天数...载入时分秒...