Are there techniques for simulation of cloth and hair in an efficient (in other words, not too CPU-intensive) manner? I only need to calculate the key points as the drawing will be done in 2D.

  • \$\begingroup\$ What are the "key points"? What do you mean by that term? \$\endgroup\$ Commented Oct 31, 2011 at 8:08

1 Answer 1


Verlet integration is relatively lightweight, and can be scaled easily by adjusting the number of total particles present in the cloth (so you can scale the simulation from a very smooth, 10,000 particle scenario to one that only uses nine "key" particles or so). The quality and verisimilitude of the simulation will suffer as you scale the system down, however.

The Jacobson article on Gamasutra discusses Verlet physics from a very basic perspective and builds upon that (he focuses on character physics, but the technique is applicable to cloth as well). Alternatively, here's a blog post (and a follow-up) on building cloth simulations with Verlet integration. You can find plenty of other resources using Google should you need further information (for example, this article, this collection of sample OpenGL implementations, et cetera).

The technique can be applied to hair as well, and you can similar scale it in that context -- you can either use several sets of "strands" of connected particles to simulate bands of hair, or simply treat it like cloth directly (with an appropriate, more hair-like texture).

If you have a GPU available, you could also look at offloading some of the computation on to the GPU to free up the CPU for other tasks; depending on the task balance in your game already, this may or may not be a feasible optimization for the CPU.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .