Vertex Elastic Deformation

Tools

  • Compute Shaders (HLSL)
  • Unity Shader Graph
  • Unity C# Monobehaviours

Smooth Elasticity without Soft Body Physics

This system uses a compute shader based system in Unity 3D to fetch data from the vertex buffer and calculates the elastic positioning of each vertex using second-order harmonics. It does not calculate complex particle physics – only per vertex calculations.

  • Works with Skinned Mesh Renderers (blend-shapes & rigged models)
  • Uses SDFs of various shapes as colliders (boxes, capsules, cylinders, cones, spheres, etc.)
    • Can also use a combination of multiple shapes
  • Runs in real-time with little overhead by dispatching a compute per-frame.
  • Completely stable: won’t explode your vertices

Mess around with parameters to adjust the movement

  • Dampening: defines how fast the mesh returns to its original shape. The greater it is, the slower it moves
  • Frequency: defines how fast the mesh will oscillate before returning to the original shape. Also alterates response time
  • Response: Modifies the overshoot of the movement — how fast the initial speed of the movement is.

References