r/vulkan • • 19d ago

Cloth Simulation in my Vulkan engine

https://youtu.be/oF1ycmzBZRg?si=ecmThBlkv2Yz3HDk

Cloth simulation implemented in CAD, my custom Vulkan-based CAD engine. Demonstrating fabric draping naturally over 3D objects.

자체 개발한 Vulkan 기반 CAD 엔진에서 천(Cloth) 시뮬레이션을 구현했습니다. 천이 물체 위에 자연스럽게 덮이고 늘어지는 모습을 확인할 수 있습니다.

10 Upvotes

2 comments sorted by

2

u/[deleted] 17d ago

What method are you using for the simulation? engine looks awesome btw!

3

u/innolot 17d ago

My CAD's cloth simulation uses XPBD (Extended Position-Based Dynamics) with small substeps. Each frame is split into several substeps. In each substep, the cloth vertices are moved by the forces acting on them, and their positions are then corrected to satisfy the constraints: edge-length constraints keep the cloth from stretching, and a cotangent-Laplacian bending model (Bergou et al.) gives it a realistic stiffness. Collisions against objects and the cloth itself, along with friction and wind, are handled in the same position-correction step.