Skip to content

Deformation Gradient in GLSL

November 2023

I learned how to compute the deformation gradient F=xX in my computer animation class for FEM simulations. Wanted to see if I could do it in a vertex shader, so here it is.

The original goal was to render cloth with Gaussian splats embedded in a triangle mesh. As the cloth deforms, each splat needs to deform correctly with the surface---that's where computing F per-vertex in real-time becomes useful. This demo shows the deformation gradient computation working on a simple mesh.

The implementation follows concepts from the book[1].

Controls: Space to rotate, D to toggle deformation gradient, W for wireframe

References

  1. FEM Simulation of 3D Deformable Solids - Eftychios Sifakis, Jernej Barbič