Transcript
  • Local Optimization for Robust Signed Distance Field Collision

    Miles Macklin, Kenny Erleben, Matthias Müller, Nuttapong Chentanez, Stefan Jeschke, Zach Corse

  • 2

    QUICK RECAP ON SDFS

    • Implicit shape representation:

    • Inside / outside

    • Discrete or analytic

    • GPU friendly

    • Explicit surface representation:

    • Triangle mesh

    • Convex mesh

    � = 0

    � > 0

    � < 0

    [Quilez 2008]

  • 3

    USING SDFS FOR COLLISION DETECTION

    • Contact constraint

    • Normal is given by gradient:

    • Closest point is given by:

    • Not an approximation!

    x⇤ = x�r�(x)�(x)

    n = r�(x)

    C(x) = �(x)� r � 0

    x

    nx⇤

    � < 0

  • 4

    HOW TO HANDLE SURFACE CONTACT

    • SDFs are queried at a point in space

    • How to query surfaces, e.g.: cloth?

    • One approach: point sample

    • Generate many samples on the surface and consider them all

    • Pros:

    • Very simple

    • Highly parallel

    • Cons:

    • Generates lots of contacts

    • Can still miss features[Basu 2015]

  • 5

    POINT SAMPLING - 1X

  • 6

    POINT SAMPLING - 64X

  • 7

    OUR APPROACH

    • We propose a local optimization approach to generate continuous contacts

    • Find closest or deepest point over each mesh element, e.g.: edge/face

    • Generate contact at this point

  • 8

    OPTIMIZATION PROBLEM

    • Given a convex domain (edge, face)

    • Minimize non-linear and non-convex objective

    • In general SDFs may represent arbitrarily complex functions

    • Can only hope for a local minimum

    • For many cases this is acceptable

    argminu,v,w

    �(up+ vq+ wr)

    s.t. u, v, w � 0u+ v + w = 1

    p

    q

    r

  • 9

    PROJECTED GRADIENT DESCENT

    • Simplest possible optimization method

    • Move along the SDF gradient

    • If we step out of the face then project back onto the closest point

    • Requires choosing a step-length to move along (or line search)

    • Good news, gradient has unit magnitude:

    p

    r

    9

    kr�(x)k = 1

    xi+1 = P(xi � ↵r�)

    q

    x0

    x1

    x2

  • 10

    FRANK-WOLFE METHOD

    • Convex optimization on a convex domain

    • Does not require any projection operation

    • Linearize objective and pick best vertex

    • Uses a decreasing step size to achieve convergence (no step size)

    • [Jaggi 2013]

    p

    q

    r

    x0

    x1

    x2

  • 11

    GOLDEN-SECTION SEARCH

    • Generalization of bisection (root finding) to optimization problems

    • Applicable to 1D problems (i.e.: edges)

    • Uses a recurrence based on Fibonacci to define iterates

    p q

    x0

    x1

    x2

  • 12

    ALGORITHM

    • for each element (edge, tri)

    • Test bounding sphere (culling)

    • Pick starting point (midpoint, minimum)

    • while !converged:

    • x* = step(x)

    • if sdf(x*) < contact_dist

    • output contact (x*)

    p

    q

    r

    Bounding Sphere Culling

    � < 0

  • 13

    SHADER TOY

    https://www.shadertoy.com/view/wdcGDB

    https://www.shadertoy.com/view/wdcGDB

  • 14

    RESULTS - OUR METHOD

  • 15

    RESULTS - POINT SAMPLED

  • 16

    RESULTS - FACE SAMPLED

  • 17

    RESULTS - POINT SAMPLED

  • 18

    RESULTS - EDGE SAMPLED

  • 19

    RESULTS - RIGID BODIES

  • 20

    CULLING

    30 40 50 60 70 80 90 100Frame

    103

    104

    105

    106

    Cou

    nt

    Cloth Dragon - Culling Efficiency

    Faces TestedFaces PassedContacts Created

    20 30 40 50 60 70 80 90 100Frame

    104

    105

    106

    107

    108

    Cou

    nt

    Rigid Shells - Culling Efficiency

    Faces TestedFaces PassedContacts Created

  • 21

    CONVERGENCE

    5 10 15 20 25 30Iteration

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    0.12

    Rel

    ativ

    e Er

    ror

    Convergence - Frank-Wolfe

    5 10 15 20 25 30Iteration

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    0.12

    Rel

    ativ

    e Er

    ror

    Convergence - Golden Section Search

    5 10 15 20 25 30Iteration

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    0.12

    Rel

    ativ

    e Er

    ror

    Convergence - Projected Gradient Descent

  • 22

    ANALYTIC DISTANCE FIELDS

  • 23

    DEFORMABLE SOLIDS

    • Our approach can be combined with methods to deform SDFs using cage embeddings

    • [Fisher & Lin 2001, McAdams et al. 2011]

    • Method:

    1. Project face to material space

    2. Perform optimization in local space

    3. Project back to world space

  • 24

    DEFORMABLE SOLIDS

  • 25

    FUTURE WORK

    • What if we have no embedded surface representation?

    • SDF/SDF contact

    • Higher order schemes, e.g.: Newton, accelerated descent methods

    • Implicit subdivision for multiple contacts:

  • 26

    REFERENCES

    • Quilez, I. (2008). Modeling with distance functions. https://iquilezles.org/www/articles/distfunctions/distfunctions.htm

    • Basu, K., & Owen, A. B. (2015). Low discrepancy constructions in the triangle. SIAM Journal on Numerical Analysis, 53(2), 743-761.

    • Ericson, C. (2004). Real-time collision detection. CRC Press.

    • Jaggi, M. (2013). Revisiting Frank-Wolfe: Projection-free sparse convex optimization. In Proceedings of the 30th international conference on machine learning

    • Fisher, S., & Lin, M. C. (2001). Deformed distance fields for simulation of non-penetrating flexible bodies. In Computer Animation and Simulation 2001 (pp. 99-111). Springer, Vienna.

    • McAdams, A., Zhu, Y., Selle, A., Empey, M., Tamstorf, R., Teran, J., & Sifakis, E. (2011). Efficient elasticity for character skinning with contact and collisions. In ACM SIGGRAPH 2011 papers

    https://iquilezles.org/www/articles/distfunctions/distfunctions.htmhttps://iquilezles.org/www/articles/distfunctions/distfunctions.htm

Recommended