Live data from Hacker News

Drape – a Fabric Simulator

aatishb.github.io

41–45 of 45 posts

Re: Drape – a Fabric Simulator

#41
post #37

Earlier quoted context omitted.

Turning on "no self intersect" produces much more realistic-looking results; any reason you don't have that on by default?

I'm not the author, but enabling NoSelfIntersect totally ruined the frame rate for me. I was barely able to open the controls to disable it again. It's possible it's not on by default as a performance consideration.

Yup, that setting is implemented in a somewhat naive way. The way it works is that I iterate through every pair of points on the cloth, check for when they get too close, and if they are, I introduce a spring to push them apart. So effectively this introduces a short-range repulsive force between pieces of the cloth.

Avoiding self intersections results in more realistic cloth behavior like folds and wrinkles. The problem is, iterating through all pairs of points comes at a computational cost, and can really drop the frame-rate, particularly for large cloths. So I decided to keep this setting off by default until I have a smarter way to implement this (e.g. using quadtrees).

Re: Drape – a Fabric Simulator

#42

That's pretty cool! Do you have any plans to have it respect the boundaries of solid objects it comes in contact with such as the poles it's tethered to? Currently, the cloth will go through the poles instead of interacting with the poles as solid objects.

I'd started off this project by using a fancier ray-tracing method of detecting and avoiding collisions with arbitrary shaped objects. Unfortunately it was just too slow for satisfying real-time performance. So finally, I went with doing the collision detection in a case-by-case way for more simple shapes (ball, table, etc.). The poles would be easy to add as an option, I may try to add that in. Thanks for the suggestion!

Re: Drape – a Fabric Simulator

#43

I disabled cross-grain and drape and it billowed and exploded: https://twitter.com/eigenbom/status/738887973559668736 Not sure if bug or if those parameters are not in the space of valid options. Cool project btw!

Haha nice! Try that in wire-frame mode and it looks even crazier: https://twitter.com/aatishb/status/727270083601551360

I left that in as allowable behavior, because our goal with this was not necessarily to model a realistic cloth but more to experience interesting and unusual movements and behaviors. So glitch away!

Re: Drape – a Fabric Simulator

#44

This is neat as a personal project restricted to WebGL and real-time. The state-of-the-art in commercially available cloth/clothing creation simulation these days is Marvelous Designer and it is available for ~$400. It does produce results that are pretty phenomenal and hard to tell from real-life. http://www.marvelousdesigner.com http://www.marvelousdesigner.com/product/features http://www.marvelousdesigner.com/case…

Their collisions are ok... I like this stuff from Disney: https://www.youtube.com/watch?v=uHfQL5UjXhk Those knots are gnarly!

this is most likely ray traced, ie, not computed in real time and not on the client computers

Re: Drape – a Fabric Simulator

#45

Earlier quoted context omitted.

Interesting. It works great on my iPad Mini 4 on Safari. Maybe the problem is either the browser or your graphic drivers, not the CPU.

It's an old laptop with an integrated GPU running Ubuntu so it's a combination of all.

>old laptop

Last time you cleaned it?

Post reply on HN